beam
beam copied to clipboard
Compiling on aarch64 Linux - wrong identification as -march=core2
Compiling on aarch64 Linux - wrong identification as -march=core2
While trying to compile on aarch64 linux, the -march flag is set to core2, which is wrong. Should be set to native.
To Reproduce download latest tar.gz source extract run cmake -DCMAKE_BUILD_TYPE=Release . && make -j2
see error cc1plus: error: unknown value ‘core2’ for ‘-march’
Platform and build
uname -a
Linux armserver 5.11.0-34-generic #36-Ubuntu SMP Thu Aug 26 19:22:20 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
cat /etc/debian_version
bullseye/sid
Configuration, log, memory dump files (if applicable) CMakeLists.txt, line 268
if(NOT ANDROID AND NOT IOS AND NOT EMSCRIPTEN)
if(ARCH_NATIVE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=core2") # **<<<<< THIS MAKES PROBLEMS**
endif()
endif()
Quick and dirty Fix just replace the core2 with native
Proposed solution a proper check for linux aarch64 should be included, that sets the -march=native
Related: #1823
@chapati please, take a look