Skip to content
Snippets Groups Projects
Verified Commit 0f10f032 authored by Frederik “Freso” S. Olesen's avatar Frederik “Freso” S. Olesen
Browse files

RFC 23: Add -Wl,-z,pack-relative-relocs

> Add -Wl,-z,pack-relative-relocs to our LDFLAGS in order to
> reduce the size of relocations.

See https://rfc.archlinux.page/0023-pack-relative-relocs/
parent 71d2dd10
No related branches found
No related tags found
1 merge request!6Implement Arch Linux RFCs 17, 23, and 26
......@@ -44,7 +44,8 @@ CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions \
-Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security \
-fstack-clash-protection -fcf-protection"
CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-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
......
  • I'm getting this error when I try building xorg-server-git with this change

    xserver/meson.build:1:0: ERROR: Unable to detect linker for compiler `cc -Wl,--version -Wl,-O1, --sort-common,--as-needed,-z,relro,-z,pack-relative-relocs -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/home/anon/.cache/aurutils/sync/xorg-server-git/src=/usr/src/debug/xorg-server-git -flto=auto`
    stdout: 
    stderr: cc: error: unrecognized command-line option ‘--sort-common,--as-needed,-z,relro,-z,pack-relative-relocs’

    It does work if I edit the LDFLAGS into LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now,-z,pack-relative-relocs"

  • Ghost User @ghost

    mentioned in issue glibc#5 (closed)

    ·

    mentioned in issue glibc#5 (closed)

    Toggle commit list
  • Ghost User @ghost

    mentioned in merge request glibc!3 (closed)

    ·

    mentioned in merge request glibc!3 (closed)

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment