mirror of git://sourceware.org/git/glibc.git
support: Link links-dso-program-c with libgcc_s only if available
Add a configure check to detect bootstrapping builds that do not
have libgcc_s.
Fixes commit 3e2be87832 ("support: Link
links-dso-program-c against libgcc_s").
Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
2f8e8c9cb7
commit
5dfbc3c43e
|
|
@ -9135,6 +9135,46 @@ fi
|
||||||
config_vars="$config_vars
|
config_vars="$config_vars
|
||||||
enable-static-pie = $libc_cv_static_pie"
|
enable-static-pie = $libc_cv_static_pie"
|
||||||
|
|
||||||
|
# Check if we can link support functionality against libgcc_s.
|
||||||
|
# Must not be used for linking installed binaries, to produce the
|
||||||
|
# same binaries for bootstrapped and bootstrapping builds (the latter
|
||||||
|
# with a GCC that does not build libgcc_s).
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC can link against -lgcc_s" >&5
|
||||||
|
printf %s "checking whether $CC can link against -lgcc_s... " >&6; }
|
||||||
|
if test ${libc_cv_have_libgcc_s+y}
|
||||||
|
then :
|
||||||
|
printf %s "(cached) " >&6
|
||||||
|
else case e in #(
|
||||||
|
e) old_LIBS="$LIBS"
|
||||||
|
LIBS="$LIBS -lgcc_s"
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
int
|
||||||
|
main (void)
|
||||||
|
{
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
if ac_fn_c_try_link "$LINENO"
|
||||||
|
then :
|
||||||
|
libc_cv_have_libgcc_s=yes
|
||||||
|
else case e in #(
|
||||||
|
e) libc_cv_have_libgcc_s=no ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
LIBS="$old_LIBS" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_libgcc_s" >&5
|
||||||
|
printf "%s\n" "$libc_cv_have_libgcc_s" >&6; }
|
||||||
|
config_vars="$config_vars
|
||||||
|
have-libgcc_s = $libc_cv_have_libgcc_s"
|
||||||
|
|
||||||
# Support configure.ac under sysdeps.
|
# Support configure.ac under sysdeps.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
12
configure.ac
12
configure.ac
|
|
@ -2061,6 +2061,18 @@ if test "$libc_cv_static_pie" = "yes"; then
|
||||||
fi
|
fi
|
||||||
LIBC_CONFIG_VAR([enable-static-pie], [$libc_cv_static_pie])
|
LIBC_CONFIG_VAR([enable-static-pie], [$libc_cv_static_pie])
|
||||||
|
|
||||||
|
# Check if we can link support functionality against libgcc_s.
|
||||||
|
# Must not be used for linking installed binaries, to produce the
|
||||||
|
# same binaries for bootstrapped and bootstrapping builds (the latter
|
||||||
|
# with a GCC that does not build libgcc_s).
|
||||||
|
AC_CACHE_CHECK([whether $CC can link against -lgcc_s], libc_cv_have_libgcc_s, [dnl
|
||||||
|
old_LIBS="$LIBS"
|
||||||
|
LIBS="$LIBS -lgcc_s"
|
||||||
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||||
|
[libc_cv_have_libgcc_s=yes], [libc_cv_have_libgcc_s=no])
|
||||||
|
LIBS="$old_LIBS"])
|
||||||
|
LIBC_CONFIG_VAR([have-libgcc_s], [$libc_cv_have_libgcc_s])
|
||||||
|
|
||||||
# Support configure.ac under sysdeps.
|
# Support configure.ac under sysdeps.
|
||||||
AC_SUBST(libc_cv_test_cc_mprefer_vector_width)
|
AC_SUBST(libc_cv_test_cc_mprefer_vector_width)
|
||||||
AC_SUBST(test_enable_cet)
|
AC_SUBST(test_enable_cet)
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,10 @@ CFLAGS-temp_file.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
|
||||||
ifeq (,$(CXX))
|
ifeq (,$(CXX))
|
||||||
LINKS_DSO_PROGRAM = links-dso-program-c
|
LINKS_DSO_PROGRAM = links-dso-program-c
|
||||||
CFLAGS-links-dso-program-c.c += -fexceptions
|
CFLAGS-links-dso-program-c.c += -fexceptions
|
||||||
LDLIBS-links-dso-program-c = -lgcc -lgcc_s $(libunwind)
|
LDLIBS-links-dso-program-c = -lgcc
|
||||||
|
ifeq ($(have-libgcc_s),yes)
|
||||||
|
LDLIBS-links-dso-program-c += -lgcc_s $(libunwind)
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
LINKS_DSO_PROGRAM = links-dso-program
|
LINKS_DSO_PROGRAM = links-dso-program
|
||||||
LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
|
LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue