[cfe-dev] Removing InitHeaderSearch

G M gmisocpp at gmail.com
Tue Oct 15 15:21:20 PDT 2013


Hi Edward


> I build clang ToT and libcxx with the previous clang-ToT, using the
> previous libcxx. Sometimes the introduction of new macros, e.g., _LIB_WEAK,
> breaks the build. The cause is subtle: I have to point CXX to
> -I/usr/local/include/c++/v1, but when libcxx is build this needs to be
> overridden to $MYLIBCXXLIB/include when libcxx is built. -nostdcxxinc is no
> help here, because I had to set it explicitly.
> I can work around it by pointing the build to $MYLIBCXXLIB/include, but
> that's not very nice. New headers with old libraries usually spell disaster.


I can't fully visualize the problem (my fault not yours) but if this helps:

If it's just _LIBCPP_WEAK that is the problem because it's missing for you
(and for any other case I wouldn't recommend this), my guess is that you
could safely copy the _LIBCPP_WEAK definition from __config into the other
__config that doesn't have it.

_LIBCPP_WEAK was only put In to allow MSVC to build libcxx. MSVC defines it
as nothing always and the g++ and clang++ definition Is attribute weak.
_LIBCPP_WEAK was just put in to split up another macro that contained two
gcc/clang attributes (used in new.cpp etc.). MSVC understood one and not
the other and the one it didn't understand it didn't need. So _LIBCPP_WEAK
was born to hold that other attribute for GCC/Clang and be nothing for MSVC.

So if the problem is simply LIBCPP_WEAK is not defined, you could define it
and everything else should work.
This assumes you are only interested in g++ clang++.

Sorry if this doesn't help you. I don't know what else to suggest. I can't
quite visual the problem.
I imagine even if this does help it's only a short term solution as more
changes will come that will put you in the same situation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131016/3acbacec/attachment.html>


More information about the cfe-dev mailing list