[Gc] Re: link libgc.so against libdl (patch)

Rex Dieter rdieter at math.unl.edu
Thu Mar 16 06:47:15 PST 2006


Rex Dieter wrote:
> Per:
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/recent_changes
> in todo section:
>  - A dynamic libgc.so references dlopen unconditionally, but doesn't 
> link against libdl.
> 
> Here's a patch to fix that.  Feel free to omit the '-Wl,--no-undefined' 
> bits, as that is probably(?) not portable and is limited to supporting 
> gnu ld.
> 

Oops, forgot to attach the patch, here it is.

-- Rex
-------------- next part --------------
--- gc6.7/Makefile.am.no-undefined	2006-02-18 18:50:37.000000000 -0600
+++ gc6.7/Makefile.am	2006-03-03 22:51:58.000000000 -0600
@@ -57,7 +57,7 @@
 # linuxthread semaphore functions get linked:
 libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
 libgc_la_DEPENDENCIES = @addobjs@
-libgc_la_LDFLAGS = -version-info 1:2:0
+libgc_la_LDFLAGS = -version-info 1:2:0 -no-undefined -Wl,--no-undefined
 
 EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \
     mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
@@ -65,8 +65,8 @@
     sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
 
 libgccpp_la_SOURCES = gc_cpp.cc
-libgccpp_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
-libgccpp_la_LDFLAGS = -version-info 1:2:0
+libgccpp_la_LIBADD = ./libgc.la
+libgccpp_la_LDFLAGS = -version-info 1:2:0 -no-undefined -Wl,--no-undefined
 
 EXTRA_DIST += alpha_mach_dep.S mips_sgi_mach_dep.s sparc_mach_dep.S
 
@@ -91,9 +91,9 @@
 ##     are included in the distribution
 # gctest_OBJECTS = test.o
 gctest_SOURCES = tests/test.c
-gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+gctest_LDADD = ./libgc.la $(EXTRA_TEST_LIBS)
 test_cpp_SOURCES = tests/test_cpp.cc
-test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+test_cpp_LDADD = ./libgccpp.la $(EXTRA_TEST_LIBS)
 
 TESTS = $(check_PROGRAMS)
 
--- gc6.7/Makefile.in.no-undefined	2006-02-18 18:50:57.000000000 -0600
+++ gc6.7/Makefile.in	2006-03-03 22:54:41.000000000 -0600
@@ -340,15 +340,15 @@
 # linuxthread semaphore functions get linked:
 libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
 libgc_la_DEPENDENCIES = @addobjs@
-libgc_la_LDFLAGS = -version-info 1:2:0
+libgc_la_LDFLAGS = -version-info 1:2:0 -no-undefined -Wl,--no-undefined
 EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \
     mips_sgi_mach_dep.s mips_ultrix_mach_dep.s powerpc_darwin_mach_dep.s \
     rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
     sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
 
 libgccpp_la_SOURCES = gc_cpp.cc
-libgccpp_la_LIBADD = $(THREADDLLIBS) $(UNWINDLIBS)
-libgccpp_la_LDFLAGS = -version-info 1:2:0
+libgccpp_la_LIBADD = ./libgc.la
+libgccpp_la_LDFLAGS = -version-info 1:2:0 -no-undefined -Wl,--no-undefined
 AM_CXXFLAGS = @GC_CFLAGS@
 AM_CFLAGS = @GC_CFLAGS@
 @CPLUSPLUS_FALSE at extra_checks = 
@@ -356,9 +356,9 @@
 
 # gctest_OBJECTS = test.o
 gctest_SOURCES = tests/test.c
-gctest_LDADD = ./libgc.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+gctest_LDADD = ./libgc.la $(EXTRA_TEST_LIBS) 
 test_cpp_SOURCES = tests/test_cpp.cc
-test_cpp_LDADD = ./libgc.la ./libgccpp.la $(THREADDLLIBS) $(UNWINDLIBS) $(EXTRA_TEST_LIBS)
+test_cpp_LDADD = ./libgccpp.la $(EXTRA_TEST_LIBS)
 TESTS = $(check_PROGRAMS)
 all_objs = @addobjs@ $(libgc_la_OBJECTS)
 @COMPILER_XLC_FALSE at ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp


More information about the Gc mailing list