https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103866
Bug ID: 103866
Summary: AM_PROG_LIBTOOL not compatible with GCC_NO_EXECUTABLES
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
The libtool setup in the top-level libtool.m4 has this snippet in
LT_SYS_DLOPEN_SELF:
*)
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
[lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
[lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
])
])
;;
This can fail if GCC_NO_EXECUTABLES has been used, e.g. for a mips-none-elf
cross-compiler (see Bug 100057 comment 33, but ignore all the other comments
there).
It looks like --disable-dlopen will avoid that snippet, but should that be
necessary if --disable-shared has been used? If it can't depend on
--disable-shared, is there some other flag we can use to infer that the user
doesn't want/need those checks for a bare metal build?