mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
118fd76cf0
In some cases, we can end up linking some things with --static-libstdc++. The notable (only?) example of that is for the clang-plugin, and that happens because it gets some of its flags from llvm-config, which contains --static-libstdc++ because clang itself is built that way. When that happens, the combination of --static-libstdc++ and stdc++compat breaks the build because they have conflicting symbols, which is very much by design. There are two ways out of this: - avoiding either -static-libstdc++ or stdc++compat - work around the symbol conflicts The former is not totally reliable ; we'd have to accurately determine if we're in a potentially conflicting case, and remove one of the two in that case, and while we can do that for the cases we explicitly know about, that's not future-proof, and might fail just as much in the future. So we go with the latter. The way we do this is by defining all the std++compat symbols weak, such that at link time, they're overridden by any symbol with the same name. When building with -static-libstdc++, libstdc++.a provides those symbols so the linker eliminates the weak ones. When not building with -static-libstdc++, the linker keeps the symbols from stdc++compat. That last assertion is validated by the long-standing CHECK_STDCXX test that we run when linking shared libraries and programs. That still leaves the symbols weak in the final shared libraries/programs, which is a change from the current setup, but shouldn't cause problems because when using versions of libstdc++.so that do provide those symbols, it's fine to use the libstdc++.so version anyways. |
||
---|---|---|
.. | ||
build-binutils | ||
build-gcc | ||
build-gtk3 | ||
build-hfsplus | ||
elfhack | ||
stdc++compat | ||
aix.exp | ||
moz.build | ||
mozconfig.asan | ||
mozconfig.fuzzing | ||
mozconfig.gtk | ||
mozconfig.linux | ||
mozconfig.linux32 | ||
mozconfig.stdcxx | ||
mozconfig.tsan | ||
mozilla.in | ||
print-failed-commands.sh | ||
print-non-newline.sh | ||
rewrite_asan_dylib.py | ||
run-gprof.sh | ||
run-hiprof.sh | ||
run-mozilla.sh | ||
run-third.sh |