summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-05-23 16:26:44 +0200
committerEli Schwartz <eschwartz93@gmail.com>2025-05-23 13:55:13 -0400
commit6cf312022f431008d2519e347b630b4ab2ce227c (patch)
tree80d155c05786a1d65dd2c17ba3143bc60d4a151f
parentecf29efef43064e9edb54ddc1efcc3da8281cc47 (diff)
downloadmeson-6cf312022f431008d2519e347b630b4ab2ce227c.tar.gz
gnome: initialize CFLAGS environment variable to linker arguments
The CFLAGS environment variable is used for g-ir-scanner's linking pass, It is emptied since commit 237513dff ("modules/gnome, modules/Python: Allow injecting RPATH flags through LDFLAGS if needed", 2025-04-09); which could even be considered a bugfix if it didn't break Fedora quite badly. I could not write a testcase, but the culprit seems to be the -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 that Fedora places in CFLAGS. The file contains *cc1_options: + %{!r:%{!fpie:%{!fPIE:%{!fpic:%{!fPIC:%{!fno-pic:-fPIE}}}}}} and the lack of -fPIE option upsets the linker. Fix by priming the contents of the CFLAGS variable with the c_link_args being used for the build. Fixes: #14631 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--mesonbuild/modules/gnome.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 738a2f6a9..3edf07062 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -1168,7 +1168,7 @@ class GnomeModule(ExtensionModule):
scan_cflags += list(self._get_scanner_cflags(self._get_external_args_for_langs(state, [lc[0] for lc in langs_compilers])))
scan_internal_ldflags = []
scan_external_ldflags = []
- scan_env_ldflags = []
+ scan_env_ldflags = state.environment.coredata.get_external_link_args(MachineChoice.HOST, 'c')
for cli_flags, env_flags in (self._get_scanner_ldflags(internal_ldflags), self._get_scanner_ldflags(dep_internal_ldflags)):
scan_internal_ldflags += cli_flags
scan_env_ldflags += env_flags