1
1
mirror of https://github.com/rui314/mold.git synced 2024-09-19 08:57:39 +03:00

Run power10 tests on qemu only if qemu and cross GCC suports power10

This commit is contained in:
Rui Ueyama 2023-11-07 11:45:02 +09:00
parent 8d1c08bd03
commit 8c337b25df

View File

@ -136,9 +136,24 @@ if(${HOST} STREQUAL "ppc64le" OR (HAS_qemu-ppc64le AND HAS_powerpc64le-linux-gnu
add_target(ppc64le powerpc64le-linux-gnu)
endif()
if((${HOST} STREQUAL "ppc64le" AND "${CPUINFO}" MATCHES "POWER10") OR
(HAS_qemu-ppc64le AND HAS_powerpc64le-linux-gnu-gcc))
if(${HOST} STREQUAL "ppc64le" AND "${CPUINFO}" MATCHES "POWER10")
add_target(ppc64le powerpc64le-linux-gnu power10)
elseif(HAS_qemu-ppc64le AND HAS_powerpc64le-linux-gnu-gcc)
file(WRITE "${CMAKE_BINARY_DIR}/empty.c" "")
execute_process(
COMMAND powerpc64le-linux-gnu-gcc -mcpu=power10 -E
"${CMAKE_BINARY_DIR}/empty.c"
RESULT_VARIABLE GCC_EXIT_CODE
OUTPUT_QUIET ERROR_QUIET)
execute_process(
COMMAND qemu-ppc64le -cpu help
OUTPUT_VARIABLE QEMU_CPUS)
if("${GCC_EXIT_CODE}" EQUAL "0" AND "${QEMU_CPUS}" MATCHES power10)
add_target(ppc64le powerpc64le-linux-gnu power10)
endif()
endif()
if(${HOST} STREQUAL "sparc64" OR (HAS_qemu-sparc64 AND HAS_sparc64-linux-gnu-gcc))