build: enforce library order required by the sanitizers
If sanitizer (e.g. ASan) is enabled, using AC_CHECK_LIB(...) to
detect TCmalloc causes configure to construct compiler invocations
like gcc -o conftest -g -O2 conftest.c -ltcmalloc -lasan, which is
wrong because sanitizer library should come first in the library list.
Therefore all execution tests fails with the following error:
...
configure:13496: checking size of short
configure:13501: gcc -o conftest -g -O2 conftest.c -ltcmalloc -lasan >&5
configure:13501: $? = 0
configure:13501: ./conftest
==117080==ASan runtime does not come first in initial library list; you
should either link runtime to your application or manually preload it
with LD_PRELOAD.
configure:13501: $? = 1
configure: program exited with status 1
...
Zeroing LIBS before running AC_CHECK_LIB([tcmalloc], ...) and
appending (not prepending) -ltcmalloc to GF_LDFLAGS enforces
an expected order of the libraries.
Signed-off-by: Dmitry Antipov [email protected] Updates: #1000
interesting. Looks like @pranithk had some issues with tcmalloc. Hope this is resolving his issues.
/run regression
Is this still required? If yes, please rebase, will merge.
Thank you for your contributions. Noticed that this issue is not having any activity in last ~6 months! We are marking this issue as stale because it has not had recent activity. It will be closed in 2 weeks if no one responds with a comment here.
Closing this issue as there was no update since my last update on issue. If this is an issue which is still valid, feel free to open it.