Skip to content

Commit e254b56

Browse files
authored
Add additional compiler flags for tvOS (#51241)
We had those in the original mono/mono build.
1 parent 2acee91 commit e254b56

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/libraries/Native/Unix/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ if(CLR_CMAKE_TARGET_MACCATALYST)
9191
endif()
9292

9393
if(CLR_CMAKE_TARGET_TVOS)
94+
# with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags
9495
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
9596
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS})
9697
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})

src/mono/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS")
188188
set(HOST_IOS 1)
189189
if(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
190190
set(HOST_TVOS 1)
191+
# with -fembed-bitcode passing -headerpad_max_install_names is not allowed so remove it from the CMake flags
191192
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS})
192193
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS})
193194
string(REPLACE "-Wl,-headerpad_max_install_names" "" CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})

src/mono/mono.proj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,22 +316,25 @@
316316
<_MonoCFLAGS Include="-I$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/include" />
317317
<_MonoCXXFLAGS Include="-Wl,-application_extension" />
318318
</ItemGroup>
319-
<!-- iOS simulator specific options -->
320-
<ItemGroup Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true'">
319+
<!-- iOS/tvOS simulator specific options -->
320+
<ItemGroup Condition="('$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true') or ('$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' == 'true')">
321321
<_MonoCMakeArgs Include="-DENABLE_MINIMAL=shared_perfcounters"/>
322322
</ItemGroup>
323-
<!-- iOS device specific options -->
324-
<ItemGroup Condition="'$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true'">
323+
<!-- iOS/tvOS device specific options -->
324+
<ItemGroup Condition="('$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' != 'true') or ('$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' != 'true')">
325325
<_MonoCMakeArgs Include="-DENABLE_MINIMAL=jit,portability,logging,shared_perfcounters" />
326326
<_MonoCMakeArgs Include="-DENABLE_VISIBILITY_HIDDEN=1"/>
327327
<_MonoCMakeArgs Include="-DENABLE_LAZY_GC_THREAD_CREATION=1"/>
328328
<_MonoCMakeArgs Include="-DENABLE_SIGALTSTACK=0"/>
329329
<_MonoCFLAGS Include="-Werror=partial-availability" />
330+
<_MonoCFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" />
330331
<_MonoCFLAGS Include="-fexceptions" />
331332
<_MonoCPPFLAGS Include="-DSMALL_CONFIG" />
332333
<_MonoCPPFLAGS Include="-D_XOPEN_SOURCE" />
333334
<_MonoCPPFLAGS Include="-DHAVE_LARGE_FILE_SUPPORT=1" />
334335
<_MonoCXXFLAGS Include="-Werror=partial-availability" />
336+
<_MonoCXXFLAGS Condition="'$(TargetstvOS)' == 'true'" Include="-fno-gnu-inline-asm" />
337+
<_MonoCXXFLAGS Include="-fexceptions" />
335338
</ItemGroup>
336339
<!-- Android specific options -->
337340
<PropertyGroup Condition="'$(TargetsAndroid)' == 'true'">

0 commit comments

Comments
 (0)