This patch in particular fixes 32-bit build where a slightly old ming32-dlltool chokes on krn386.exe16.ApiName entries. These are marked as PRIVATE anyway, so they won't appear in the generated import library.
Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- tools/winebuild/spec32.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/winebuild/spec32.c b/tools/winebuild/spec32.c index 04af2918c9..47be8af303 100644 --- a/tools/winebuild/spec32.c +++ b/tools/winebuild/spec32.c @@ -961,13 +961,15 @@ void output_def_file( DLLSPEC *spec, int include_stubs ) for (i = total = 0; i < spec->nb_entry_points; i++) { const ORDDEF *odp = &spec->entry_points[i]; - int is_data = 0, is_private = odp->flags & FLAG_PRIVATE; + int is_data = 0, is_stub = 0; + + if (odp->flags & FLAG_PRIVATE) continue;
if (odp->name) name = odp->name; else if (odp->export_name) name = odp->export_name; else continue;
- if (!is_private) total++; + total++; if (!include_stubs && odp->type == TYPE_STUB) continue;
output( " %s", name ); @@ -995,7 +997,7 @@ void output_def_file( DLLSPEC *spec, int include_stubs ) } case TYPE_STUB: if (!kill_at && target_cpu == CPU_x86) output( "@%d", get_args_size( odp )); - is_private = 1; + is_stub = 1; break; default: assert(0); @@ -1003,7 +1005,7 @@ void output_def_file( DLLSPEC *spec, int include_stubs ) output( " @%d", odp->ordinal ); if (!odp->name || (odp->flags & FLAG_ORDINAL)) output( " NONAME" ); if (is_data) output( " DATA" ); - if (is_private) output( " PRIVATE" ); + if (is_stub) output( " PRIVATE" ); output( "\n" ); } if (!total) warning( "%s: Import library doesn't export anything\n", spec->file_name );
Dmitry Timoshkov dmitry@baikal.ru writes:
This patch in particular fixes 32-bit build where a slightly old ming32-dlltool chokes on krn386.exe16.ApiName entries. These are marked as PRIVATE anyway, so they won't appear in the generated import library.
This should be done only for the mingw case, not for the .def import lib case. We need a list of all the functions to get the correct ordinal hints.
Alexandre Julliard julliard@winehq.org wrote:
This patch in particular fixes 32-bit build where a slightly old ming32-dlltool chokes on krn386.exe16.ApiName entries. These are marked as PRIVATE anyway, so they won't appear in the generated import library.
This should be done only for the mingw case, not for the .def import lib case. We need a list of all the functions to get the correct ordinal hints.
What is the sign of the mingw case? Can 'include_stubs' flag be used as an indicator, or something else?
P.S. Also, not mentioned in the patch, for me the 32-bit build still fails like this in dlls/msvcrt/tests: ../../.././../wine64/tools/winegcc/winegcc -o msvcrt_test-stripped.exe -B../../.././../wine64/tools/winebuild \ --sysroot=../../.. -b i586-pc-mingw32 --lib-suffix=.cross.a -s -Wb,-F,msvcrt_test.exe -mno-cygwin \ cpp.cross.o data.cross.o dir.cross.o environ.cross.o file.cross.o headers.cross.o heap.cross.o \ locale.cross.o misc.cross.o printf.cross.o scanf.cross.o signal.cross.o string.cross.o \ time.cross.o testlist.cross.o ../../../dlls/advapi32/libadvapi32.cross.a ../../../dlls/msvcrt/libmsvcrt.cross.a(drjebs00585.o):(.text+0x0): multiple definition of `__onexit' /usr/i586-pc-mingw32/sys-root/mingw/lib/crt2.o:crt1.c:(.text+0x10): first defined here collect2: ld returned 1 exit status winegcc: i586-pc-mingw32-gcc failed
This is a wow64 build, but pure 32-bit build fails same way. I didn't want to make noise with creating a bug report, hopefully you have an idea how to fix this with new PE scheme for the tests.
Dmitry Timoshkov dmitry@baikal.ru writes:
Alexandre Julliard julliard@winehq.org wrote:
This patch in particular fixes 32-bit build where a slightly old ming32-dlltool chokes on krn386.exe16.ApiName entries. These are marked as PRIVATE anyway, so they won't appear in the generated import library.
This should be done only for the mingw case, not for the .def import lib case. We need a list of all the functions to get the correct ordinal hints.
What is the sign of the mingw case? Can 'include_stubs' flag be used as an indicator, or something else?
Yes, include_stubs should work.
P.S. Also, not mentioned in the patch, for me the 32-bit build still fails like this in dlls/msvcrt/tests: ../../.././../wine64/tools/winegcc/winegcc -o msvcrt_test-stripped.exe -B../../.././../wine64/tools/winebuild \ --sysroot=../../.. -b i586-pc-mingw32 --lib-suffix=.cross.a -s -Wb,-F,msvcrt_test.exe -mno-cygwin \ cpp.cross.o data.cross.o dir.cross.o environ.cross.o file.cross.o headers.cross.o heap.cross.o \ locale.cross.o misc.cross.o printf.cross.o scanf.cross.o signal.cross.o string.cross.o \ time.cross.o testlist.cross.o ../../../dlls/advapi32/libadvapi32.cross.a ../../../dlls/msvcrt/libmsvcrt.cross.a(drjebs00585.o):(.text+0x0): multiple definition of `__onexit' /usr/i586-pc-mingw32/sys-root/mingw/lib/crt2.o:crt1.c:(.text+0x10): first defined here collect2: ld returned 1 exit status winegcc: i586-pc-mingw32-gcc failed
This is a wow64 build, but pure 32-bit build fails same way. I didn't want to make noise with creating a bug report, hopefully you have an idea how to fix this with new PE scheme for the tests.
For most of these cases, I'm afraid the answer will be: upgrade Mingw. The old mingw support library has many issues, and I'm not sure we can work around them all. What version are you using?
Alexandre Julliard julliard@winehq.org wrote:
Also, not mentioned in the patch, for me the 32-bit build still fails like this in dlls/msvcrt/tests: ../../.././../wine64/tools/winegcc/winegcc -o msvcrt_test-stripped.exe -B../../.././../wine64/tools/winebuild \ --sysroot=../../.. -b i586-pc-mingw32 --lib-suffix=.cross.a -s -Wb,-F,msvcrt_test.exe -mno-cygwin \ cpp.cross.o data.cross.o dir.cross.o environ.cross.o file.cross.o headers.cross.o heap.cross.o \ locale.cross.o misc.cross.o printf.cross.o scanf.cross.o signal.cross.o string.cross.o \ time.cross.o testlist.cross.o ../../../dlls/advapi32/libadvapi32.cross.a ../../../dlls/msvcrt/libmsvcrt.cross.a(drjebs00585.o):(.text+0x0): multiple definition of `__onexit' /usr/i586-pc-mingw32/sys-root/mingw/lib/crt2.o:crt1.c:(.text+0x10): first defined here collect2: ld returned 1 exit status winegcc: i586-pc-mingw32-gcc failed
This is a wow64 build, but pure 32-bit build fails same way. I didn't want to make noise with creating a bug report, hopefully you have an idea how to fix this with new PE scheme for the tests.
For most of these cases, I'm afraid the answer will be: upgrade Mingw. The old mingw support library has many issues, and I'm not sure we can work around them all. What version are you using?
The crosscompiler is 'i586-pc-mingw32-gcc (GCC) 4.4.2 20091113' while the system-wide compiler is 'gcc-5.3.1 20151207'. It's unlikely that mingw32 version is going to change though.
Dmitry Timoshkov dmitry@baikal.ru writes:
Alexandre Julliard julliard@winehq.org wrote:
Also, not mentioned in the patch, for me the 32-bit build still fails like this in dlls/msvcrt/tests: ../../.././../wine64/tools/winegcc/winegcc -o msvcrt_test-stripped.exe -B../../.././../wine64/tools/winebuild \ --sysroot=../../.. -b i586-pc-mingw32 --lib-suffix=.cross.a -s -Wb,-F,msvcrt_test.exe -mno-cygwin \ cpp.cross.o data.cross.o dir.cross.o environ.cross.o file.cross.o headers.cross.o heap.cross.o \ locale.cross.o misc.cross.o printf.cross.o scanf.cross.o signal.cross.o string.cross.o \ time.cross.o testlist.cross.o ../../../dlls/advapi32/libadvapi32.cross.a ../../../dlls/msvcrt/libmsvcrt.cross.a(drjebs00585.o):(.text+0x0): multiple definition of `__onexit' /usr/i586-pc-mingw32/sys-root/mingw/lib/crt2.o:crt1.c:(.text+0x10): first defined here collect2: ld returned 1 exit status winegcc: i586-pc-mingw32-gcc failed
This is a wow64 build, but pure 32-bit build fails same way. I didn't want to make noise with creating a bug report, hopefully you have an idea how to fix this with new PE scheme for the tests.
For most of these cases, I'm afraid the answer will be: upgrade Mingw. The old mingw support library has many issues, and I'm not sure we can work around them all. What version are you using?
The crosscompiler is 'i586-pc-mingw32-gcc (GCC) 4.4.2 20091113' while the system-wide compiler is 'gcc-5.3.1 20151207'. It's unlikely that mingw32 version is going to change though.
You'd want to install mingw-w64. This will probably become a requirement at some point, old mingw is just hopeless.