-
Notifications
You must be signed in to change notification settings - Fork 37.7k
build: remove confusing and inconsistent disable-asm option #29407
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. |
Ping @hebasto @fanquake @TheCharlatan for buildsystem eyes. |
Also ping @dergoegge for fuzzer interactions ACK/NACK. |
Concept ACK |
Concept ACK We only use Our docs (developer-notes.md and fuzzing.md) mention the use of
I think we're good for now but it probably makes sense if anyone runs into the ASan failures mentioned above. |
This is macOS specific? It may be good if someone tested or bisected this. |
@dergoegge Ah, thanks for the correction. The option does indeed currently pass through to secp, so that bullet-point in my commit message is wrong and I'll update it. It still forwards just fine with our option removed though, so I don't think that changes anything here. |
My usual fuzz configure for ARM64 macOS is the one in Just tried building (on master) with and without the The one difference I notice without
|
@jonatack see #29178 (we prefer having this broken over reverting the change that introduced it for some reason) I'm not sure if the Did you set |
Concept ACK 0eec878. |
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.
Do the mentiones from the doc/fuzzing.md
to --disable-asm
still need to be removed? Seems like --disable-asm
is not recognized by libsecp, it supports a package-specific asm option.
Sorry for the back-and-forth, but I confused myself here.
I got this wrong but it still accidentally made sense, heh. To be clear, passing All that confusion just seems like more justification for removal imo :) |
@jonatack Since you can reproduce, any interest in testing this theory bitcoin-core/crc32c-subtree#6 (comment) ? Edit: nevermind. Reproduced and explained here: bitcoin-core/crc32c-subtree#6 (comment) |
Concept ACK |
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.
Concept ACK.
@@ -50,10 +50,8 @@ LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a | |||
endif | |||
|
|||
LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE) | |||
if USE_ASM | |||
LIBBITCOIN_CRYPTO_SSE4 = crypto/libbitcoin_crypto_sse4.la |
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.
It seems there are no reasons to keep libbitcoin_crypto_sse4
library anymore. The crypto/sha256_sse4.cpp
source might be a part of the libbitcoin_crypto_base
, no?
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.
Agreed, but would you be ok with fixing this up in a follow-up? I think it'd make sense to address while dealing with this #29404 (review)
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.
See #29528.
In the libsecp repo, the Maybe gate the |
@fanquake Do you think it's too late for this for v27? It would imply require getting bitcoin-core/crc32c-subtree#6 in, I think. |
Can you point to where this is an issue? It looks as though secp has proper |
Sure. For example, bitcoin-core/secp256k1#1169 (comment). It holds for the current libsecp master branch @ bitcoin-core/secp256k1@0653a25 as well. |
I think it's still possible to do this for v27. It's not clear to me that the other change is strictly a requirement for doing this change?, but I also think that could go in. |
Fixed here bitcoin-core/secp256k1#1496 :) |
Any other sanitizer false-positives while we're at it? :) |
Anything in
Had another look, and this is correct. We need to merge a fix in the subtree, then do a subtree update here, and then this can be merged, otherwise we'll be left with at least one bug without any workaround. This PR should also be updated to removed the |
I think there should be no suppressions related to asm in those files, at least in the code that is compiled as part of Bitcoin Core |
I'm just talking about general suppressions, nothing asm specific. |
From
I'm unable to hit this locally. Presumably if it's still an issue we should be able to fix it with some notations. Does anyone happen to have a test-case for it? |
Concept ACK |
Want to rebase now? |
1. It didn't actually disable asm usage in our code. Regardless of the setting, asm is used in random.cpp and support/cleanse.cpp. 2. The value wasn't forwarded to libsecp as a user might have reasonably expected. 3. We now have the DISABLE_OPTIMIZED_SHA256 define which is what disable-asm actually did in practice. If there is any desire, we can hook DISABLE_OPTIMIZED_SHA256 up to a new configure option that actually does what it says.
The comment about sha256_sse4::Transform is believed to be old and stale.
26f67b1
to
f8a06f7
Compare
Rebased and removed RFC from PR title. |
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 f8a06f7
Followup to discussion in bitcoin#29407. Drops LIBBITCOIN_CRYPTO_SSE4.
Followup to discussion in bitcoin#29407. Drops LIBBITCOIN_CRYPTO_SSE4.
Align `bitcoin_crypto` library implementation with: - bitcoin#29407 - bitcoin#29528 Note. Failed to present this change as git-autosquash-ready.
5216933 build: move sha256_sse4 into libbitcoin_crypto_base (fanquake) Pull request description: Followup to discussion in #29407. Drops `LIBBITCOIN_CRYPTO_SSE4`. ACKs for top commit: theuni: utACK 5216933. hebasto: ACK 5216933. TheCharlatan: ACK 5216933 Tree-SHA512: 44889340b7647409a439ebe97012f66383e0e5f3d99200ffd55c124e91d3ed164f02b736ff9dafca2d9ba7e365fcdc79aff054471d4bc240d035b58659407420
…ecent sync to the master branch 4e19692 FIXUP: cmake: Build `bitcoin_crypto` library (Hennadii Stepanov) fc662d9 fixup! cmake: Build `secp256k1` static library (Hennadii Stepanov) Pull request description: Align `bitcoin_crypto` library implementation with: - bitcoin#29407 - bitcoin#29528 Note. Failed to present this change as git-autosquash-ready. ACKs for top commit: pablomartin4btc: crACK 4e19692 Tree-SHA512: 2d87cc7dc8423bcd345eb9282bd4091a6c9a4e768fe6f7fb6a96922f40335d5f85ef288a5af5279aa9795832fd617c8167fc776b6fb06bb7d3f698866cc5e3e5
Followup to discussion in bitcoin#29407. Drops LIBBITCOIN_CRYPTO_SSE4.
Followup to discussion in bitcoin#29407. Drops LIBBITCOIN_CRYPTO_SSE4.
I used
Since crypto/sha256_sse4.cpp is not guarded by DISABLE_OPTIMIZED_SHA256, there's no way for me to compile for fuzzing now. |
Can you open a new issue, with the complete config.log / build output? |
Still trying to understand the problem here, but in the meantime I'll PR an addition of the |
If there is any desire, we can hook DISABLE_OPTIMIZED_SHA256 up to a new configure option that actually does what it says.
Additionally, this is one of the last (THE last?) remaining uses of autoconf defines in our crypto code. As such it seems like low-hanging fruit.