]> granicus.if.org Git - gc/commitdiff
Fix test_cpp failure caused by arbitrary link order (Win32)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 26 Jul 2019 18:35:30 +0000 (21:35 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 26 Jul 2019 18:35:30 +0000 (21:35 +0300)
(fix of commit 4a08ae983)

* Makefile.direct (test_cpp): Pass -D GC_NOT_DLL to $(CC) (except for
HP UX case).
* configure.ac [($enable_shared=no || $enable_static=yes)
&& $host=*-*-cygwin*|*-*-mingw*|*-*-msys*] (CXXFLAGS): Add
-D GC_NOT_DLL; add comment.

Makefile.direct
configure.ac

index 8e6d9f413e732fa23797da4f8eeb8785e0ea6804..9c3c078a0bb816aa26dbd1e48c98ed8c60dbc65a 100644 (file)
@@ -229,7 +229,7 @@ test_cpp$(EXEEXT): $(srcdir)/tests/test_cpp.cc $(srcdir)/include/gc_cpp.h \
   $(srcdir)/include/gc.h c++ base_lib $(UTILS)
        rm -f test_cpp$(EXEEXT)
        ./if_mach HP_PA HPUX $(CXX) $(CXXFLAGS) -o test_cpp $(srcdir)/tests/test_cpp.cc gc.a gccpp.a -ldld `./threadlibs`
-       ./if_not_there test_cpp$(EXEEXT) || $(CXX) $(CXXFLAGS) -o test_cpp$(EXEEXT) $(srcdir)/tests/test_cpp.cc gc.a gccpp.a `./threadlibs`
+       ./if_not_there test_cpp$(EXEEXT) || $(CXX) $(CXXFLAGS) -DGC_NOT_DLL -o test_cpp$(EXEEXT) $(srcdir)/tests/test_cpp.cc gc.a gccpp.a `./threadlibs`
 
 check-cpp: test_cpp$(EXEEXT)
        ./test_cpp
index 5720f220f0304339b2f88f172f67ede23c38d2ab..1625cbd3a0ff857547d79235cfe9a60978116c60 100644 (file)
@@ -554,6 +554,10 @@ else
       # Do not require the clients to link with "user32" system library.
       AC_DEFINE([DONT_USE_USER32_DLL], 1,
                 [Do not use user32.dll import library (Win32).])
+      # Use inline version of GC new and delete operators in test_cpp
+      # otherwise the system ones might be used instead because of arbitrary
+      # ordering of object files when linking.
+      CXXFLAGS="$CXXFLAGS -DGC_NOT_DLL"
       ;;
   esac
 fi