On Mon, Nov 19, 2012 at 12:09 AM, Jakub Jelinek <[email protected]> wrote:
> On Sun, Nov 18, 2012 at 09:07:07PM -0800, H.J. Lu wrote:
>> This patch adds explicit -I for libstdc++-v3 header files when building
>> libsanitizer so that it can be used for bootstrapping GCC. Othewise,
>> -funconfigured-libstcd++-v3 will be used to compile multilib
>> libsanitizer. OK to install?
>
> Ugh, this is wrong. libstdc++ has scripts/testsuite_flags --build-includes
> and similar for a reason. You should use that script, instead of hardcoding
> it.
>
It doesn't work with bootstrap=true for libsanitizer due to
-funconfigured-libstcd++-v3 is used to compile multilib
libsanitizer:
# CXX_FOR_TARGET is tricky to get right for target libs that require a
# functional C++ compiler. When we recurse, if we expand
# CXX_FOR_TARGET before configuring libstdc++-v3, we won't get
# libstdc++ include flags from the script. Instead, we get an
# -funconfigured-* word, so that we'll get errors if this invalid C++
# command line is used for anything, but also so that we can use the
# word to decide whether or not to pass on this CXX_FOR_TARGET. If we
# don't pass it on, sub-make will use the default definition, that
# re-expands it at the time of use, so we'll get it right when we need
# it. One potential exception is the expansion of CXX_FOR_TARGET
# passed down as part of CXX within TARGET_FLAGS, but this wouldn't
# really work, for C++ host programs can't depend on the current-stage
# C++ target library.
RAW_CXX_TARGET_EXPORTS is used to work around it:
target_modules = { module= libsanitizer;
bootstrap=true;
lib_path=.libs;
raw_cxx=true; };
That is why I need to explicit -I for libstdc++-v3 header files.
--
H.J.