PR bootstrap/54820
* Makefile.tpl (STAGE1_FLAGS_TO_PASS): New variable. (all-[+prefix+][+module+]): Pass stage1_args to sub-makes. (all-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (clean-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false. (host_modules): Set stage1_args to STAGE1_FLAGS_TO_PASS. * Makefile.in: Regenerate. * configure.ac (have_static_libs): New variable and associated check. (stage1-ldflags): Move to after stage1_libs and set to -static-libstdc++ -static-libgcc if stage1_libs is empty and have_static_libs is yes. * configure: Regenerate.
This commit is contained in:
parent
3f30575344
commit
e885309220
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2012-10-22 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
PR bootstrap/54820
|
||||
* Makefile.tpl (STAGE1_FLAGS_TO_PASS): New variable.
|
||||
(all-[+prefix+][+module+]): Pass stage1_args to sub-makes.
|
||||
(all-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false.
|
||||
(clean-stage[+id+]-[+prefix+][+module+]): Likewise, if prev is false.
|
||||
(host_modules): Set stage1_args to STAGE1_FLAGS_TO_PASS.
|
||||
* Makefile.in: Regenerate.
|
||||
* configure.ac (have_static_libs): New variable and associated check.
|
||||
(stage1-ldflags): Move to after stage1_libs and set to -static-libstdc++
|
||||
-static-libgcc if stage1_libs is empty and have_static_libs is yes.
|
||||
* configure: Regenerate.
|
||||
|
||||
2012-10-10 David Holsgrove <david.holsgrove@xilinx.com>
|
||||
|
||||
* config.guess, config.sub: Include updated version from
|
||||
|
|
725
Makefile.in
725
Makefile.in
File diff suppressed because it is too large
Load Diff
19
Makefile.tpl
19
Makefile.tpl
|
@ -615,6 +615,12 @@ EXTRA_HOST_FLAGS = \
|
|||
|
||||
FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
|
||||
|
||||
# Flags to pass to stage1 or when not bootstrapping.
|
||||
|
||||
STAGE1_FLAGS_TO_PASS = \
|
||||
LDFLAGS="$${LDFLAGS}" \
|
||||
HOST_LIBS="$${HOST_LIBS}"
|
||||
|
||||
# Flags to pass to stage2 and later makes.
|
||||
|
||||
POSTSTAGE1_FLAGS_TO_PASS = \
|
||||
|
@ -1076,7 +1082,7 @@ all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELS
|
|||
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
|
||||
[+exports+] [+extra_exports+] \
|
||||
(cd [+subdir+]/[+module+] && \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+extra_make_flags+] \
|
||||
$(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
|
||||
$(TARGET-[+prefix+][+module+]))
|
||||
@endif [+prefix+][+module+]
|
||||
|
||||
|
@ -1109,9 +1115,8 @@ all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
|
|||
CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
|
||||
CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
|
||||
LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
|
||||
[+args+] [+
|
||||
IF prev +][+poststage1_args+][+ ENDIF prev
|
||||
+] [+extra_make_flags+] \
|
||||
[+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
|
||||
[+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
|
||||
TFLAGS="$(STAGE[+id+]_TFLAGS)" \
|
||||
$(TARGET-stage[+id+]-[+prefix+][+module+])
|
||||
|
||||
|
@ -1125,9 +1130,8 @@ clean-stage[+id+]-[+prefix+][+module+]:
|
|||
$(MAKE) stage[+id+]-start; \
|
||||
fi; \
|
||||
cd [+subdir+]/[+module+] && \
|
||||
$(MAKE) [+args+] [+ IF prev +] \
|
||||
[+poststage1_args+] [+ ENDIF prev +] \
|
||||
[+extra_make_flags+] clean
|
||||
$(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
|
||||
[+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
|
||||
@endif [+prefix+][+module+]-bootstrap
|
||||
|
||||
[+ ENDFOR bootstrap_stage +]
|
||||
|
@ -1162,6 +1166,7 @@ clean-stage[+id+]-[+prefix+][+module+]:
|
|||
exports="$(HOST_EXPORTS)"
|
||||
poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
|
||||
args="$(EXTRA_HOST_FLAGS)"
|
||||
stage1_args="$(STAGE1_FLAGS_TO_PASS)"
|
||||
poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
|
||||
|
||||
.PHONY: check-[+module+] maybe-check-[+module+]
|
||||
|
|
|
@ -648,8 +648,8 @@ clooglibs
|
|||
islinc
|
||||
poststage1_ldflags
|
||||
poststage1_libs
|
||||
stage1_libs
|
||||
stage1_ldflags
|
||||
stage1_libs
|
||||
extra_isl_gmp_configure_flags
|
||||
extra_mpc_mpfr_configure_flags
|
||||
extra_mpc_gmp_configure_flags
|
||||
|
@ -763,8 +763,8 @@ with_gmp
|
|||
with_gmp_include
|
||||
with_gmp_lib
|
||||
with_host_libstdcxx
|
||||
with_stage1_ldflags
|
||||
with_stage1_libs
|
||||
with_stage1_ldflags
|
||||
with_boot_libs
|
||||
with_boot_ldflags
|
||||
with_cloog
|
||||
|
@ -1514,9 +1514,9 @@ Optional Packages:
|
|||
--with-gmp-lib=PATH specify directory for the installed GMP library
|
||||
--with-host-libstdcxx=L use linker arguments L to link with libstdc++ when
|
||||
linking with PPL
|
||||
--with-stage1-libs=LIBS libraries for stage1
|
||||
--with-stage1-ldflags=FLAGS
|
||||
linker flags for stage1
|
||||
--with-stage1-libs=LIBS libraries for stage1
|
||||
--with-boot-libs=LIBS libraries for stage2 and later
|
||||
--with-boot-ldflags=FLAGS
|
||||
linker flags for stage2 and later
|
||||
|
@ -1765,6 +1765,52 @@ fi
|
|||
|
||||
} # ac_fn_cxx_try_compile
|
||||
|
||||
# ac_fn_cxx_try_link LINENO
|
||||
# -------------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded.
|
||||
ac_fn_cxx_try_link ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { { ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo"; } >&5
|
||||
(eval "$ac_link") 2>conftest.err
|
||||
ac_status=$?
|
||||
if test -s conftest.err; then
|
||||
grep -v '^ *+' conftest.err >conftest.er1
|
||||
cat conftest.er1 >&5
|
||||
mv -f conftest.er1 conftest.err
|
||||
fi
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; } && {
|
||||
test -z "$ac_cxx_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
}; then :
|
||||
ac_retval=0
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_retval=1
|
||||
fi
|
||||
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
|
||||
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
|
||||
# interfere with the next link command; also delete a directory that is
|
||||
# left behind by Apple's compiler. We do this before executing the actions.
|
||||
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
|
||||
eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
|
||||
return $ac_retval
|
||||
|
||||
} # ac_fn_cxx_try_link
|
||||
|
||||
# ac_fn_c_try_link LINENO
|
||||
# -----------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded.
|
||||
|
@ -4829,6 +4875,44 @@ if test -z "$LD"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Check whether -static-libstdc++ -static-libgcc is supported.
|
||||
have_static_libs=no
|
||||
if test "$GCC" = yes; then
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
|
||||
LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5
|
||||
$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; }
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
int main() {}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }; have_static_libs=yes
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -5558,21 +5642,6 @@ case $with_host_libstdcxx in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Linker flags to use for stage1 or when not boostrapping.
|
||||
|
||||
# Check whether --with-stage1-ldflags was given.
|
||||
if test "${with_stage1_ldflags+set}" = set; then :
|
||||
withval=$with_stage1_ldflags; if test "$withval" = "no" -o "$withval" = "yes"; then
|
||||
stage1_ldflags=
|
||||
else
|
||||
stage1_ldflags=$withval
|
||||
fi
|
||||
else
|
||||
stage1_ldflags=
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Libraries to use for stage1 or when not bootstrapping.
|
||||
|
||||
# Check whether --with-stage1-libs was given.
|
||||
|
@ -5588,6 +5657,27 @@ fi
|
|||
|
||||
|
||||
|
||||
# Linker flags to use for stage1 or when not bootstrapping.
|
||||
|
||||
# Check whether --with-stage1-ldflags was given.
|
||||
if test "${with_stage1_ldflags+set}" = set; then :
|
||||
withval=$with_stage1_ldflags; if test "$withval" = "no" -o "$withval" = "yes"; then
|
||||
stage1_ldflags=
|
||||
else
|
||||
stage1_ldflags=$withval
|
||||
fi
|
||||
else
|
||||
stage1_ldflags=
|
||||
# In stage 1, default to linking libstdc++ and libgcc statically with GCC
|
||||
# if supported. But if the user explicitly specified the libraries to use,
|
||||
# trust that they are doing what they want.
|
||||
if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
|
||||
stage1_ldflags="-static-libstdc++ -static-libgcc"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Libraries to use for stage2 and later builds. This defaults to the
|
||||
# argument passed to --with-host-libstdcxx.
|
||||
|
||||
|
|
44
configure.ac
44
configure.ac
|
@ -1182,6 +1182,22 @@ if test -z "$LD"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Check whether -static-libstdc++ -static-libgcc is supported.
|
||||
have_static_libs=no
|
||||
if test "$GCC" = yes; then
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
|
||||
LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc"
|
||||
AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc])
|
||||
AC_LANG_PUSH(C++)
|
||||
AC_LINK_IFELSE([int main() {}],
|
||||
[AC_MSG_RESULT([yes]); have_static_libs=yes],
|
||||
[AC_MSG_RESULT([no])])
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
LDFLAGS="$saved_LDFLAGS"
|
||||
fi
|
||||
|
||||
ACX_PROG_GNAT
|
||||
ACX_PROG_CMP_IGNORE_INITIAL
|
||||
|
||||
|
@ -1478,17 +1494,6 @@ case $with_host_libstdcxx in
|
|||
;;
|
||||
esac
|
||||
|
||||
# Linker flags to use for stage1 or when not boostrapping.
|
||||
AC_ARG_WITH(stage1-ldflags,
|
||||
[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
|
||||
[if test "$withval" = "no" -o "$withval" = "yes"; then
|
||||
stage1_ldflags=
|
||||
else
|
||||
stage1_ldflags=$withval
|
||||
fi],
|
||||
[stage1_ldflags=])
|
||||
AC_SUBST(stage1_ldflags)
|
||||
|
||||
# Libraries to use for stage1 or when not bootstrapping.
|
||||
AC_ARG_WITH(stage1-libs,
|
||||
[AS_HELP_STRING([--with-stage1-libs=LIBS], [libraries for stage1])],
|
||||
|
@ -1500,6 +1505,23 @@ AC_ARG_WITH(stage1-libs,
|
|||
[stage1_libs=$with_host_libstdcxx])
|
||||
AC_SUBST(stage1_libs)
|
||||
|
||||
# Linker flags to use for stage1 or when not bootstrapping.
|
||||
AC_ARG_WITH(stage1-ldflags,
|
||||
[AS_HELP_STRING([--with-stage1-ldflags=FLAGS], [linker flags for stage1])],
|
||||
[if test "$withval" = "no" -o "$withval" = "yes"; then
|
||||
stage1_ldflags=
|
||||
else
|
||||
stage1_ldflags=$withval
|
||||
fi],
|
||||
[stage1_ldflags=
|
||||
# In stage 1, default to linking libstdc++ and libgcc statically with GCC
|
||||
# if supported. But if the user explicitly specified the libraries to use,
|
||||
# trust that they are doing what they want.
|
||||
if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then
|
||||
stage1_ldflags="-static-libstdc++ -static-libgcc"
|
||||
fi])
|
||||
AC_SUBST(stage1_ldflags)
|
||||
|
||||
# Libraries to use for stage2 and later builds. This defaults to the
|
||||
# argument passed to --with-host-libstdcxx.
|
||||
AC_ARG_WITH(boot-libs,
|
||||
|
|
Loading…
Reference in New Issue