Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7c163aa

Browse files
committed
configure: check for dlsym instead of dlopen.
When building with sanitizers the sanitizer library provides dlopen, but notdlsym(), making configure think that -ldl isn't needed. Just checking fordlsym() ought to suffice, hard to see dlsym() being provided without dlopen()also being provided.Backpatch to all branches, for the same reasons as46ab07f.Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/20220323173537.ll7klrglnp4gn2um@alap3.anarazel.deBackpatch: 10-
1 parentca26c64 commit7c163aa

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

‎configure

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11399,9 +11399,12 @@ if test "$ac_res" != no; then :
1139911399

1140011400
fi
1140111401

11402-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
11403-
$as_echo_n "checking for library containing dlopen... " >&6; }
11404-
if ${ac_cv_search_dlopen+:} false; then :
11402+
# gcc/clang's sanitizer helper library provides dlopen but not dlsym, thus
11403+
# when enabling asan the dlopen check doesn't notice that -ldl is actually
11404+
# required. Just checking for dlsym() ought to suffice.
11405+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5
11406+
$as_echo_n "checking for library containing dlsym... " >&6; }
11407+
if ${ac_cv_search_dlsym+:} false; then :
1140511408
$as_echo_n "(cached) " >&6
1140611409
else
1140711410
ac_func_search_save_LIBS=$LIBS
@@ -11414,11 +11417,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1141411417
#ifdef __cplusplus
1141511418
extern "C"
1141611419
#endif
11417-
chardlopen ();
11420+
chardlsym ();
1141811421
int
1141911422
main ()
1142011423
{
11421-
returndlopen ();
11424+
returndlsym ();
1142211425
;
1142311426
return 0;
1142411427
}
@@ -11431,25 +11434,25 @@ for ac_lib in '' dl; do
1143111434
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
1143211435
fi
1143311436
if ac_fn_c_try_link "$LINENO"; then :
11434-
ac_cv_search_dlopen=$ac_res
11437+
ac_cv_search_dlsym=$ac_res
1143511438
fi
1143611439
rm -f core conftest.err conftest.$ac_objext \
1143711440
conftest$ac_exeext
11438-
if ${ac_cv_search_dlopen+:} false; then :
11441+
if ${ac_cv_search_dlsym+:} false; then :
1143911442
break
1144011443
fi
1144111444
done
11442-
if ${ac_cv_search_dlopen+:} false; then :
11445+
if ${ac_cv_search_dlsym+:} false; then :
1144311446

1144411447
else
11445-
ac_cv_search_dlopen=no
11448+
ac_cv_search_dlsym=no
1144611449
fi
1144711450
rm conftest.$ac_ext
1144811451
LIBS=$ac_func_search_save_LIBS
1144911452
fi
11450-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
11451-
$as_echo "$ac_cv_search_dlopen" >&6; }
11452-
ac_res=$ac_cv_search_dlopen
11453+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5
11454+
$as_echo "$ac_cv_search_dlsym" >&6; }
11455+
ac_res=$ac_cv_search_dlsym
1145311456
if test "$ac_res" != no; then :
1145411457
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
1145511458

‎configure.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,10 @@ AC_SUBST(PTHREAD_LIBS)
11781178

11791179
AC_CHECK_LIB(m, main)
11801180
AC_SEARCH_LIBS(setproctitle, util)
1181-
AC_SEARCH_LIBS(dlopen, dl)
1181+
# gcc/clang's sanitizer helper library provides dlopen but not dlsym, thus
1182+
# when enabling asan the dlopen check doesn't notice that -ldl is actually
1183+
# required. Just checking for dlsym() ought to suffice.
1184+
AC_SEARCH_LIBS(dlsym, dl)
11821185
AC_SEARCH_LIBS(socket, [socket ws2_32])
11831186
AC_SEARCH_LIBS(shl_load, dld)
11841187
AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp