Fix: libnuma is prepended to LIBS
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 9 Nov 2021 15:43:53 +0000 (10:43 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 9 Dec 2021 19:13:47 +0000 (14:13 -0500)
commitda1fdbeafb69b13c01470c3ce76fa8b3a32978a0
treec7a23c634a33f883eaec3869372c225dd6c1362b
parent14f8b52c90ad4a66e2908f454da6bb431f9f35f9
Fix: libnuma is prepended to LIBS

The default behavior, for AC_CHECK_LIB when the `action-if-found` is NOT
defined, is to prepend the library to LIBS. [1]

"
If action-if-found is not specified, the default action prepends
-llibrary to LIBS and defines ‘HAVE_LIBlibrary’ (in all capitals).
"

It is important to note that the LIBS variable is used for ALL linking.

This is normally not a problem for most distribution since they force
the use of `--as-needed` at the toolchain level (gcc specs) (for example
debian [2]). One could also pass the `--as-needed` flag manually but
libtool reorganize flags in the case of shared object creation [3].

In our case, we always explicitly state the dependencies via the *_LIBADD
automake clause. We do not rely on the LIBS variable.

Simply force the define of HAVE_LIBNUMA to prevent the prepending to
LIBS.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Libraries.html
[2] https://salsa.debian.org/toolchain-team/gcc/-/blob/master/debian/patches/gcc-as-needed.diff
[3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=347650

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I33221d14b96482ff71672458097423289f6b9fc2
configure.ac
This page took 0.024212 seconds and 4 git commands to generate.