diff options
author | Andres Freund | 2022-03-23 19:43:14 +0000 |
---|---|---|
committer | Andres Freund | 2022-03-23 19:43:14 +0000 |
commit | e71c76fcab8d00defe9a7a608facdd9663f7bcbf (patch) | |
tree | 5813cc77ad34382158931f80f86c74dc4ce06f00 /configure.ac | |
parent | c97e4bdcb142effc452d33b81f31e0b3ac990b71 (diff) |
configure: check for dlsym instead of dlopen.
When building with sanitizers the sanitizer library provides dlopen, but not
dlsym(), making configure think that -ldl isn't needed. Just checking for
dlsym() ought to suffice, hard to see dlsym() being provided without dlopen()
also being provided.
Backpatch to all branches, for the same reasons as 46ab07ffda9.
Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/20220323173537.ll7klrglnp4gn2um@alap3.anarazel.de
Backpatch: 10-
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 19d1a803673..078381e5680 100644 --- a/configure.ac +++ b/configure.ac @@ -1229,7 +1229,10 @@ AC_SUBST(PTHREAD_LIBS) AC_CHECK_LIB(m, main) AC_SEARCH_LIBS(setproctitle, util) -AC_SEARCH_LIBS(dlopen, dl) +# gcc/clang's sanitizer helper library provides dlopen but not dlsym, thus +# when enabling asan the dlopen check doesn't notice that -ldl is actually +# required. Just checking for dlsym() ought to suffice. +AC_SEARCH_LIBS(dlsym, dl) AC_SEARCH_LIBS(socket, [socket ws2_32]) AC_SEARCH_LIBS(shl_load, dld) AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt]) |