From c0d79c93ccca0318cb38d3c48d11f2144730841f Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Wed, 19 Jan 2022 16:37:25 +0100 Subject: [PATCH] boot: Use -ffile-prefix-map when present This should make sure the stub elf binary is reproducible. Fixes: #22157 (cherry picked from commit 1bc8417cfeeebb48b16039f26e0c75937784e75e) --- src/boot/efi/meson.build | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build index ea4f024a17..da64205bb5 100644 --- a/src/boot/efi/meson.build +++ b/src/boot/efi/meson.build @@ -209,7 +209,17 @@ if get_option('b_lto') endif foreach arg : get_option('c_args') - if arg in ['-Werror', '-g', '-ggdb', '-O1', '-O2', '-O3', '-Og', '-Os', '-DNDEBUG', '-flto', '-fno-lto'] + if arg in [ + '-DNDEBUG', + '-fno-lto', + '-g', '-ggdb', + '-O1', '-O2', '-O3', '-Og', '-Os', + '-Werror', + ] or arg.split('=')[0] in [ + '-ffile-prefix-map', + '-flto', + ] + message('Using "@0@" from c_args for EFI compiler'.format(arg)) efi_cflags += arg endif -- 2.25.1