bdwgc icon indicating copy to clipboard operation
bdwgc copied to clipboard

Fix linkage with a system libatomic_ops shared library

Open ffontaine opened this issue 5 years ago • 1 comments

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.

[Retrieved from: https://github.com/ivmai/bdwgc/commit/02a44ee1df8176c72e75fd706d1a8f063d3196d5]

Signed-off-by: Fabrice Fontaine [email protected]

ffontaine avatar Jan 23 '21 21:01 ffontaine

Do you have some comments on this PR opened nearly one year ago?

ffontaine avatar Jan 07 '22 12:01 ffontaine