File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Expand file tree Collapse file tree 3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,13 @@ if(NOT CLR_CMAKE_TARGET_BROWSER AND NOT CLR_CMAKE_TARGET_WASI)
494494 set (CMAKE_POSITION_INDEPENDENT_CODE ON )
495495endif ()
496496
497+ if (CLR_CMAKE_TARGET_ANDROID)
498+ # Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size)
499+ # This applies only to 64-bit binaries
500+ if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64)
501+ add_link_options (LINKER:-z,max-page-size=16384)
502+ endif ()
503+ endif ()
497504string (TOLOWER "${CMAKE_BUILD_TYPE} " LOWERCASE_CMAKE_BUILD_TYPE)
498505if (LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
499506 # Clear _FORTIFY_SOURCE=2, if set
Original file line number Diff line number Diff line change @@ -503,12 +503,10 @@ else()
503503 message (FATAL_ERROR "TARGET_ARCH='${TARGET_ARCH} ' not supported." )
504504endif ()
505505
506- if (TARGET_ANDROID AND (TARGET_AMD64 OR TARGET_ARM64 ))
506+ if (HOST_ANDROID AND (HOST_AMD64 OR HOST_ARM64 ))
507507 # Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size)
508508 # This applies only to 64-bit binaries
509- if ((TARGET_ARCH STREQUAL "arm64" ) OR (TARGET_ARCH STREQUAL "x86_64" ))
510- add_link_options (LINKER:-z,max-page-size=16384)
511- endif ()
509+ add_link_options (LINKER:-z,max-page-size=16384)
512510endif ()
513511
514512# arm64 MacCatalyst runtime host or AOT target is more like Apple mobile targets than x64
Original file line number Diff line number Diff line change @@ -58,12 +58,6 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI)
5858 if (CROSS_ROOTFS)
5959 include_directories (SYSTEM "${CROSS_ROOTFS} /usr/include" )
6060 endif ()
61-
62- # Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size)
63- # This applies only to 64-bit binaries
64- if (CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_AMD64)
65- add_link_options (-Wl,-z,max-page-size=16384)
66- endif ()
6761 endif ()
6862
6963 string (TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
You can’t perform that action at this time.
0 commit comments