Bug 1394152

Summary: WebKitGTK+ build fails with cmake 3.6.x and 3.7.0 if using icecream and ninja
Product: [Fedora] Fedora Reporter: Tomas Popela <tpopela>
Component: cmakeAssignee: Orion Poplawski <orion>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: besser82, helio, jreznik, mcatanzaro+wrong-account-do-not-cc, orion, rdieter, tpopela
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-22 06:07:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
cmake generated files from the build directory
none
cmake generated files from the build directory - cmake 3.5 - working none

Description Tomas Popela 2016-11-11 08:12:13 UTC
Created attachment 1219658 [details]
cmake generated files from the build directory

Description of problem:
I'm using icecream (distributed compilation) and ninja together with cmake to build WebKitGTK+ (webkitgtk4 package). After updating to F25 (where is cmake 3.6.x) I cannot build it successfully anymore. The thing is that even if the -fPIC is presented for every file in the generated build.ninja file, 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 also tried the 3.7 (rc2 and rc3), but the build fails in the same way.

I'm attaching the generated files from the build directory (the WebKit's cmake sources could be found on trac.webkit.org).

Also a note that it's not a Fedora specific as the guys from WebKit' upstream running on Debian are having the same issue.

In the meantime I had to rebuild the 3.5.x from F24, where it works.

How reproducible:
Always with 3.6.2 and 3.7.0 (rc2 and rc3). Not reproducible with 3.5.2.

Comment 1 Tomas Popela 2016-11-22 09:05:08 UTC
Sorry I mistake the issue.. This is still unfixed.. Orion does the upstream responded?

Comment 2 Orion Poplawski 2016-11-22 16:26:45 UTC
There was no response to my email.  I think we'll need to provide a simpler test case or more information.  Can you provide the cmake output files from a working run to compare with the ones you already attached?

Comment 3 Tomas Popela 2016-11-22 16:38:48 UTC
Created attachment 1222783 [details]
cmake generated files from the build directory - cmake 3.5 - working

Comment 4 Orion Poplawski 2016-11-22 17:22:04 UTC
Nothing is standing out for me, and I don't use ninja or icecream so don't really know what to look for.  I guess I would start tracking down the differences in the process trees during compilation to see why the compile options aren't getting propagated.

Comment 5 Tomas Popela 2017-02-21 09:19:57 UTC
Any news here?

Comment 6 Orion Poplawski 2017-02-21 17:15:26 UTC
No.  No time to pursue this further.

Comment 7 Tomas Popela 2017-02-22 06:07:21 UTC
Reported to upstream as https://gitlab.kitware.com/cmake/cmake/issues/16664