Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <heftig@archlinux.org>2023-09-01 23:53:03 +0200
committerLevente Polyak <anthraxx@archlinux.org>2023-12-03 20:11:24 +0100
commitc356995dc19b3dfe944920a5864f9d3ffd5f9b6f (patch)
tree0e693f18bd6ce8eb009f8e795ca3342055670809
parent1535a69af60d2ce82d66866962ecb6b131838869 (diff)
feat(config): Add -z pack-relative-relocs to LDFLAGS
This moves relative relocations from the `.rela.dyn` section into a new `.relr.dyn` section with a significantly more compact encoding, supported since glibc 2.36, GNU Binutils 2.38 and LLVM 15. This can reduce the size of libraries a lot, e.g. the installed size of `libphonenumber` dropped from about 17 MB to 7 MB. For more info, see https://gitlab.archlinux.org/archlinux/rfcs/-/merge_requests/23. Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
-rw-r--r--config/makepkg/x86_64.conf3
-rw-r--r--config/makepkg/x86_64_v3.conf3
2 files changed, 4 insertions, 2 deletions
diff --git a/config/makepkg/x86_64.conf b/config/makepkg/x86_64.conf
index 9307661..e258e07 100644
--- a/config/makepkg/x86_64.conf
+++ b/config/makepkg/x86_64.conf
@@ -44,7 +44,8 @@ CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
-LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now"
+LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
+ -Wl,-z,pack-relative-relocs"
LTOFLAGS="-flto=auto"
RUSTFLAGS=""
#-- Make Flags: change this for DistCC/SMP systems
diff --git a/config/makepkg/x86_64_v3.conf b/config/makepkg/x86_64_v3.conf
index 01e206d..3832b19 100644
--- a/config/makepkg/x86_64_v3.conf
+++ b/config/makepkg/x86_64_v3.conf
@@ -44,7 +44,8 @@ CFLAGS="-march=x86-64-v3 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
-LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now"
+LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now \
+ -Wl,-z,pack-relative-relocs"
LTOFLAGS="-flto=auto"
RUSTFLAGS=""
#-- Make Flags: change this for DistCC/SMP systems