diff options
author | Fabrice Fontaine <fontaine.fabrice@gmail.com> | 2018-11-05 22:50:40 +0100 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-11-15 11:52:35 +0300 |
commit | 02a44ee1df8176c72e75fd706d1a8f063d3196d5 (patch) | |
tree | aa5ca5746e27843457c31bb8ada11a94230d2e1d /configure.ac | |
parent | 22b7fe6276e0e6915171ab72efd38f8add5f7adb (diff) | |
download | bdwgc-02a44ee1df8176c72e75fd706d1a8f063d3196d5.tar.gz |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 21abe8fa..9ffe81de 100644 --- a/configure.ac +++ b/configure.ac @@ -1081,7 +1081,9 @@ AS_IF([test x"$with_libatomic_ops" = xno \ AC_MSG_CHECKING([which libatomic_ops to use]) AS_IF([test x"$with_libatomic_ops" != xno], [ AS_IF([test x"$with_libatomic_ops" != xnone -a x"$THREADS" != xnone], - [ AC_MSG_RESULT([external]) ], + [ AC_MSG_RESULT([external]) + ATOMIC_OPS_LIBS="-latomic_ops" + AC_SUBST([ATOMIC_OPS_LIBS]) ], [ AC_MSG_RESULT([none]) AS_IF([test x"$THREADS" != xnone], [ AC_DEFINE([GC_BUILTIN_ATOMIC], [1], |