Skip to content

Commit 09af9e7

Browse files
committed
libressl-cmake.sh: disable ASM for Windows ARM64
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.
1 parent 7fc4875 commit 09af9e7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

_versions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export CURL_HASH=42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750ee
1010
# Create revision string
1111
# NOTE: Set _REV to 1 after bumping CURL_VER_, then increment for each
1212
# CI rebuild via `main` branch push (e.g. after bumping a dependency).
13-
export _REV="${CW_REVISION:-3}"
13+
export _REV="${CW_REVISION:-4}"
1414

1515
export TRURL_VER_='0.9'
1616
export TRURL_HASH=848da38c0ea07cd96d6adac4a5e5e141fe26e5bd846039aa350c3ca589a948e0

libressl-cmake.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ _VER="$1"
2525
CPPFLAGS+=' -DNDEBUG'
2626
fi
2727

28+
# LibreSSL (as of v3.8.2) hangs with ASM enabled on Windows ARM64.
29+
# It also results in long list of ASM warnings when -DNDEBUG is set.
30+
# This is hidden by CMake which force-unsets -DNDEBUG.
31+
if [ "${_OS}" = 'win' ] && [ "${_CPU}" = 'a64' ]; then
32+
options+=' -DENABLE_ASM=OFF'
33+
fi
34+
2835
if [ "${_CC}" = 'llvm' ]; then
2936
CFLAGS+=' -Wa,--noexecstack'
3037
else

libressl-pkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: MIT
55

66
# Caveats (as of 3.8.2):
7-
# - ARM64 Windows builds exit with an assert.
7+
# - ARM64 Windows builds exit with an assert and hang with asserts disabled.
88
# https://github.com/libressl/portable/issues/987
99
# - CMake builds override -NDEBUG and do not allow building with this option.
1010
# - ASM support only for x64.

0 commit comments

Comments
 (0)