diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2021-03-25 16:32:46 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2021-03-25 16:32:51 +0000 |
commit | 8f7b22ea2a95ccab6aeaddcdee7472dbdbcfb4d3 (patch) | |
tree | 99146cfc862fde4ea37024b82f971122e860414b /libctf/configure.ac | |
parent | 15131809c235047c94387ef9aff207117191ed0b (diff) | |
download | gdb-8f7b22ea2a95ccab6aeaddcdee7472dbdbcfb4d3.zip gdb-8f7b22ea2a95ccab6aeaddcdee7472dbdbcfb4d3.tar.gz gdb-8f7b22ea2a95ccab6aeaddcdee7472dbdbcfb4d3.tar.bz2 |
libctf: fix ELF-in-BFD checks in the presence of ASAN
The address sanitizer contains a redirector that captures dlopen calls,
so checks for dlopen with AC_SEARCH_LIBS will always conclude that
dlopen is present when the sanitizer is on. This means it won't add
-ldl to LIBS even if needed, and the immediately-following attempt to
actually link with -lbfd will fail because libbfd also needs dlsym,
which ASAN does *not* contain a redirector for.
If we check for dlsym instead of dlopen, the check works whether ASAN is
on or off. (bfd uses both in close proximity: if it needs one, it will
always need the other.)
libctf/ChangeLog
2021-03-25 Nick Alcock <nick.alcock@oracle.com>
* configure.ac: Check for dlsym, not dlopen.
* configure: Regenerate.
Diffstat (limited to 'libctf/configure.ac')
-rw-r--r-- | libctf/configure.ac | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libctf/configure.ac b/libctf/configure.ac index ae1f10d..80644b8 100644 --- a/libctf/configure.ac +++ b/libctf/configure.ac @@ -68,7 +68,7 @@ ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_libctf_warn_cflags]) AC_FUNC_MMAP # Needed for BFD capability checks. -AC_SEARCH_LIBS(dlopen, dl) +AC_SEARCH_LIBS(dlsym, dl) AM_ZLIB GCC_ENABLE([libctf-hash-debugging], [no], [], [Enable expensive debugging of CTF deduplication type hashing]) |