From a1295ac7c0effa15ecadbb5c9f510645ea7d5175 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 9 Nov 2023 00:01:25 +0000 Subject: [PATCH] Bug 1863441 - Don't filter out flags for debug info when building relrhack injected code. r=firefox-build-system-reviewers,sergesanspaille When the injected code is used by elfhack, the debug info is thrown away because elfhack doesn't know what to do with it, but in the case of relrhack, the normal linker can handle it, so there's no reason not to include the debug info anymore. Differential Revision: https://phabricator.services.mozilla.com/D192904 --- build/unix/elfhack/inject/moz.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/unix/elfhack/inject/moz.build b/build/unix/elfhack/inject/moz.build index 8f1b9e2c2343..6e97b6b1c43d 100644 --- a/build/unix/elfhack/inject/moz.build +++ b/build/unix/elfhack/inject/moz.build @@ -35,7 +35,10 @@ for v in ("OS_CPPFLAGS", "OS_CFLAGS", "DEBUG", "CLANG_PLUGIN", "OPTIMIZE", "FRAM for flag in COMPILE_FLAGS[v]: if flag == "-isystem": flags.append("".join(COMPILE_FLAGS[v][idx : idx + 2])) - elif flag.startswith(("-m", "-I", "-isystem", "--sysroot=")) or flag == "-fPIC": + elif ( + flag.startswith(("-g", "-m", "-I", "-isystem", "--sysroot=")) + or flag == "-fPIC" + ): flags.append(flag) idx += 1 COMPILE_FLAGS[v] = flags