-
Notifications
You must be signed in to change notification settings - Fork 37.7k
scripts: prevent GCC optimising test symbols in test-symbol-check #22645
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Looks like the following comment should be updated as well
|
In
-lm , if pow has been dropped?
|
b6f32d0
to
7bcc3a0
Compare
7bcc3a0
to
5449d44
Compare
Addressed. |
Guix builds: a9f14075ec8c67df4a09b07f40a9e3669376e33955c9759c0b09627979d137e9 guix-build-5449d44e3798/output/aarch64-linux-gnu/SHA256SUMS.part
2c1ca56f4c7761ea016d2ccc3ddc0f05a7bbcd5d2a8a166142a7e7294508c633 guix-build-5449d44e3798/output/aarch64-linux-gnu/bitcoin-5449d44e3798-aarch64-linux-gnu-debug.tar.gz
1ec17bc8017c2ee9cd3b23739db3ae180ed34cbea4dad925cd52e44c70e0271a guix-build-5449d44e3798/output/aarch64-linux-gnu/bitcoin-5449d44e3798-aarch64-linux-gnu.tar.gz
2e3413803c4f2e461e13e0027b5c9dcedb256e5857074d651225680803771031 guix-build-5449d44e3798/output/arm-linux-gnueabihf/SHA256SUMS.part
b8c7b375eda6155cd3652c7986a26983191fac3c244aedf39bdd216bc0c967b2 guix-build-5449d44e3798/output/arm-linux-gnueabihf/bitcoin-5449d44e3798-arm-linux-gnueabihf-debug.tar.gz
3fb84540a214b504c38fe854db7f88ba5bb39fec78894b731a07b18ffc3f1480 guix-build-5449d44e3798/output/arm-linux-gnueabihf/bitcoin-5449d44e3798-arm-linux-gnueabihf.tar.gz
b4c1b9a2de37ac95fc03d12cb592740c78279ba7ef1ae8d89f90e9c91a24de06 guix-build-5449d44e3798/output/dist-archive/bitcoin-5449d44e3798.tar.gz
9f4dc2f282d1cc7cb05f3240d0ef0cceae5c827da5b2f1e9943f98e5a40fbac7 guix-build-5449d44e3798/output/powerpc64-linux-gnu/SHA256SUMS.part
051714775d3d03f131603698f26f70f633f5deda14b5ef440f47d3af81db7e59 guix-build-5449d44e3798/output/powerpc64-linux-gnu/bitcoin-5449d44e3798-powerpc64-linux-gnu-debug.tar.gz
f0ea3b294687ce3b6d39ff9a1c1ad74fc22a7d3c30ab10170a2da8b998c405d9 guix-build-5449d44e3798/output/powerpc64-linux-gnu/bitcoin-5449d44e3798-powerpc64-linux-gnu.tar.gz
074d54eeadd72413c4bc806c48ee4333712bed1b8220fcb155ae9a61e6d474a6 guix-build-5449d44e3798/output/powerpc64le-linux-gnu/SHA256SUMS.part
bccd331b452157223324d71444b9da13d855a180742fd7be124c99b9da006a93 guix-build-5449d44e3798/output/powerpc64le-linux-gnu/bitcoin-5449d44e3798-powerpc64le-linux-gnu-debug.tar.gz
da474c6adb99c412111afa2559b1d91233f7ee3922b00863a65b0335aa70fa61 guix-build-5449d44e3798/output/powerpc64le-linux-gnu/bitcoin-5449d44e3798-powerpc64le-linux-gnu.tar.gz
4049e8fce4cd411d0894301b777b37fcb4f3a790821e8d803e40aacbf0a27da9 guix-build-5449d44e3798/output/riscv64-linux-gnu/SHA256SUMS.part
b9468dac4321f223b67517b846c2b49f2740674078404a94e8612e198c30685b guix-build-5449d44e3798/output/riscv64-linux-gnu/bitcoin-5449d44e3798-riscv64-linux-gnu-debug.tar.gz
cf053f309c675b9758ad8e639b587c450d47216d76e1e642aa7c4fcb83f6d097 guix-build-5449d44e3798/output/riscv64-linux-gnu/bitcoin-5449d44e3798-riscv64-linux-gnu.tar.gz
633a4b62a66dcbaa4bcde89d0531a963f41719c2171e0893d4fc1118c0877286 guix-build-5449d44e3798/output/x86_64-apple-darwin18/SHA256SUMS.part
bc058999df5d52bbdb10441e1229099828bf5e045b1d174ee704184bdbf956f2 guix-build-5449d44e3798/output/x86_64-apple-darwin18/bitcoin-5449d44e3798-osx-unsigned.dmg
f1e686b4b1f470899488d366eeff4cb39818295b3c43041d21fff1b4d8c81a8e guix-build-5449d44e3798/output/x86_64-apple-darwin18/bitcoin-5449d44e3798-osx-unsigned.tar.gz
3bf71b5d3f52383be4e6cc387a469ef35d985a687d2cee61b65f536805a2944c guix-build-5449d44e3798/output/x86_64-apple-darwin18/bitcoin-5449d44e3798-osx64.tar.gz
1149a6873737094da169642f0b6ddb7422d2fb68f3f4bfe742f36d152c0c4b41 guix-build-5449d44e3798/output/x86_64-linux-gnu/SHA256SUMS.part
8ba196a5fa992367a0ac79323dc61bd0939829e7d0749da8406ed0ee27775a09 guix-build-5449d44e3798/output/x86_64-linux-gnu/bitcoin-5449d44e3798-x86_64-linux-gnu-debug.tar.gz
910b9464f376c6cf92d67d459918b3b625a989469cbdfbc3b56ca1c55e4c6146 guix-build-5449d44e3798/output/x86_64-linux-gnu/bitcoin-5449d44e3798-x86_64-linux-gnu.tar.gz
6726d63017cc78f274988be2feaffc5de084d6c61a40abcb96e87fa5eda03de5 guix-build-5449d44e3798/output/x86_64-w64-mingw32/SHA256SUMS.part
2f851792c71053dac82fb3fae0a4074c07dc5f01f8614bce9a5cf6e79dbb2692 guix-build-5449d44e3798/output/x86_64-w64-mingw32/bitcoin-5449d44e3798-win-unsigned.tar.gz
45c79b7d48f131a0f53478b10cbc23db947148bc0991465b90c0665a6ce3e3c9 guix-build-5449d44e3798/output/x86_64-w64-mingw32/bitcoin-5449d44e3798-win64-debug.zip
187ab548c07ca849df62220f777dd83f25c200d89227276c3d852af181957602 guix-build-5449d44e3798/output/x86_64-w64-mingw32/bitcoin-5449d44e3798-win64-setup-unsigned.exe
2070ad765d21e17bbcf67f14ce2df664283653ca63ce41689362317a92917749 guix-build-5449d44e3798/output/x86_64-w64-mingw32/bitcoin-5449d44e3798-win64.zip |
ACK 5449d44 |
sidhujag
pushed a commit
to syscoin/syscoin
that referenced
this pull request
Aug 20, 2021
…test-symbol-check 5449d44 scripts: prevent GCC optimising test symbols in test-symbol-check (fanquake) Pull request description: I noticed in bitcoin#22381 that when the test-symbol-check target was being built with Clang and run in the CI it would fail due to using a too-new version of `pow` (used [here](https://github.com/bitcoin/bitcoin/blob/d67330d11245b11fbdd5e2dd5343ee451186931e/contrib/devtools/test-symbol-check.py#L85)). Our CIs use Focal (glibc 2.31) and the version of `pow` was the optimized version introduced in [glibc 2.29](https://lwn.net/Articles/778286/): ```bash * Optimized generic exp, exp2, log, log2, pow, sinf, cosf, sincosf and tanf. ``` This made sense, except for that if it was failing when built using Clang, why hadn't it also been failing when being built with GCC? Turns out GCC is optimizing away that call to `pow` at all optimization levels, including `-O0`, see: https://godbolt.org/z/53MhzMxT7, and this has been the case forever, or at least since GCC 5.x. Clang on the other hand, will only optimize away the `pow` call at `-O1` and `-O2`, not `-O0`: https://godbolt.org/z/Wbnqj3q6c. Thus when this test was built with Clang (we don't pass `-O` so we default to `-O0`) it was failing in the CI environment, because it would actually have a call to the "new" `pow`. Avoid this issue by using a symbol that won't be optimized away, or that we are unlikely to ever have versioning issues with. ACKs for top commit: laanwj: ACK 5449d44 Tree-SHA512: 3a26c5c3a5f2905fd0dd90892470e241ba625c0af3be2629d06d5da3a97534c1d6a55b796bbdd41e2e6a26a8fab7d981b98c45d4238565b0eb7edf3c5da02007
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed in #22381 that when the test-symbol-check target was being built with Clang and run in the CI it would fail due to using a too-new version of
pow
(used here). Our CIs use Focal (glibc 2.31) and the version ofpow
was the optimized version introduced in glibc 2.29:* Optimized generic exp, exp2, log, log2, pow, sinf, cosf, sincosf and tanf.
This made sense, except for that if it was failing when built using Clang, why hadn't it also been failing when being built with GCC?
Turns out GCC is optimizing away that call to
pow
at all optimization levels, including-O0
, see: https://godbolt.org/z/53MhzMxT7, and this has been the case forever, or at least since GCC 5.x. Clang on the other hand, will only optimize away thepow
call at-O1
and-O2
, not-O0
: https://godbolt.org/z/Wbnqj3q6c. Thus when this test was built with Clang (we don't pass-O
so we default to-O0
) it was failing in the CI environment, because it would actually have a call to the "new"pow
.Avoid this issue by using a symbol that won't be optimized away, or that we are unlikely to ever have versioning issues with.