Skip to content

Commit

Permalink
build: clean up some android things
Browse files Browse the repository at this point in the history
  • Loading branch information
Chilledheart committed Oct 31, 2024
1 parent 0662bc4 commit 48fddd2
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,14 @@ if (NOT MSVC)
# see ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES for ndk >= 27
if (ANDROID)
add_definitions(-D__BIONIC_NO_PAGE_SIZE_MACRO)

# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
if(ANDROID_ABI STREQUAL arm64-v8a OR ANDROID_ABI STREQUAL x86_64)
add_link_options(-Wl,-z,max-page-size=16384)
else()
add_link_options(-Wl,-z,max-page-size=4096)
endif()
endif()

Expand Down Expand Up @@ -1498,15 +1504,6 @@ endif()

# Linux-specific compiler flags setup.
# ------------------------------------
if ((UNIX AND NOT APPLE) AND USE_LLD)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID)
# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
add_link_options(-Wl,-z,max-page-size=4096)
endif()
endif()

if (USE_ICF AND (NOT APPLE OR COMPILER_CLANG) AND NOT MSVC)
# Gold doesn't respect section alignment and breaks gcc builds with icf
# https://sourceware.org/bugzilla/show_bug.cgi?id=17704
Expand Down Expand Up @@ -1875,13 +1872,6 @@ if (ANDROID)
# http://crbug.com/448386
add_link_options(-Wl,--exclude-libs=libvpx_assembly_arm.a)

# Reduce the page size from 65536 in order to reduce binary size slightly
# by shrinking the alignment gap between segments. This also causes all
# segments to be mapped adjacently, which breakpad relies on.
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm64.*" AND NOT ANDROID)
add_link_options(-Wl,-z,max-page-size=4096)
endif()

# Instead of using an unwind lib from the toolchain,
# buildtools/third_party/libunwind will be built and used directly.
add_link_options(--unwindlib=none)
Expand Down

0 comments on commit 48fddd2

Please sign in to comment.