* configure.ac: Change default of poststage1_ldflags to be empty if
poststage1_libs is set. When poststage1_libs is empty, and
ENABLE_BUILD_WITH_CXX is set, add -static-libgcc.
* configure: Rebuild.
gcc/:
* Makefile.in (HOST_LIBS): Move higher in file.
(LINKER, LINKER_FLAGS): If ENABLE_BUILD_WITH_CXX, but $(HOST_LIBS)
is not empty, set to $(CC) and $(CFLAGS).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154422
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-11-21 Ian Lance Taylor <iant@google.com>
+
+ * configure.ac: Change default of poststage1_ldflags to be empty if
+ poststage1_libs is set. When poststage1_libs is empty, and
+ ENABLE_BUILD_WITH_CXX is set, add -static-libgcc.
+ * configure: Rebuild.
+
2009-11-21 Adam Nemet <adambnmet@gmail.com>
* MAINTAINERS (Write After Approval): Update my email address.
clooglibs
pplinc
ppllibs
-poststage1_libs
poststage1_ldflags
+poststage1_libs
stage1_libs
stage1_ldflags
extra_mpc_mpfr_configure_flags
with_host_libstdcxx
with_stage1_ldflags
with_stage1_libs
-with_boot_ldflags
with_boot_libs
+with_boot_ldflags
with_ppl
with_ppl_include
with_ppl_lib
when linking with PPL
--with-stage1-ldflags=FLAGS Linker flags for stage1
-with-stage1-libs=LIBS Libraries for stage1
- --with-boot-ldflags=FLAGS Linker flags for stage2 and later
--with-boot-libs=LIBS Libraries for stage2 and later
+ --with-boot-ldflags=FLAGS Linker flags for stage2 and later
--with-ppl=PATH Specify prefix directory for the installed PPL package
Equivalent to --with-ppl-include=PATH/include
plus --with-ppl-lib=PATH/lib
-# Linker flags to use for stage2 and later builds.
-
-# Check whether --with-boot-ldflags was given.
-if test "${with_boot_ldflags+set}" = set; then :
- withval=$with_boot_ldflags; if test "$withval" = "no" -o "$withval" = "yes"; then
- poststage1_ldflags=
- else
- poststage1_ldflags=$withval
- fi
-else
- if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
- poststage1_ldflags=-static-libstdc++
- else
- poststage1_ldflags=
- fi
-fi
-
-
-
# Libraries to use for stage2 and later builds. This defaults to the
# argument passed to --with-host-libstdcxx.
+# Linker flags to use for stage2 and later builds.
+
+# Check whether --with-boot-ldflags was given.
+if test "${with_boot_ldflags+set}" = set; then :
+ withval=$with_boot_ldflags; if test "$withval" = "no" -o "$withval" = "yes"; then
+ poststage1_ldflags=
+ else
+ poststage1_ldflags=$withval
+ fi
+else
+ poststage1_ldflags=
+ # With --enable-build-with-cxx, default to linking libstdc++ and
+ # libgcc statically. But if the user explicitly specified the
+ # libraries to use, trust that they are doing what they want.
+ if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then
+ poststage1_ldflags="-static-libstdc++ -static-libgcc"
+ fi
+fi
+
+
+
# Check for PPL
ppl_major_version=0
ppl_minor_version=10
[stage1_libs=$with_host_libstdcxx])
AC_SUBST(stage1_libs)
-# Linker flags to use for stage2 and later builds.
-AC_ARG_WITH(boot-ldflags,
-[ --with-boot-ldflags=FLAGS Linker flags for stage2 and later],
-[if test "$withval" = "no" -o "$withval" = "yes"; then
- poststage1_ldflags=
- else
- poststage1_ldflags=$withval
- fi],
-[if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
- poststage1_ldflags=-static-libstdc++
- else
- poststage1_ldflags=
- fi])
-AC_SUBST(poststage1_ldflags)
-
# Libraries to use for stage2 and later builds. This defaults to the
# argument passed to --with-host-libstdcxx.
AC_ARG_WITH(boot-libs,
[poststage1_libs=$with_host_libstdcxx])
AC_SUBST(poststage1_libs)
+# Linker flags to use for stage2 and later builds.
+AC_ARG_WITH(boot-ldflags,
+[ --with-boot-ldflags=FLAGS Linker flags for stage2 and later],
+[if test "$withval" = "no" -o "$withval" = "yes"; then
+ poststage1_ldflags=
+ else
+ poststage1_ldflags=$withval
+ fi],
+[poststage1_ldflags=
+ # With --enable-build-with-cxx, default to linking libstdc++ and
+ # libgcc statically. But if the user explicitly specified the
+ # libraries to use, trust that they are doing what they want.
+ if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then
+ poststage1_ldflags="-static-libstdc++ -static-libgcc"
+ fi])
+AC_SUBST(poststage1_ldflags)
+
# Check for PPL
ppl_major_version=0
ppl_minor_version=10
+2009-11-21 Ian Lance Taylor <iant@google.com>
+
+ * Makefile.in (HOST_LIBS): Move higher in file.
+ (LINKER, LINKER_FLAGS): If ENABLE_BUILD_WITH_CXX, but $(HOST_LIBS)
+ is not empty, set to $(CC) and $(CFLAGS).
+
2009-11-22 Martin Jambor <mjambor@suse.cz>
* tree-cfg.c (verify_types_in_gimple_reference): Error out on
RANLIB = @RANLIB@
RANLIB_FLAGS = @ranlib_flags@
+# Libraries to use on the host.
+HOST_LIBS = @HOST_LIBS@
+
# The name of the compiler to use.
ENABLE_BUILD_WITH_CXX = @ENABLE_BUILD_WITH_CXX@
ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
else
COMPILER = $(CXX)
COMPILER_FLAGS = $(CXXFLAGS)
+# If HOST_LIBS is set, then the user is controlling the libraries to
+# link against. In that case, link with $(CC) so that the -lstdc++
+# library is not introduced. If HOST_LIBS is not set, link with
+# $(CXX) to pick up -lstdc++.
+ifeq ($(HOST_LIBS),)
LINKER = $(CXX)
LINKER_FLAGS = $(CXXFLAGS)
+else
+LINKER = $(CC)
+LINKER_FLAGS = $(CFLAGS)
+endif
endif
# -------------------------------------------
# In stage2 and beyond, we force this to "-o $@" since we know we're using gcc.
OUTPUT_OPTION = @OUTPUT_OPTION@
-# Libraries to use on the host.
-HOST_LIBS = @HOST_LIBS@
-
# This is where we get zlib from. zlibdir is -L../zlib and zlibinc is
# -I../zlib, unless we were configured with --with-system-zlib, in which
# case both are empty.