From: Rasmus Villemoes Date: Wed, 2 Nov 2022 16:01:22 +0000 (-0600) Subject: gcc: honour -ffile-prefix-map in ASM_MAP [PR93371] X-Git-Tag: basepoints/gcc-14~3596 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abaa32c7384edef065c79741764bc112dd18f32d;p=thirdparty%2Fgcc.git gcc: honour -ffile-prefix-map in ASM_MAP [PR93371] -ffile-prefix-map is supposed to be a superset of -fmacro-prefix-map and -fdebug-prefix-map. However, when building .S or .s files, gas is not called with the appropriate --debug-prefix-map option when -ffile-prefix-map is used. While the user can specify -fdebug-prefix-map when building assembly files via gcc, it's more ergonomic to also support -ffile-prefix-map; especially since for .S files that could contain the __FILE__ macro, one would then also have to specify -fmacro-prefix-map. gcc: PR driver/93371 * gcc.cc (ASM_MAP): Honour -ffile-prefix-map. --- diff --git a/gcc/gcc.cc b/gcc/gcc.cc index afb23cd07b00..98a239c85312 100644 --- a/gcc/gcc.cc +++ b/gcc/gcc.cc @@ -877,7 +877,7 @@ proper position among the other output files. */ #endif #ifdef HAVE_AS_DEBUG_PREFIX_MAP -#define ASM_MAP " %{fdebug-prefix-map=*:--debug-prefix-map %*}" +#define ASM_MAP " %{ffile-prefix-map=*:--debug-prefix-map %*} %{fdebug-prefix-map=*:--debug-prefix-map %*}" #else #define ASM_MAP "" #endif