"No LDT support on this platform" self compiled wine issue

I build wine-wow64 using ./configure --enable-archs=i386,x86_64 --without-capi
make -j8

It runs 64-bit software is very ok, but when I run a 32-bit applicantion, it says No LDT support on this platform
 
Hi, looking at wine's code relevant to WoW64 mode, you will have to patch several files to support FreeBSD otherwise the current ifdefs are:

C:
void ldt_set_entry( WORD sel, LDT_ENTRY entry )
{
#ifdef linux
    struct modify_ldt_s ldt_info = { .entry_number = sel >> 3 };
    int ret;

    ldt_info.base_addr       = ldt_get_base( entry );
    ldt_info.limit           = entry.LimitLow | (entry.HighWord.Bits.LimitHi << 16);
    ldt_info.seg_32bit       = entry.HighWord.Bits.Default_Big;
    ldt_info.contents        = (entry.HighWord.Bits.Type >> 2) & 3;
    ldt_info.read_exec_only  = !(entry.HighWord.Bits.Type & 2);
    ldt_info.limit_in_pages  = entry.HighWord.Bits.Granularity;
    ldt_info.seg_not_present = !entry.HighWord.Bits.Pres;
    ldt_info.usable          = entry.HighWord.Bits.Sys;
    if ((ret = modify_ldt( &ldt_info ))) ERR( "modify_ldt failed %d\n", ret );
#elif defined(__APPLE__)
    if (i386_set_ldt(sel >> 3, (union ldt_entry *)&entry, 1) < 0) perror("i386_set_ldt");
#else
    fprintf( stderr, "No LDT support on this platform\n" );
    exit(1);
#endif
}

Check the wine-proton code (and the bug/review to push it to version 10) as that already includes wow64 patches (and maybe check with shkhln as he worked on that on the past).
 
Hi, looking at wine's code relevant to WoW64 mode, you will have to patch several files to support FreeBSD otherwise the current ifdefs are:

C:
void ldt_set_entry( WORD sel, LDT_ENTRY entry )
{
#ifdef linux
    struct modify_ldt_s ldt_info = { .entry_number = sel >> 3 };
    int ret;

    ldt_info.base_addr       = ldt_get_base( entry );
    ldt_info.limit           = entry.LimitLow | (entry.HighWord.Bits.LimitHi << 16);
    ldt_info.seg_32bit       = entry.HighWord.Bits.Default_Big;
    ldt_info.contents        = (entry.HighWord.Bits.Type >> 2) & 3;
    ldt_info.read_exec_only  = !(entry.HighWord.Bits.Type & 2);
    ldt_info.limit_in_pages  = entry.HighWord.Bits.Granularity;
    ldt_info.seg_not_present = !entry.HighWord.Bits.Pres;
    ldt_info.usable          = entry.HighWord.Bits.Sys;
    if ((ret = modify_ldt( &ldt_info ))) ERR( "modify_ldt failed %d\n", ret );
#elif defined(__APPLE__)
    if (i386_set_ldt(sel >> 3, (union ldt_entry *)&entry, 1) < 0) perror("i386_set_ldt");
#else
    fprintf( stderr, "No LDT support on this platform\n" );
    exit(1);
#endif
}

Check the wine-proton code (and the bug/review to push it to version 10) as that already includes wow64 patches (and maybe check with shkhln as he worked on that on the past).
I don't know how to patch files. If I try the old wow64 to compile three times, can it be done without modifying any files?
 
I don't know how to patch files. If I try the old wow64 to compile three times, can it be done without modifying any files?
No, the current wine sources don't work unpatched for WoW64.
If you want wine with wow64 mode enabled use the wine-proton package (unless you want to figuring out how the patch command works), it's a bit old but it's heavily patched for gaming anyway.

Alternatively, just install the latest wine or wine-devel package and use two prefixes like suggested in the package message.
 
No, the current wine sources don't work unpatched for WoW64.
If you want wine with wow64 mode enabled use the wine-proton package (unless you want to figuring out how the patch command works), it's a bit old but it's heavily patched for gaming anyway.

Alternatively, just install the latest wine or wine-devel package and use two prefixes like suggested in the package message.
I found this https://github.com/XaeroVincent/freebsd-wine-wow64. It's a 10.8 wine-wow64 and works fine. But I also don't what it is patched like wine-proton. May I need ask AI to do such thing
 
That repo is a fork of shkhln's wine-devel 10.5, with an extra patch on top for cyberpunk. If you just want proton 10, check the repo from which it was forked has it has both wine-devel and wine-proton.

But in any case, if it's working for you that's enough, no?
 
That repo is a fork of shkhln's wine-devel 10.5, with an extra patch on top for cyberpunk. If you just want proton 10, check the repo from which it was forked has it has both wine-devel and wine-proton.

But in any case, if it's working for you that's enough, no?
Can I just use this directly?
 
Not directly, you have to patch the files, see the documentation about compiling a port, and use that repo as a starting point to make a custom port of the newer wine source releases.

It may be easier to just build that port, install the generated package, use it and see if it works for what you want.

Or just use what is on the pkg repositories
 
Back
Top