-
Notifications
You must be signed in to change notification settings - Fork 265
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
cmake: disable default NDEBUG differently #988
Conversation
This method allows to set it via custom flags.
Turned out that the official Windows ARM64 curl.exe exited with an assert when run with a simple command like: `curl https://example.org`. ``` Assertion failed: (i == BN_BITS2) || (h <= (BN_ULONG)1 << i), file \crypto\bn\bn_div.c, line 96 ``` Ref: libressl/portable#987 This issue was masked at build time, because `NDEBUG` is force-disable in CMake builds. PR to fix that (or at least allow to set NDEBUG manually: libressl/portable#988 When building with `NDEBUG`, there are is a list of compiler warnings: ``` In file included from libressl/crypto/bn/bn_add.c:65: libressl/crypto/bn/arch/aarch64/bn_arch.h:35:16: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] 35 | : [n]"=r"(n) | ^ libressl/crypto/bn/arch/aarch64/bn_arch.h:34:18: note: use constraint modifier "w" 34 | __asm__ ("clz %[n], %[w]" | ^~~~ | %w[n] libressl/crypto/bn/arch/aarch64/bn_arch.h:36:15: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] 36 | : [w]"r"(w)); | ^ libressl/crypto/bn/arch/aarch64/bn_arch.h:34:24: note: use constraint modifier "w" 34 | __asm__ ("clz %[n], %[w]" | ^~~~ | %w[w] libressl/crypto/bn/arch/aarch64/bn_arch.h:51:37: warning: value size does not match register size specified by the constraint and modifier [-Wasm-operand-widths] 51 | : [carry]"=r"(carry), [r0]"=r"(r0) | ^ [...] ``` Such builds will hang with the same command instead of showing the assert, meaning that ASM support is clearly not ready for Windows ARM64, but this issue was masked by the NDEBUG build issue. autotools builds have ASM disabled by default for this build case.
Thanks. I was just looking at build logs for another diff, being slightly annoyed there wasn't a better way to override NDEBUG without a bunch of warnings. |
Is there something to do, or any pending concern with this PR to get merged? |
Thanks, merged. Apologies for the long wait.
|
This patch was merged, yet surprisingly, it's missing from master and from both 3.8.3 and 3.9.0. Was it intended? |
Before this patch `NDEBUG` was force-disabled, preventing a build with debug asserts disabled. After this patch `NDEBUG` works again when passed as a custom build option, e.g.: `-DCMAKE_C_FLAGS=-DNDEBUG` Previously submitted as libressl#988, which was merged, but the commit vanished from master and ended up missing from both 3.8.3 and 3.9.0 releases.
I wonder if this got merged to the github mirror only, then was overwritten when we synced up. I only see it referred to in the PR branch in the actual source tree, and there wasn't a revert that I can see. |
Yes, that's possible. I've opened #1016 to try one more time. Or the previous patch |
Before this patch `NDEBUG` was force-disabled, preventing a build with debug asserts disabled. After this patch `NDEBUG` works again when passed as a custom build option, e.g.: `-DCMAKE_C_FLAGS=-DNDEBUG` Previously submitted as #988, which was merged, but the commit vanished from master and ended up missing from both 3.8.3 and 3.9.0 releases.
This method allows to set it via custom flags.