Repository navigation
cmake: only pass --copy-dt-needed-entries to linkers that accept it - #71494
Conversation
5154690 to
186bb53
Compare
|
jenkins test api |
|
jenkins test make check |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
186bb53 to
a305b77
Compare
|
@dvanders Hi Dan, |
|
@wjwithagen agreed it isn't an OS issue, but I don't think it's a compiler one either: it's the linker. Patrick added the flag (c6ac71d, https://tracker.ceph.com/issues/70498) to work around GNU ld on Ubuntu 22.04, and clang on Linux uses that same GNU ld unless told otherwise, so How about testing the linker directly, once in the top-level CMakeLists.txt: and guarding each use with |
c6ac71d added -Wl,--copy-dt-needed-entries to work around GNU ld on Ubuntu 22.04 (https://tracker.ceph.com/issues/70498). The option is specific to GNU ld; other linkers, such as lld on FreeBSD, Apple's ld on macOS and lld in MinGW mode, reject it, so linking fails there. Test the linker once in src/CMakeLists.txt with check_linker_flag() and guard each use with HAVE_LINK_COPY_DT_NEEDED_ENTRIES. Suggested-by: Kefu Chai <[email protected]> Suggested-by: Dan van der Ster <[email protected]> Signed-off-by: Willem Jan Withagen <[email protected]>
a305b77 to
8b22b95
Compare
|
@dvanders Took your suggestion to make a separate FLAG for this.... |
dvanders
left a comment
There was a problem hiding this comment.
Thanks Willem, this is what I had in mind. All 11 uses are now guarded by the one linker check, so it does the right thing with GNU ld (including clang on Linux), lld, ld64 and MinGW without listing platforms.
I checked the probe against Apple's ld (ld-27037): HAVE_LINK_COPY_DT_NEEDED_ENTRIES comes out false there while a flag ld64 does know passes, and make check is green on Linux, where the flag is still used. LGTM.
|
@wjwithagen could you push this change to ceph-ci, so we can verify that it still builds on these builders? |
Never done that I guess, so not sure how to do that... |
|
it's a repo at https://github.com/ceph/ceph-ci. the branches pushed to it are picked up by jenkins and jenkins builds packages from them with configured builders. see shaman.ceph.com/builds/ceph/ anyway, just pushed to this repo. the build result will show up at https://shaman.ceph.com/builds/ceph/wip-pr-71494-kefu/ |
c6ac71d added -Wl,--copy-dt-needed-entries to work around GNU ld on
Ubuntu 22.04 (https://tracker.ceph.com/issues/70498). The option is
specific to GNU ld; other linkers, such as lld on FreeBSD, Apple's ld
on macOS and lld in MinGW mode, reject it, so linking fails there.
Test the linker once in src/CMakeLists.txt with check_linker_flag()
and guard each use with HAVE_LINK_COPY_DT_NEEDED_ENTRIES.
Suggested-by: Dan van der Ster [email protected]
Signed-off-by: Willem Jan Withagen [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.