diff options
author | Jan Janssen <medhefgo@web.de> | 2023-10-01 09:55:48 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-10-01 12:49:51 +0200 |
commit | a8b53f4f1558b17169809effd865232580e4c4af (patch) | |
tree | a059790574ac2be737d35793db079fc79792106d /src/boot/efi/meson.build | |
parent | Merge pull request #29384 from yuwata/sd-journal-cleanups-for-generic-array-get (diff) | |
download | systemd-a8b53f4f1558b17169809effd865232580e4c4af.tar.xz systemd-a8b53f4f1558b17169809effd865232580e4c4af.zip |
meson: Pass all -static-pie args to linker
Fixes: #29381
Diffstat (limited to '')
-rw-r--r-- | src/boot/efi/meson.build | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index d168d2d553..d5c1025804 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -153,9 +153,14 @@ efi_c_ld_args = [ '-Wl,--entry=efi_main', '-Wl,--fatal-warnings', - # These flags should be passed by -static-pie, but seem to be missing sometimes. - '-Wl,--no-dynamic-linker', - '-z', 'text', + # These flags should be passed by -static-pie, but for whatever reason the flag translation + # is not enabled on all architectures. Not passing `-static` would just allow the linker to + # use dynamic libraries, (which we can't/don't use anyway). But if `-pie` is missing and the + # gcc build does not default to `-pie` we get a regular (no-pie) binary that will be + # rightfully rejected by elf2efi. Note that meson also passes `-pie` to the linker driver, + # but it is overridden by our `-static-pie`. We also need to pass these directly to the + # linker as `-static`+`-pie` seem to get translated differently. + '-Wl,-static,-pie,--no-dynamic-linker,-z,text', # EFI has 4KiB pages. '-z', 'common-page-size=4096', |