-
Notifications
You must be signed in to change notification settings - Fork 37.8k
build: remove -bind_at_load
usage
#28783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
@theuni @TheCharlatan you might have some libtool ideas? Couldn't see too anything obvious to prune this out. |
Yuck. The only thing I can think of is a sledgehammer hack similar to this ancient one: |
See theuni@c61c9c5 which is ugly but seems to work as intended. |
46d4667
to
144deff
Compare
I do hate One other point is that last time I looked, |
Guix Build (arm64): cf3250e32cf25ee1a75372bed2fb105fc893abd40662ed60b6376cd1f77586a1 guix-build-144deffe35b7/output/arm64-apple-darwin/SHA256SUMS.part
11a505365063b6234a8e205e3b30a5a7a9bb1b1cc6bf266b5038b18474edbd1f guix-build-144deffe35b7/output/arm64-apple-darwin/bitcoin-144deffe35b7-arm64-apple-darwin-unsigned.tar.gz
674f71f6c59e064e8f42a2f11c2406fea08873b6369b472f9662e8ee0c5567e4 guix-build-144deffe35b7/output/arm64-apple-darwin/bitcoin-144deffe35b7-arm64-apple-darwin-unsigned.zip
c6fe023ee5e7fdcec8b42a4ac77c6303daf0b2fa61022009fb87e440f8e43a6a guix-build-144deffe35b7/output/arm64-apple-darwin/bitcoin-144deffe35b7-arm64-apple-darwin.tar.gz
f7658c6b212e04b6ced4afb471abca6eece9763ec9b912004ecf0b2f9c2bb7d8 guix-build-144deffe35b7/output/dist-archive/bitcoin-144deffe35b7.tar.gz
d0e86a3eedbe3e944df7282936994d755580e69a4d7c7bd7fb4350e3bf670f81 guix-build-144deffe35b7/output/x86_64-apple-darwin/SHA256SUMS.part
7839a306c6fe7113b0fb390b11799903857594ac5b22ce92c77baca7f28adbdc guix-build-144deffe35b7/output/x86_64-apple-darwin/bitcoin-144deffe35b7-x86_64-apple-darwin-unsigned.tar.gz
94edf9895f2d176810ed8025c779d11106a2176fe2dd7b331a34c99c30fb0a4a guix-build-144deffe35b7/output/x86_64-apple-darwin/bitcoin-144deffe35b7-x86_64-apple-darwin-unsigned.zip
49441bbef48c0abc1ce7eba15cba9dc3562f8ab6e4cd402984f7c10849361dbf guix-build-144deffe35b7/output/x86_64-apple-darwin/bitcoin-144deffe35b7-x86_64-apple-darwin.tar.gz |
utACK. Whoops, I butchered that commit message. I forgot to paste in the commit hash I was referencing. Mind fixing it up? |
This is deprecated on macOS: ```bash ld: warning: -bind_at_load is deprecated on macOS ``` and likely redundant anyways, given the behaviour of dyld3. Unfortunately libtool is still injecting a `-bind_at_load`: ```bash # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi ``` so this doesn't remove all the warnings, but removes us as a potential source of them. Note that anywhere the ld64 warnings are being emitted, we are already not adding this flag to our hardened ldflags, because of `-Wl,-fatal_warnings`.
Pretty sure it is there? "Similar to a98356f." |
"build: Add an old hack similar to remove bind_at_load from libtool." -> I clearly copied "similar to" from one place to another and forgot to delete the first :) |
144deff
to
3c61c60
Compare
On Intel macOS 13.6 before this PR I get the warning 6 times:
With 3c61c60 it's gone:
Quickly tested the QT binary still works. |
utACK 3c61c60. |
My Guix builds:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 3c61c60, tested on macOS Sonoma 14.1.1 (23B81, Apple M1) and Ubuntu 23.10 (cross-compiling for macOS). Also I've verified the actual diff in the libtool
script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on ARM64 M1 Max with macOS Ventura 13.6 and the bind_at_load
warnings are now gone. Thank you for fixing this.
The `-bind_at_load` has been removed since bitcoin#28783.
3b612a0 fixup! cmake: Add `HARDENING` option (Hennadii Stepanov) Pull request description: The `-bind_at_load` has been removed since bitcoin#28783. Top commit has no ACKs. Tree-SHA512: a7ccd561edc1fb260d3fbb5dad3ecc516488d9c6ca9b1f926e709f62b415d969f7ad620260ed86b5f80a44fc1791d8e11e3b61f375f1f6993a2e60d304e0b919
This is deprecated on macOS:
and likely redundant anyways, given the behaviour of dyld3.
Unfortunately libtool is still injecting a
-bind_at_load
, because it's version check is broken:so this adds another change to strip them out at the end of configure.
Note that anywhere the ld64 warnings are being emitted, we are already not adding this flag to our hardened ldflags, because of
-Wl,-fatal_warnings
.