From 02a44ee1df8176c72e75fd706d1a8f063d3196d5 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Mon, 5 Nov 2018 22:50:40 +0100 Subject: Fix linkage with a system libatomic_ops shared library Issue #247 (bdwgc). When bdwgc is linked with the external libatomic_ops, bdw-gc.pc must contain the needed dynamic libraries (such as -latomic_ops) otherwise build of applications could fail on the link stage on some hosts: * libgc.so: undefined reference to 'AO_fetch_compare_and_swap_emulation' * libgc.so: undefined reference to 'AO_store_full_emulation' So, this commit sets ATOMIC_OPS_LIBS to "-latomic_ops" when a system atomic_ops library is used and uses ATOMIC_OPS_LIBS in bdw-gc.pc.in. * bdw-gc.pc.in (Libs): Add @ATOMIC_OPS_LIBS@. * configure.ac [$with_libatomic_ops!=no && $with_libatomic_ops!=none && $THREADS!=none] (ATOMIC_OPS_LIBS): Set to -latomic_ops; do AC_SUBST. --- bdw-gc.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bdw-gc.pc.in') diff --git a/bdw-gc.pc.in b/bdw-gc.pc.in index ef4c2341..a32e7598 100644 --- a/bdw-gc.pc.in +++ b/bdw-gc.pc.in @@ -6,5 +6,5 @@ includedir=@includedir@ Name: Boehm-Demers-Weiser Conservative Garbage Collector Description: A garbage collector for C and C++ Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lgc +Libs: -L${libdir} @ATOMIC_OPS_LIBS@ -lgc Cflags: -I${includedir} -- cgit v1.2.1