Generated ninja files by cmake > 3.5.2 fails to build if using icecream
We are using icecream (distributed compilation) and ninja together with cmake to build WebKitGTK+. After updating from cmake 3.5.2 to cmake 3.6 the build always fails. The thing is that even if the -fPIC
is presented for every file in the generated build.ninja file (added in https://trac.webkit.org/browser/trunk/Source/cmake/WebKitHelpers.cmake#L16), when the build is run then there is no -fPIC
in the compilers (in this case gcc) arguments (observed by looking on gcc processes during the compilation) which in the end leads to bunch of the following errors:
/usr/bin/ld.gold: error: Source/ThirdParty/gtest/CMakeFiles/gtest.dir/src/gtest-typed-test.cc.o: requires dynamic R_X86_64_PC32 reloc against '_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeIN7testing8internal6StringEEE8allocateEmPKv' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: Source/ThirdParty/gtest/CMakeFiles/gtest.dir/src/gtest-typed-test.cc.o: requires dynamic R_X86_64_PC32 reloc against '_ZSt7forwardIRKN7testing8internal6StringEEOT_RNSt16remove_referenceIS5_E4typeE' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: Source/ThirdParty/gtest/CMakeFiles/gtest.dir/src/gtest-typed-test.cc.o: requires dynamic R_X86_64_PC32 reloc against '_ZNK9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeIN7testing8internal6StringEEE8max_sizeEv' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: Source/ThirdParty/gtest/CMakeFiles/gtest.dir/src/gtest-typed-test.cc.o: requires dynamic R_X86_64_PC32 reloc against '_ZSt7forwardIRKN7testing8internal6StringEEOT_RNSt16remove_referenceIS5_E4typeE' which may overflow at runtime; recompile with -fPIC
/usr/bin/ld.gold: error: Source/ThirdParty/gtest/CMakeFiles/gtest.dir/src/gtest-typed-test.cc.o: requires dynamic R_X86_64_32 reloc which may overflow at runtime; recompile with -fPIC
I tried the current master from yesterday at it was broken as well. So I tried to bisect the issue and it brought me to commit 2369f19a that broke the build for us.
More information could be found in https://bugzilla.redhat.com/show_bug.cgi?id=1394152.