From e254b56cff9cc34b07a026012926ee803ae42967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Thu, 15 Apr 2021 14:39:17 +0200 Subject: [PATCH] Add additional compiler flags for tvOS (#51241) We had those in the original mono/mono build. --- src/libraries/Native/Unix/CMakeLists.txt | 1 + src/mono/CMakeLists.txt | 1 + src/mono/mono.proj | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libraries/Native/Unix/CMakeLists.txt b/src/libraries/Native/Unix/CMakeLists.txt index 257d48f2d659d..8ebce76af457d 100644 --- a/src/libraries/Native/Unix/CMakeLists.txt +++ b/src/libraries/Native/Unix/CMakeLists.txt @@ -91,6 +91,7 @@ if(CLR_CMAKE_TARGET_MACCATALYST) endif() if(CLR_CMAKE_TARGET_TVOS) + # with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}) string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) diff --git a/src/mono/CMakeLists.txt b/src/mono/CMakeLists.txt index 1d80c86f21026..d1ff67be10138 100644 --- a/src/mono/CMakeLists.txt +++ b/src/mono/CMakeLists.txt @@ -188,6 +188,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS") set(HOST_IOS 1) if(CMAKE_SYSTEM_NAME STREQUAL "tvOS") set(HOST_TVOS 1) + # with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}) string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS}) string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) diff --git a/src/mono/mono.proj b/src/mono/mono.proj index bf65784f99116..6b105d8755ea3 100644 --- a/src/mono/mono.proj +++ b/src/mono/mono.proj @@ -316,22 +316,25 @@ <_MonoCFLAGS Include="-I$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/include" /> <_MonoCXXFLAGS Include="-Wl,-application_extension" /> - - + + <_MonoCMakeArgs Include="-DENABLE_MINIMAL=shared_perfcounters"/> - - + + <_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,portability,logging,shared_perfcounters" /> <_MonoCMakeArgs Include="-DENABLE_VISIBILITY_HIDDEN=1"/> <_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/> <_MonoCMakeArgs Include="-DENABLE_SIGALTSTACK=0"/> <_MonoCFLAGS Include="-Werror=partial-availability" /> + <_MonoCFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" /> <_MonoCFLAGS Include="-fexceptions" /> <_MonoCPPFLAGS Include="-DSMALL_CONFIG" /> <_MonoCPPFLAGS Include="-D_XOPEN_SOURCE" /> <_MonoCPPFLAGS Include="-DHAVE_LARGE_FILE_SUPPORT=1" /> <_MonoCXXFLAGS Include="-Werror=partial-availability" /> + <_MonoCXXFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" /> + <_MonoCXXFLAGS Include="-fexceptions" />