Some object files in the crt build were previously built with _CRTBLD,
but not all of them. This lead to these wrappers not defining the
unprefixed function (since that would cause warnings about mismatched
dllimport attributes).

Now that we consistently build these files with _CRTBLD, we can
easily provide the unprefixed version as well.

This fixes linking with lld, which doesn't automatically resolve
an undefined __acrt_iob_func reference to __imp___acrt_iob_func.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
This feels like a much better fix than the previous one.
---
 mingw-w64-crt/misc/__p___argv.c     | 4 ++--
 mingw-w64-crt/stdio/acrt_iob_func.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mingw-w64-crt/misc/__p___argv.c b/mingw-w64-crt/misc/__p___argv.c
index 06b348a..8e1f8ed 100644
--- a/mingw-w64-crt/misc/__p___argv.c
+++ b/mingw-w64-crt/misc/__p___argv.c
@@ -6,10 +6,10 @@
 
 #include <stdlib.h>
 
-static char ***__cdecl local__p___argv(void)
+char ***__cdecl __p___argv(void)
 {
     return __MINGW_IMP_SYMBOL(__argv);
 }
 
 typedef char ***__cdecl (*_f__p___argv)(void);
-_f__p___argv __MINGW_IMP_SYMBOL(__p___argv) = local__p___argv;
+_f__p___argv __MINGW_IMP_SYMBOL(__p___argv) = __p___argv;
diff --git a/mingw-w64-crt/stdio/acrt_iob_func.c 
b/mingw-w64-crt/stdio/acrt_iob_func.c
index e8eb077..085a5fa 100644
--- a/mingw-w64-crt/stdio/acrt_iob_func.c
+++ b/mingw-w64-crt/stdio/acrt_iob_func.c
@@ -6,10 +6,10 @@
 
 #include <stdio.h>
 
-static FILE *__cdecl local__acrt_iob_func(unsigned index)
+FILE *__cdecl __acrt_iob_func(unsigned index)
 {
     return &(__iob_func()[index]);
 }
 
 typedef FILE *__cdecl (*_f__acrt_iob_func)(unsigned index);
-_f__acrt_iob_func __MINGW_IMP_SYMBOL(__acrt_iob_func) = local__acrt_iob_func;
+_f__acrt_iob_func __MINGW_IMP_SYMBOL(__acrt_iob_func) = __acrt_iob_func;
-- 
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