This reverts commit bea244b471878eb6924463987eddb04cc581e306.
Unfortunately this would also reintroduce the issue that commit
fixed - but the commit doesn't elaborate on the details of those
issues.

We need to provide the version of these functions without a __imp_
prefix. Even though calling code normally will use the __imp_ prefixed
version (since it is declared with a dllimport attribute in the headers),
statically initialized data (e.g. a global pointer or table containing
pointers, initialized to point to InterlockedCompareExchange) will end
up referencing the unprefixed version.

GNU ld can fix up that automatically during linking, but lld can't.

This fixes linking sqlite3 (as part of Qt) with clang/lld for i686.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/lib32/kernel32.def | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mingw-w64-crt/lib32/kernel32.def b/mingw-w64-crt/lib32/kernel32.def
index 5b75f89..ece261f 100644
--- a/mingw-w64-crt/lib32/kernel32.def
+++ b/mingw-w64-crt/lib32/kernel32.def
@@ -763,13 +763,13 @@ InitializeCriticalSectionEx@12
 InitializeProcThreadAttributeList@16
 InitializeSListHead@4
 InitializeSRWLock@4
-InterlockedCompareExchange64@20 DATA ; FIXME: this is for Vista+. forwards to 
NTDLL.RtlInterlockedCompareExchange64@20
-InterlockedCompareExchange@12 DATA
-InterlockedDecrement@4 DATA
-InterlockedExchange@8 DATA
-InterlockedExchangeAdd@8 DATA
+InterlockedCompareExchange64@20 ; FIXME: this is for Vista+. forwards to 
NTDLL.RtlInterlockedCompareExchange64@20
+InterlockedCompareExchange@12
+InterlockedDecrement@4
+InterlockedExchange@8
+InterlockedExchangeAdd@8
 InterlockedFlushSList@4
-InterlockedIncrement@4 DATA
+InterlockedIncrement@4
 InterlockedPopEntrySList@4
 InterlockedPushEntrySList@8
 InvalidateConsoleDIBits@8
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to