Skip to content

Commit 300e7f7

Browse files
committed
Update the default compilation options
Recent versions of Clang support `-fptrauth-elf-got` as a compiler driver option, thus do not use `-Xclang ...` anymore. Passing this option through the Clang driver makes it possible to override it by `-fno-ptrauth-elf-got` without modifying the *.cfg files. Additionally, enable more assertions by default: * Build LLVM with LLVM_ENABLE_ASSERTIONS * Check MachineInstr produced by the backend
1 parent e870cac commit 300e7f7

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

cmake/llvm.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
2-
set(LLVM_ENABLE_ASSERTIONS FALSE CACHE BOOL "" FORCE)
2+
set(LLVM_ENABLE_ASSERTIONS TRUE CACHE BOOL "" FORCE)
33
set(LLVM_CCACHE_BUILD TRUE CACHE BOOL "" FORCE)
44
set(LLVM_LINK_LLVM_DYLIB TRUE CACHE BOOL "" FORCE)
55
set(CLANG_LINK_CLANG_DYLIB TRUE CACHE BOOL "" FORCE)

config

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ LLVM_SHA=a832a5222e489298337fbb5876f8dcaf072c5cca
1111
MUSL_SHA=b37ee52aff13880884a7afa8c5161a4f4f7e0236
1212

1313
# Extra flags to write to Clang config files as the defaults.
14-
EXTRA_FLAGS_PAUTHTEST="-Xclang -fptrauth-elf-got"
14+
EXTRA_FLAGS_COMMON="-mllvm -verify-machineinstrs"
15+
EXTRA_FLAGS_PAUTHTEST="-fptrauth-elf-got"
1516
EXTRA_FLAGS_MUSL=""
1617

1718
### Other variables ###

scripts/build-all.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ set +x
1616
write_clang_config_files() {
1717
cat > "$INSTALL_DIR/bin/aarch64-unknown-linux-pauthtest.cfg" <<EOF
1818
--sysroot <CFGDIR>/../aarch64-linux-pauthtest
19+
$EXTRA_FLAGS_COMMON
1920
$EXTRA_FLAGS_PAUTHTEST
2021
EOF
2122
cat > "$INSTALL_DIR/bin/aarch64-unknown-linux-musl.cfg" <<EOF
2223
--sysroot <CFGDIR>/../aarch64-linux-musl
24+
$EXTRA_FLAGS_COMMON
2325
$EXTRA_FLAGS_MUSL
2426
EOF
2527
}

0 commit comments

Comments
 (0)