Skip to content

Commit 11843c0

Browse files
committed
Address feedback
1 parent bca69ae commit 11843c0

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

eng/native/configureplatform.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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)
495495
endif()
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()
497504
string(TOLOWER "${CMAKE_BUILD_TYPE}" LOWERCASE_CMAKE_BUILD_TYPE)
498505
if(LOWERCASE_CMAKE_BUILD_TYPE STREQUAL debug)
499506
# Clear _FORTIFY_SOURCE=2, if set

src/mono/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,12 +503,10 @@ else()
503503
message(FATAL_ERROR "TARGET_ARCH='${TARGET_ARCH}' not supported.")
504504
endif()
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)
512510
endif()
513511

514512
# arm64 MacCatalyst runtime host or AOT target is more like Apple mobile targets than x64

src/native/libs/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)