From 848fdb599b689d072ff2cdc7f1b11e7b19b9f193 Mon Sep 17 00:00:00 2001 From: Koakuma Date: Mon, 15 Dec 2025 20:03:11 +0700 Subject: [PATCH] [test-suite] Define UNALIGNED_MEM_ACCESS_NOT_SUPPORTED in ALAC test for SPARC SPARC systems doesn't support misaligned memory access, so without the define, the test will crash with a SIGBUS. This should fix the test failures. --- MultiSource/Applications/ALAC/decode/CMakeLists.txt | 6 ++++++ MultiSource/Applications/ALAC/encode/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/MultiSource/Applications/ALAC/decode/CMakeLists.txt b/MultiSource/Applications/ALAC/decode/CMakeLists.txt index a591011ece..c7a289a99a 100644 --- a/MultiSource/Applications/ALAC/decode/CMakeLists.txt +++ b/MultiSource/Applications/ALAC/decode/CMakeLists.txt @@ -5,6 +5,12 @@ else() list(APPEND CFLAGS -DTARGET_RT_BIG_ENDIAN=1) list(APPEND CXXFLAGS -DTARGET_RT_BIG_ENDIAN=1) endif() + +if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "sparc") + list(APPEND CFLAGS -DUNALIGNED_MEM_ACCESS_NOT_SUPPORTED) + list(APPEND CXXFLAGS -DUNALIGNED_MEM_ACCESS_NOT_SUPPORTED) +endif() + set(RUN_OPTIONS - - < tune.caf) llvm_multisource(alacconvert-decode EndianPortable.c diff --git a/MultiSource/Applications/ALAC/encode/CMakeLists.txt b/MultiSource/Applications/ALAC/encode/CMakeLists.txt index e2af09de97..3beed5a3f5 100644 --- a/MultiSource/Applications/ALAC/encode/CMakeLists.txt +++ b/MultiSource/Applications/ALAC/encode/CMakeLists.txt @@ -5,6 +5,12 @@ else() list(APPEND CFLAGS -DTARGET_RT_BIG_ENDIAN=1) list(APPEND CXXFLAGS -DTARGET_RT_BIG_ENDIAN=1) endif() + +if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "sparc") + list(APPEND CFLAGS -DUNALIGNED_MEM_ACCESS_NOT_SUPPORTED) + list(APPEND CXXFLAGS -DUNALIGNED_MEM_ACCESS_NOT_SUPPORTED) +endif() + set(RUN_OPTIONS - - < tune.wav) llvm_multisource(alacconvert-encode EndianPortable.c