beam icon indicating copy to clipboard operation
beam copied to clipboard

Compiling on aarch64 Linux - wrong identification as -march=core2

Open jTd7bPLFb opened this issue 2 years ago • 2 comments

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

jTd7bPLFb avatar Sep 18 '21 15:09 jTd7bPLFb

Related: #1823

tgbv avatar Sep 19 '21 09:09 tgbv

@chapati please, take a look

gingervik avatar Sep 21 '21 05:09 gingervik