mirror of
https://github.com/FEX-Emu/FEX.git
synced 2024-11-23 14:40:14 +00:00
b75e8f2abf
Fairly straightforward, just requires enabling lld in this case since cross-compiling doesn't work well with gnu linker. Also lld doesn't understand the linker script program header symbolic names for read/write/execute. So we need to use the raw number there. Works around an issue where GCC 11 generates broken `init_array` section and also plt sections that glibc doesn't understand.
21 lines
725 B
CMake
21 lines
725 B
CMake
option(ENABLE_CLANG_THUNKS "Enable building thunks with clang" FALSE)
|
|
|
|
set(CMAKE_SYSTEM_PROCESSOR i686)
|
|
|
|
if (ENABLE_CLANG_THUNKS)
|
|
message(STATUS "Enabling thunk clang building. Force enabling LLD as well")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
|
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
|
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld")
|
|
set(CMAKE_C_COMPILER clang)
|
|
set(CMAKE_CXX_COMPILER clang++)
|
|
set(CLANG_FLAGS "-target i686-linux-gnu -msse2 -mfpmath=sse")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CLANG_FLAGS}")
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_FLAGS}")
|
|
else()
|
|
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc -m32)
|
|
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++ -m32)
|
|
endif()
|