[PATCH] D77746: [Driver] Default arm-linux-androideabi to -z max-page-size=4096
Fangrui Song via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 8 12:30:26 PDT 2020
MaskRay updated this revision to Diff 256085.
MaskRay added a comment.
Clarify a comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77746/new/
https://reviews.llvm.org/D77746
Files:
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/android-aarch64-link.cpp
clang/test/Driver/android-link.cpp
Index: clang/test/Driver/android-link.cpp
===================================================================
--- clang/test/Driver/android-link.cpp
+++ clang/test/Driver/android-link.cpp
@@ -1,4 +1,7 @@
-// Check that we automatically add relevant linker flags for Android aarch64.
+// Check that we add relevant linker flags for Android ARM/AArch64.
+
+// RUN: %clang -### -target arm-linux-androideabi %s 2>&1 | \
+// RUN: FileCheck --check-prefix=MAX-PAGE-SIZE %s
// RUN: %clang -target aarch64-none-linux-android \
// RUN: -### -v %s 2> %t
@@ -19,4 +22,4 @@
// GENERIC-ARM: --fix-cortex-a53-843419
// CORTEX-A53: --fix-cortex-a53-843419
// CORTEX-A57-NOT: --fix-cortex-a53-843419
-// MAX-PAGE-SIZE: max-page-size=4096
+// MAX-PAGE-SIZE: "-z" "max-page-size=4096"
Index: clang/lib/Driver/ToolChains/Linux.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Linux.cpp
+++ clang/lib/Driver/ToolChains/Linux.cpp
@@ -253,10 +253,9 @@
ExtraOpts.push_back("relro");
}
- // The lld default page size is too large for Aarch64, which produces much
- // larger .so files and images for arm64 device targets. Use 4KB page size
- // for Android arm64 targets instead.
- if (Triple.isAArch64() && Triple.isAndroid()) {
+ // Android ARM/AArch64 use max-page-size=4096 to reduce VMA usage. Note, lld
+ // from 11 onwards default max-page-size to 65536 for both ARM and AArch64.
+ if ((Triple.isARM() || Triple.isAArch64()) && Triple.isAndroid()) {
ExtraOpts.push_back("-z");
ExtraOpts.push_back("max-page-size=4096");
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77746.256085.patch
Type: text/x-patch
Size: 1602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200408/5a4c3215/attachment.bin>
More information about the cfe-commits
mailing list