From 8cddaf034550bfea6e7d9ec57af1af822eb33053 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 26 Mar 2024 00:38:32 +0000 Subject: mingw: re-enable endbr opcode, add workaround for clang `cet.h` issue - https://github.com/libressl/openbsd/pull/149 fixes to crash on startup issue, thus nuking all endbr opcodes is no longer necessary. This effectively enables CET in ASM code for MinGW x86_64 builds. - llvm `cet.h` (as of v18) assigns `endbr32` instead of `endbr64` to `_CET_ENDBR` macro for MinGW x86_64 targets. https://github.com/llvm/llvm-project/blob/llvmorg-18.1.1/clang/lib/Headers/cet.h#L15-L35 Work this around by mapping `endbr32` to `endbr64`. Prerequisite: https://github.com/libressl/openbsd/pull/149 Fixes: https://github.com/libressl/portable/issues/1015 --- crypto/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 110a673..87fb2d8 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -193,7 +193,7 @@ if(HOST_ASM_MINGW64_X86_64) whrlpool/wp-mingw64-x86_64.S cpuid-mingw64-x86_64.S ) - add_definitions(-Dendbr64=) + add_definitions(-Dendbr32=endbr64) add_definitions(-DAES_ASM) add_definitions(-DBSAES_ASM) add_definitions(-DVPAES_ASM) -- cgit v1.2.3-55-g6feb