[Gc] (no subject)

Ivan Maidanski ivmai at mail.ru
Tue Mar 6 05:31:21 PST 2012


Hi Kai,

I found recent commit to gcc/boehmgc regarding DLL_EXPORT handling -
https://github.com/ivmai/bdwgc/commit/6488760cc5b3829bd81d442f0e95cd248f9bcf4d

1. Could you please describe the purpose - AFAIK, GCC (at least Cygwin port) could create dll exporting functions even if they are not tagged with dllexport.
2. I tried to apply your patch (slightly modified - shown below) to recent GC and failed because -D DLL_EXPORT is specified only during compilation of libgc modules but not during compilation of tests causing "GC_print_stats undefined" error.

My alternative solution is to define GC_DLL if --enable-shared with --disable-static.
See commit https://github.com/ivmai/bdwgc/commit/505b041e15e243e0f33540363ac40797e2bff4f4

Regards.

PS. The patch that failed for the recent BDWGC:

diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h
index b340f49..d4b7231 100644
--- a/include/gc_config_macros.h
+++ b/include/gc_config_macros.h
@@ -164,8 +164,9 @@
 # endif
 #endif /* _WIN32_WCE */

-#if defined(_DLL) && !defined(GC_NOT_DLL) && !defined(GC_DLL) \
-        && !defined(__GNUC__)
+#if !defined(GC_NOT_DLL) && !defined(GC_DLL) \
+    && ((defined(_DLL) && !defined(__GNUC__)) \
+        || (defined(DLL_EXPORT) && defined(GC_BUILD)))
 # define GC_DLL
 #endif



More information about the Gc mailing list