Bug 1451104 - part 2 - force clang to always pick up its local GCC headers and libraries; r=glandium

We want our clang bootstrap to use the GCC headers we're building with,
not whatever sysroot it happens to find on the server we're building on.

The -gcc-toolchain argument we specify when building clang will also be
picked up by llvm-config, so we need to strip it out when building the
plugin. Otherwise, we will get peculiar failures about not being able to
find C++ header files.

Depends on D22879

Differential Revision: https://phabricator.services.mozilla.com/D22880
This commit is contained in:
Nathan Froyd
2019-03-12 00:21:20 +00:00
parent fc15028eae
commit 5132a92bb6
2 changed files with 11 additions and 3 deletions

View File

@@ -676,9 +676,13 @@ if __name__ == "__main__":
elif is_linux():
extra_cflags = []
extra_cxxflags = []
extra_cflags2 = ["-fPIC"]
# When building stage2 and stage3, we want the newly-built clang to pick
# up whatever headers were installed from the gcc we used to build stage1,
# always, rather than the system headers. Providing -gcc-toolchain
# encourages clang to do that.
extra_cflags2 = ["-fPIC", '-gcc-toolchain', stage1_inst_dir]
# Silence clang's warnings about arguments not being used in compilation.
extra_cxxflags2 = ["-fPIC", '-Qunused-arguments']
extra_cxxflags2 = ["-fPIC", '-Qunused-arguments', '-gcc-toolchain', stage1_inst_dir]
extra_asmflags = []
# Avoid libLLVM internal function calls going through the PLT.
extra_ldflags = ['-Wl,-Bsymbolic-functions']