From 9b3575d8e9580647a7ca4f910460d95906865a57 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Tue, 27 Oct 2020 00:55:55 -0400 Subject: [PATCH] Set TARGET_SIZEOF_VOID_P and SIZEOF_REGISTER correctly when cross compiling. (#43851) --- src/mono/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 25e043f..ff7eea6 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -352,19 +352,29 @@ message("TARGET_ARCH=${TARGET_ARCH}") if(TARGET_ARCH STREQUAL "x86_64") set(TARGET_AMD64 1) set(MONO_ARCHITECTURE "\"amd64\"") + set(TARGET_SIZEOF_VOID_P 8) + set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH STREQUAL "x86") set(TARGET_X86 1) set(MONO_ARCHITECTURE "\"x86\"") + set(TARGET_SIZEOF_VOID_P 4) + set(SIZEOF_REGISTER 4) elseif(TARGET_ARCH STREQUAL "arm64") set(TARGET_ARM64 1) set(MONO_ARCHITECTURE "\"arm64\"") + set(TARGET_SIZEOF_VOID_P 8) + set(SIZEOF_REGISTER 8) elseif(TARGET_ARCH MATCHES "arm") set(TARGET_ARM 1) set(MONO_ARCHITECTURE "\"arm\"") # FIXME: add_definitions("-DARM_FPU_VFP=1") + set(TARGET_SIZEOF_VOID_P 4) + set(SIZEOF_REGISTER 4) elseif(TARGET_ARCH STREQUAL "wasm") set(MONO_ARCHITECTURE "\"wasm\"") + set(TARGET_SIZEOF_VOID_P 4) + set(SIZEOF_REGISTER 4) else() message(FATAL_ERROR "TARGET_ARCH='${TARGET_ARCH}' not supported.") endif() @@ -535,10 +545,6 @@ set(GSSIZE "ptrdiff_t") TEST_BIG_ENDIAN(IS_BIG_ENDIAN) -# FIXME: -set(TARGET_SIZEOF_VOID_P "${SIZEOF_VOID_P}") -set(SIZEOF_REGISTER "${SIZEOF_VOID_P}") - if(IS_BIG_ENDIAN) set(TARGET_BYTE_ORDER G_BIG_ENDIAN) else() -- 2.7.4