configure.ac: fix linking when using compiler sanitizers
authorArnaud Vrac <rawoul@gmail.com>
Sat, 5 Aug 2017 11:58:59 +0000 (13:58 +0200)
committerQuentin Glidic <sardemff7+git@sardemff7.net>
Fri, 11 Aug 2017 07:58:14 +0000 (09:58 +0200)
commitd6d97dad03292c7b4f3d977189ef57188b51bdee
treec275fa03f772e5d25d26efcbc0ccd2754fa813ff
parent7b5fe9b0762a64136a540d8c342c1b99f23508f2
configure.ac: fix linking when using compiler sanitizers

The GCC address sanitizer overrides dlopen and dlclose, so the configure
test does not detect libdl as a needed dependency for linking. It is
still needed though, as dlsym is not exported by the sanitizer. The
result is that linking fails in the end.

Fix this by checking for dlsym instead of dlopen.

This can be reproduced by configuring the build with:
CFLAGS="-fsanitize=address -fsanitize=undefined"
LDFLAGS="-fsanitize=address -fsanitize=undefined"

Signed-off-by: Arnaud Vrac <rawoul@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Makefile.am
configure.ac