Skip to content

Commit 567867f

Browse files
committed
cmake: update SetHwArchString()
The patch simplifies the implementation of the function `SetHwArchString()` for obtaining the architecture name. Needed for the following patch with macOS support and Ubuntu 24.04 AArch64 (ARM64) support. Needed for #59
1 parent 4148a02 commit 567867f

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222
- Support Address and UndefinedBehaviour sanitizers.
2323
- Support LuaJIT metrics.
2424
- Support OSS Fuzz environment (#73).
25+
- Support for building on Ubuntu 24.04 AArch64 (ARM64).
2526

2627
### Changed
2728

cmake/SetClangRTLib.cmake

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1+
# The function sets the given variable in a parent scope to a
2+
# string with hardware architecture name and this name should
3+
# match to hardware architecture name used in a library name of
4+
# libclang_rt.fuzzer_no_main: aarch64, x86_64, i386.
15
function(SetHwArchString outvar)
2-
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
3-
set(hw_arch "i386")
4-
elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
5-
set(hw_arch "x86_64")
6-
else ()
7-
message(FATAL_ERROR "Unsupported architecture.")
8-
endif ()
9-
set(${outvar} ${hw_arch} PARENT_SCOPE)
6+
set(${outvar} ${CMAKE_SYSTEM_PROCESSOR} PARENT_SCOPE)
107
endfunction()
118

129
# The function sets the given variable in a parent scope to a

0 commit comments

Comments
 (0)