From: Chris S. <ir0...@gm...> - 2010-08-30 13:00:26
|
The latest crt (at least the one in the Cygwin 'dist' release) has conflicting exports: csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib $ x86_64-w64-mingw32-nm.exe libadvapi32.a | grep -i OpenProc 0000000000000000 T OpenProcessToken 0000000000000000 I __imp_OpenProcessToken csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib $ x86_64-w64-mingw32-nm.exe libkernel32.a | grep -i OpenProc 0000000000000000 T OpenProcessToken 0000000000000000 I __imp_OpenProcessToken 0000000000000000 T OpenProcess 0000000000000000 I __imp_OpenProcess The OpenProcessToken in particular has come to bite me in a bad way with Emerge Desktop. I ran in to this issue when using gendef to update the def files for w32api, in that I had to check for multiple export definitions of the same function and go to MSDN to determine which library is expected to export a given function. Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
From: JonY <jo...@us...> - 2010-08-30 13:28:46
|
On 8/30/2010 21:00, Chris Sutcliffe wrote: > The latest crt (at least the one in the Cygwin 'dist' release) has > conflicting exports: > > csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib > $ x86_64-w64-mingw32-nm.exe libadvapi32.a | grep -i OpenProc > 0000000000000000 T OpenProcessToken > 0000000000000000 I __imp_OpenProcessToken > > csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib > $ x86_64-w64-mingw32-nm.exe libkernel32.a | grep -i OpenProc > 0000000000000000 T OpenProcessToken > 0000000000000000 I __imp_OpenProcessToken > 0000000000000000 T OpenProcess > 0000000000000000 I __imp_OpenProcess > > The OpenProcessToken in particular has come to bite me in a bad way > with Emerge Desktop. I ran in to this issue when using gendef to > update the def files for w32api, in that I had to check for multiple > export definitions of the same function and go to MSDN to determine > which library is expected to export a given function. > Thanks for the report. Do you have a list of symbols that are known to conflict? |
From: Kai T. <kti...@go...> - 2010-08-30 13:52:41
|
2010/8/30 JonY <jo...@us...>: > On 8/30/2010 21:00, Chris Sutcliffe wrote: >> The latest crt (at least the one in the Cygwin 'dist' release) has >> conflicting exports: >> >> csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib >> $ x86_64-w64-mingw32-nm.exe libadvapi32.a | grep -i OpenProc >> 0000000000000000 T OpenProcessToken >> 0000000000000000 I __imp_OpenProcessToken >> >> csutclif@EUSH000065 /usr/x86_64-w64-mingw32/sys-root/mingw/lib >> $ x86_64-w64-mingw32-nm.exe libkernel32.a | grep -i OpenProc >> 0000000000000000 T OpenProcessToken >> 0000000000000000 I __imp_OpenProcessToken >> 0000000000000000 T OpenProcess >> 0000000000000000 I __imp_OpenProcess >> >> The OpenProcessToken in particular has come to bite me in a bad way >> with Emerge Desktop. I ran in to this issue when using gendef to >> update the def files for w32api, in that I had to check for multiple >> export definitions of the same function and go to MSDN to determine >> which library is expected to export a given function. >> > > Thanks for the report. Do you have a list of symbols that are known to > conflict? > > > ------------------------------------------------------------------------------ > Sell apps to millions through the Intel(R) Atom(Tm) Developer Program > Be part of this innovative community and reach millions of netbook users > worldwide. Take advantage of special opportunities to increase revenue and > speed time-to-market. Join now, and jumpstart your future. > http://p.sf.net/sfu/intel-atom-d2d > _______________________________________________ > Mingw-w64-public mailing list > Min...@li... > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > Hi Chris, I suspect that it is real conflict in terms of double definition. It is more likely that you get failures when you link to kernel32 symbol and then attempt to start your app on an OS without this export in kernel32. So this issue could be solved also by different import-library order. Am I right? As the linker won't cause here double defined symbols AFAIK, as it choose always the first seen symbol and resolve by it. Cheers, Kai PS: To comment out OpenProcessToken in kernel32.def is fine by me -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |
From: Chris S. <ir0...@gm...> - 2010-08-30 13:57:31
|
On 30 August 2010 09:27, JonY wrote: > On 8/30/2010 21:00, Chris Sutcliffe wrote: >> The OpenProcessToken in particular has come to bite me in a bad way >> with Emerge Desktop. I ran in to this issue when using gendef to >> update the def files for w32api, in that I had to check for multiple >> export definitions of the same function and go to MSDN to determine >> which library is expected to export a given function. > > Thanks for the report. Do you have a list of symbols that are known to > conflict? Based on what I did with w32api: 2010-08-21 Chris Sutcliffe <ir0...@us...> * lib/kernel32.def (CopyLZFile, GetExpandedNameA, GetExpandedNameW, LZClose, LZCopy, LZInit, LZOpenFileA, LZOpenFileW, LZRead, LZSeek, OpenProcessToken, OpenThreadToken, RegCloseKey, RegCreateKeyExA, RegCreateKeyExW, RegDeleteKeyExA, RegDeleteKeyExW, RegDeleteValueA, RegDeleteValueW, RegEnumKeyExA, RegEnumKeyExW, RegEnumValueA, RegEnumValueW, RegFlushKey, RegGetKeySecurity, RegLoadKeyA, RegLoadKeyW, RegNotifyChangeKeyValue, RegOpenCurrentUser, RegOpenKeyExA, RegOpenKeyExW, RegOpenUserClassesRoot, RegQueryInfoKeyA, RegQueryInfoKeyW, RegQueryValueExA, RegQueryValueExW, RegRestoreKeyA, RegRestoreKeyW, RegSetKeySecurity, RegSetValueExA, RegSetValueW, RegUnLoadKeyA, RegUnLoadKeyW, RtlCaptureStackBackTrace, RtlFillMemory, RtlMoveMemory, RtlZeroMemory, SetThreadToken): Remove conflicting definition. * lib/th32.def: Remove. * lib/ntdll.def (RtlUnwind): Remove conflicting definition. * lib/version.def (VerLanguageNameA, VerLanguageNameW): Remove conflicting definition. However, I did not regenerate all def files, so there may be others as well. Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
From: Kai T. <kti...@go...> - 2010-08-30 14:21:28
|
2010/8/30 Chris Sutcliffe <ir0...@gm...>: > On 30 August 2010 09:27, JonY wrote: >> On 8/30/2010 21:00, Chris Sutcliffe wrote: >>> The OpenProcessToken in particular has come to bite me in a bad way >>> with Emerge Desktop. I ran in to this issue when using gendef to >>> update the def files for w32api, in that I had to check for multiple >>> export definitions of the same function and go to MSDN to determine >>> which library is expected to export a given function. >> >> Thanks for the report. Do you have a list of symbols that are known to >> conflict? > > Based on what I did with w32api: > > 2010-08-21 Chris Sutcliffe <ir0...@us...> > > * lib/kernel32.def (CopyLZFile, GetExpandedNameA, > GetExpandedNameW, LZClose, > LZCopy, LZInit, LZOpenFileA, LZOpenFileW, LZRead, LZSeek, > OpenProcessToken, > OpenThreadToken, RegCloseKey, RegCreateKeyExA, RegCreateKeyExW, > RegDeleteKeyExA, RegDeleteKeyExW, RegDeleteValueA, RegDeleteValueW, > RegEnumKeyExA, RegEnumKeyExW, RegEnumValueA, RegEnumValueW, RegFlushKey, > RegGetKeySecurity, RegLoadKeyA, RegLoadKeyW, RegNotifyChangeKeyValue, > RegOpenCurrentUser, RegOpenKeyExA, RegOpenKeyExW, > RegOpenUserClassesRoot, > RegQueryInfoKeyA, RegQueryInfoKeyW, RegQueryValueExA, RegQueryValueExW, > RegRestoreKeyA, RegRestoreKeyW, RegSetKeySecurity, RegSetValueExA, > RegSetValueW, RegUnLoadKeyA, RegUnLoadKeyW, RtlCaptureStackBackTrace, > RtlFillMemory, RtlMoveMemory, RtlZeroMemory, SetThreadToken): Remove > conflicting definition. > * lib/th32.def: Remove. > * lib/ntdll.def (RtlUnwind): Remove conflicting definition. > * lib/version.def (VerLanguageNameA, VerLanguageNameW): Remove > conflicting > definition. > > However, I did not regenerate all def files, so there may be others as well. > > Chris > > -- > Chris Sutcliffe > http://emergedesktop.org > http://www.google.com/profiles/ir0nh34d The issue you see here is related to the default import library order given by gcc. It uses "-luser32 -lkernel32 -ladvapi32 -lshell32" which leads here to the issue. IMHO kernel32 should come last here. Something like this is more correct "-lshell32 -ladvapi32 -luser32 -lkernel32" Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |
From: Chris S. <ir0...@gm...> - 2010-08-30 14:40:30
|
On 30 August 2010 10:21, Kai Tietz wrote: > The issue you see here is related to the default import library order > given by gcc. It uses "-luser32 -lkernel32 -ladvapi32 -lshell32" which > leads here to the issue. IMHO kernel32 should come last here. > Something like this is more correct "-lshell32 -ladvapi32 -luser32 > -lkernel32" Is it possible to override / change the default link order (i.e. is it in a config file somewhere), or is it hard coded at compile time? Thank you, Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
From: Kai T. <kti...@go...> - 2010-08-30 14:42:53
|
2010/8/30 Chris Sutcliffe <ir0...@gm...>: > On 30 August 2010 10:21, Kai Tietz wrote: >> The issue you see here is related to the default import library order >> given by gcc. It uses "-luser32 -lkernel32 -ladvapi32 -lshell32" which >> leads here to the issue. IMHO kernel32 should come last here. >> Something like this is more correct "-lshell32 -ladvapi32 -luser32 >> -lkernel32" > > Is it possible to override / change the default link order (i.e. is it > in a config file somewhere), or is it hard coded at compile time? > > Thank you, > > Chris Well, this is a suggested default by gcc (IMHO we should change here order, or teach ld to know dependencies odering of import-libraries). But of course by using 'gcc -o myapp.exe my-object-files -ladvapi32' forces that advapi32 library gets linked before the default one. Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |
From: Chris S. <ir0...@gm...> - 2010-08-30 15:18:36
|
On 30 August 2010 10:42, Kai Tietz wrote: > 2010/8/30 Chris Sutcliffe <ir0...@gm...>: >> Is it possible to override / change the default link order (i.e. is it >> in a config file somewhere), or is it hard coded at compile time? > > Well, this is a suggested default by gcc (IMHO we should change here > order, or teach ld to know dependencies odering of import-libraries). > But of course by using 'gcc -o myapp.exe my-object-files -ladvapi32' > forces that advapi32 library gets linked before the default one. One other thought I had was specifying '-nodefaultlibs', but I think that may be a little extreme, given: -nodefaultlibs Do not use the standard system libraries when linking. Only the libraries you specify will be passed to the linker, options specifying linkage of the system libraries, such as -static-libgcc or -shared-libgcc, will be ignored. The standard startup files are used normally, unless -nostartfiles is used. The compiler may generate calls to memcmp, memset, memcpy and memmove. These entries are usually resolved by entries in libc. These entry points should be supplied through some other mechanism when this option is specified. from the desciption, I would need to add -lgcc_s, etc. Is there a less extreme option to only override kernel32, advapi, etc.? Thank you, Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
From: Kai T. <kti...@go...> - 2010-08-30 15:23:39
|
2010/8/30 Chris Sutcliffe <ir0...@gm...>: > On 30 August 2010 10:42, Kai Tietz wrote: >> 2010/8/30 Chris Sutcliffe <ir0...@gm...>: >>> Is it possible to override / change the default link order (i.e. is it >>> in a config file somewhere), or is it hard coded at compile time? >> >> Well, this is a suggested default by gcc (IMHO we should change here >> order, or teach ld to know dependencies odering of import-libraries). >> But of course by using 'gcc -o myapp.exe my-object-files -ladvapi32' >> forces that advapi32 library gets linked before the default one. > > One other thought I had was specifying '-nodefaultlibs', but I think > that may be a little extreme, given: > > -nodefaultlibs > Do not use the standard system libraries when linking. Only the > libraries you specify will be passed to the linker, options specifying > linkage of the system libraries, such as -static-libgcc or > -shared-libgcc, will be ignored. The standard startup files are used > normally, unless -nostartfiles is used. The compiler may generate > calls to memcmp, memset, memcpy and memmove. These entries are usually > resolved by entries in libc. These entry points should be supplied > through some other mechanism when this option is specified. > > from the desciption, I would need to add -lgcc_s, etc. Is there a > less extreme option to only override kernel32, advapi, etc.? > > Thank you, > > Chris > > -- > Chris Sutcliffe > http://emergedesktop.org > http://www.google.com/profiles/ir0nh34d > Well, this is a bit too much. Just make sure you specify on command line (at end, or before -lkernel32 - if you specify it - the option -ladvapi32. You can file a bug report for gcc, so I don't miss to modify it for 4.6. Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |
From: Chris S. <ir0...@gm...> - 2010-08-30 16:06:00
|
On 30 August 2010 11:23, Kai Tietz wrote: > Well, this is a bit too much. Just make sure you specify on command > line (at end, or before -lkernel32 - if you specify it - the option > -ladvapi32. You can file a bug report for gcc, so I don't miss to > modify it for 4.6. Done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45452 Cheers! Chris -- Chris Sutcliffe http://emergedesktop.org http://www.google.com/profiles/ir0nh34d |
From: Kai T. <kti...@go...> - 2010-08-31 12:33:05
|
2010/8/30 Chris Sutcliffe <ir0...@gm...>: > On 30 August 2010 11:23, Kai Tietz wrote: >> Well, this is a bit too much. Just make sure you specify on command >> line (at end, or before -lkernel32 - if you specify it - the option >> -ladvapi32. You can file a bug report for gcc, so I don't miss to >> modify it for 4.6. > > Done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45452 > > Cheers! > > Chris Patch sent to ML and did some corrections on report about affected targets. Thanks, Kai -- | (\_/) This is Bunny. Copy and paste | (='.'=) Bunny into your signature to help | (")_(") him gain world domination |