This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: Add --enable-build-with-cxx to gcc subdirectory
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Jun 2009 10:17:51 +0000 (UTC)
- Subject: Re: PATCH RFA: Add --enable-build-with-cxx to gcc subdirectory
- References: <m37hz4yldh.fsf@pepe.airs.com>
On Sun, 21 Jun 2009, Ian Lance Taylor wrote:
> +ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
> COMPILER = $(CC)
> COMPILER_FLAGS = $(CFLAGS)
> LINKER = $(CC)
> LINKER_FLAGS = $(CFLAGS)
> +else
> +COMPILER = $(CXX)
> +COMPILER_FLAGS = $(filter-out -fkeep-inline-functions,$(CXXFLAGS))
> +LINKER = $(CXX)
> +LINKER_FLAGS = $(filter-out -fkeep-inline-functions,$(CXXFLAGS))
> +endif
LINKER should only be $(CXX) if --with-host-libstdcxx is not given; for a
C++ build --with-host-libstdcxx is still useful for a non-bootstrapped
build to control how the host libstdc++ is linked in.
> # This is the variable to use when using $(LINKER).
> +ifneq ($(ENABLE_BUILD_WITH_CXX),yes)
> ALL_LINKERFLAGS = $(ALL_CFLAGS)
> +else
> +ALL_LINKERFLAGS = --static-libstdc++ $(ALL_CXXFLAGS)
> +endif
I'd expect this to break if the host compiler does not support this
option, and so to need configure checks. And if --with-host-libstdcxx is
used that should override the use of this option.
Will this link with static libgcc as well as static libstdc++ or is the
-static-libgcc option needed for that? Shared libgcc has the same issues
as shared libstdc++ with a 4.5 compiler potentially generating calls to
functions not in an older system shared library, although to a lesser
extent than libstdc++; I'd say the default should be linking the compiler
with static libgcc, just as C programs are linked with static libgcc by
default.
--
Joseph S. Myers
joseph@codesourcery.com