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)
494
494
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
495
495
endif ()
496
496
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 ()
497
504
string (TOLOWER "${CMAKE_BUILD_TYPE} " LOWERCASE_CMAKE_BUILD_TYPE )
498
505
if (LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug )
499
506
# Clear _FORTIFY_SOURCE=2, if set
Original file line number Diff line number Diff line change @@ -503,12 +503,10 @@ else()
503
503
message (FATAL_ERROR "TARGET_ARCH='${TARGET_ARCH} ' not supported." )
504
504
endif ()
505
505
506
- if (TARGET_ANDROID AND (TARGET_AMD64 OR TARGET_ARM64 ))
506
+ if (HOST_ANDROID AND (HOST_AMD64 OR HOST_ARM64 ))
507
507
# Google requires all the native libraries to be aligned to 16 bytes (for 16k memory page size)
508
508
# 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 )
512
510
endif ()
513
511
514
512
# 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)
58
58
if (CROSS_ROOTFS )
59
59
include_directories (SYSTEM "${CROSS_ROOTFS} /usr/include" )
60
60
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 ()
67
61
endif ()
68
62
69
63
string (TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE )
You can’t perform that action at this time.
0 commit comments