Skip to content

Commit 860033f

Browse files
bonzinieli-schwartz
authored andcommitted
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 237513d ("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 <[email protected]> (cherry picked from commit 6cf3120)
1 parent e6e8a5e commit 860033f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/modules/gnome.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ def generate_gir(self, state: 'ModuleState', args: T.Tuple[T.List[T.Union[Execut
11681168
scan_cflags += list(self._get_scanner_cflags(self._get_external_args_for_langs(state, [lc[0] for lc in langs_compilers])))
11691169
scan_internal_ldflags = []
11701170
scan_external_ldflags = []
1171-
scan_env_ldflags = []
1171+
scan_env_ldflags = state.environment.coredata.get_external_link_args(MachineChoice.HOST, 'c')
11721172
for cli_flags, env_flags in (self._get_scanner_ldflags(internal_ldflags), self._get_scanner_ldflags(dep_internal_ldflags)):
11731173
scan_internal_ldflags += cli_flags
11741174
scan_env_ldflags += env_flags

0 commit comments

Comments
 (0)