Bug 1605019

Summary: ld fails with "defined in discarded section", e.g. stockfish: FTBFS in Fedora rawhide
Product: [Fedora] Fedora Reporter: Raphael Groner <projects.rg>
Component: stockfishAssignee: Raphael Groner <projects.rg>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: dakingun, denis.arnaud_fedora, dhiru, jwakely, projects.rg
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
URL: http://apps.fedoraproject.org/koschei/package/stockfish
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-26 06:08:43 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:
Embargoed:

Description Raphael Groner 2018-07-20 02:01:27 UTC
Description of problem:
Package stockfish fails to build from source in Fedora rawhide.

Version-Release number of selected component (if applicable):
9-3.fc29

Steps to Reproduce:
koji build --scratch f29 stockfish-9-3.fc29.src.rpm

Additional info:
This package is tracked by Koschei. See:
http://apps.fedoraproject.org/koschei/package/stockfish

Comment 1 Raphael Groner 2018-07-20 02:04:16 UTC
From build.log:
`_GLOBAL__sub_I_Threads' referenced in section `.init_array' of CMakeFiles/stockfish.dir/thread.cpp.o: defined in discarded section `.text.startup[_ZNK10ThreadPool4mainEv]' of CMakeFiles/stockfish.dir/thread.cpp.o
`_GLOBAL__sub_I__ZN3UCI4loopEiPPc' referenced in section `.init_array' of CMakeFiles/stockfish.dir/uci.cpp.o: defined in discarded section `.text.startup[_ZNK10ThreadPool4mainEv]' of CMakeFiles/stockfish.dir/uci.cpp.o
collect2: error: ld returned 1 exit status

This seems to be an issue [1] with linkage of boost. Please try to rebuild boost because of the bump to gcc [2].

[1] https://stackoverflow.com/questions/9811503/unusual-c-linker-error-defined-in-discarded-section
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49665

Comment 2 Jonathan Wakely 2018-07-20 08:59:34 UTC
Why do you think this is related to Boost? The symbols given in the errors are nothing to do with Boost, and the GCC bug you reference was fixed seven years ago.

Comment 3 Jonathan Wakely 2018-07-20 09:02:34 UTC
Stockfish doesn't even depend on boost! This has nothing to do with Boost at all.

Comment 4 Raphael Groner 2018-07-20 16:26:31 UTC
Okay and thanks for looking into this issue. Sorry for any useless confusion. Taking this bug back.

Comment 5 Raphael Groner 2018-07-26 06:08:43 UTC
Magically fixed in rawhide. I would really like to know what happened.