This is the mail archive of the gcc@gcc.gnu.org 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, build] Restore bootstrap in building libcc1 on darwin


tl;dr: One question to build maintainers, and one patch submitted to toplevel configure.ac

---------------

Iâm looked into the issue some more, and am comparing two builds of trunk (exact same source), one configured with system compiler (clang) in PATH, the other with GCC 4.9.2 in PATH.
At the toplevel configure, the only meaningful difference is that the gcc-based build sets stage1_ldflags='-static-libstdc++ -static-libgcc' while the clang-based has stage1_ldflags='' (clang doesnât recognized -static-libstdc++).

This is included into the toplevel Makefile as STAGE1_LDFLAGS (the comment appropriately says "Linker flags to use on the host, for stage1 or when not bootstrappingâ).
Those are exported by HOST_EXPORTS, which is are then used by configure-libcc1, all-libcc1, etc. Thus, we end up using STAGE1_LDFLAGS, which correspond to the system compiler, instead of the stage3 compiler (as we should).

So, this is âfalse negativeâ part of the problem (namely, why we donât see the failure when bootstrapping with clang): we use STAGE1_LDFLAGS in building libcc1, and with clang as system compiler we donât use static linking of the C++ library. This part, I donât know how to fix: it is for the build experts to address. It is a real problem: it leads to libcc1.so being linked dynamically to libstdc++ and libgcc, instead of statically (as it should).

---------------

Second part of the question: when the freshly built g++ is used, we need to pass the appropriate -B options. As I understand it, the appropriate place for that is in the toplevel configure.ac, where we already pass down the respective -L options. Indeed, the attached patch restores bootstrap on x86_64-apple-darwin14 with gcc as system compiler (and doesnât break the bootstrap with clang as system compiler).

OK to commit?

FX



PS: HJ, the reason only donât see this on Linux is that only Darwin (AFAIK) plays spec tricks with static-libstdc++ (in gcc/config/darwin.h)


Attachment: libcc1.ChangeLog
Description: Binary data

Attachment: libcc1.diff
Description: Binary data


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