Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Description
Bug report
The configure script is missing a space in the test for--as-needed
, falsely detects the platform as supporting that GNU ld specific flag then fails later in the build with the error:
gcc -I/usr/local/include -I/usr/local/ssl/include -D__EXTENSIONS__=1 -D_XPG6=1 -D_REENTRANT -I/usr/local/include/ncurses -DHAVE_NCURSES_H=1 -DHAVE_TERM_H=1 -fno-semantic-interposition -shared -L. -L/usr/local/lib/ -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/lib/amd64 -Wl,-R/usr/local/lib -Wl,-R/usr/local/ssl/lib -Wl,-R/usr/local/lib/amd64 -L/usr/lib -L/lib -fno-semantic-interposition -fprofile-generate -Wl,--no-as-needed -o libpython3.so -Wl,-hlibpython3.so libpython3.11.sold: fatal: unrecognized option '--no-as-needed'ld: fatal: use the -z help option for usage information
The root cause is this misdetection, because configure is doingas_fn_append LDFLAGS -Wl,--no-as-needed
instead ofas_fn_append LDFLAGS " -Wl,--no-as-needed"
in
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wl,--no-as-needed" >&5$as_echo_n "checking for -Wl,--no-as-needed... " >&6; }if ${ac_cv_wl_no_as_needed+:} false; then : $as_echo_n "(cached) " >&6else save_LDFLAGS="$LDFLAGS" as_fn_append LDFLAGS -Wl,--no-as-needed cat confdefs.h - <<_ACEOF >conftest.$ac_ext
The configure run is:
configure:6282: checking for -Wl,--no-as-neededconfigure:6301: gcc -o conftest -L. -L/usr/local/lib/ -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/lib/amd64 -Wl,-R/usr/local/lib -Wl,-R/usr/local/ssl/lib -Wl,-R/usr/local/lib/amd64 -L/usr/lib -L/lib-Wl,--no-as-needed conftest.c >&5configure:6301: $? = 0configure:6313: result: yes
Where the-Wl,--as-needed
is glommed to a-L/lib
flags and is thus interpreted as part of the library search path dirname to the nonsensical but harmless/lib-Wl,--as-needed
that doesn't fail and thus leads to a false positive for--as-needed
support.
Presumably this will also impact other platforms that don't support that flag,
Your environment
SmartOS joyent_20210520T001536Z using gcc 12.2.0 with Solaris ld