libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

export.at failure on MinGW


From: Ralf Wildenhues
Subject: export.at failure on MinGW
Date: Sun, 25 Feb 2007 20:18:17 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hello Charles, all,

I suggest this patch to fix the export test on MinGW.  It did not fail
on Cygwin due to auto-import, but on MinGW it did for the data objects.
WDYT?  I guess stresstest.at needs a similar fix, but there the same
code is currently used to link against a shared and a static version of
the library, so that would need to be fixed as well.

The only thing that's then still worrying me is that on Cygwin, the
mdemo and mdemo_static programs sometimes throw segmentation faults
on my system.  Not all the time though.

And then on both Cygwin and MinGW test 16 (Link order of deplibs) still
fails.  I guess I need to weaken it even further...

Cheers,
Ralf

2007-02-25  Ralf Wildenhues  <address@hidden>

        * tests/export.at: For data object imported from shared library,
        define appropriate macros to expand __declspec(dllimport) on
        w32.  Fixes test failure on MinGW.

Index: tests/export.at
===================================================================
RCS file: /sources/libtool/libtool/tests/export.at,v
retrieving revision 1.2
diff -u -r1.2 export.at
--- tests/export.at     12 Feb 2007 20:50:36 -0000      1.2
+++ tests/export.at     25 Feb 2007 19:04:43 -0000
@@ -89,18 +89,26 @@
 
 AT_DATA(main.c,
 [[
+#if defined(LIBA_DLL_IMPORT)
+#  if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__)
+#    define LIBA_SCOPE extern __declspec(dllimport)
+#  endif
+#endif
+#if !defined(LIBA_SCOPE)
+#  define LIBA_SCOPE extern
+#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
 extern int v1;
 extern int v3, v4;
-extern const int v5, v6;
+LIBA_SCOPE const int v5, v6;
 extern const char* v7;
 extern const char v8[];
 extern int v9(void);
 extern int (*v10) (void);
 extern int (*v11) (void);
-extern int (*const v12) (void);
+LIBA_SCOPE int (*const v12) (void);
 #ifdef __cplusplus
 }
 #endif
@@ -134,7 +142,7 @@
 ]])
 
 AT_CHECK([$LIBTOOL --mode=compile $CC $CPPFLAGS $CFLAGS -c 
a.c],[0],[ignore],[ignore])
-AT_CHECK([$CC $CPPFLAGS $CFLAGS -c main.c],[0],[ignore],[ignore])
+AT_CHECK([$CC $CPPFLAGS -DLIBA_DLL_IMPORT $CFLAGS -c 
main.c],[0],[ignore],[ignore])
 AT_CHECK([$CC $CPPFLAGS $CFLAGS -c broken.c],[0],[ignore],[ignore])
 
 for exportsyms in '' '-export-symbols-regex "v.*"' '-export-symbols asyms'




reply via email to

[Prev in Thread] Current Thread [Next in Thread]