This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH PING: Build machinery: Set poststage1_ldflags for all builds

I'm pinging this patch for the second time:

Other than comments, this is a one-line patch, which changes the default
value for poststage1_ldflags:

- if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then
+ if test "$poststage1_libs" = ""; then
   poststage1_ldflags="-static-libstdc++ -static-libgcc"

This code, with the test of ENABLE_BUILD_WITH_CXX originates in a patch
I proposed here:
Joseph's comments on an earlier patch are relevant:
I then modified the code with this patch:
leaving us where we are today.

The idea is this: when we bootstrap, if we are not given special
alternative instructions, we want to statically link the libraries which
are part of the gcc distribution.  If we do not do this, then the newly
built and installed compiler will, in general, only run if the gcc
libraries are on the dynamic linker search path.  That is difficult for

People who build distros, or in general people who know that they will
install the newly built libraries in a place where the dynamic linker
will find them, may use the existing configure option
--with-boot-ldflags to control this.

This is in principle a general issue not specific to libstdc++: when we
bootstrap gcc, we should statically link against libgcc unless told to
do otherwise.  In practice this is not an issue as on most hosts which
support bootstrap gcc does not use anything from libgcc.

When gcc is compiled with a C++ compiler, then it does use libstdc++,
and that is a real problem.  That is why the code uses -static-libstdc++

For the Go frontend, I want to use -static-libstdc++ even when
ENABLE_BUILD_WITH_CXX is not set.  This is of course because the Go
compiler is written in C++, so the same arguments apply.  Hence the
patch I am pinging here.

This patch does rely on the fact that the -static-libstdc++ option does
nothing when used with the gcc driver rather than the g++ driver.  If
that were not the case, it would be necessary to introduce new configure
options --with-boot-cxx-ldflags and --with-boot-cxx-libs with
corresponding defaults and Makefile variables.

I would really like to get this patch in one way or another.  Please let
me know.  Thanks.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]