[PATCH 1/3] ltmain.in: Handle prefix-map compiler options correctly

2024-01-16 Thread Richard Purdie
If lto is enabled, we need the prefix-map variables to be passed to the linker
to correctly link the objects using correctly mapped paths.

Add these to the list of options libtool passes through.

* build-aux/ltmain.in: Handle prefix-map compiler options
---
 build-aux/ltmain.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index d5157a8d..34784c8c 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -7,7 +7,6 @@
 # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
 # GNU Libtool is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -5413,12 +5412,14 @@ func_mode_link ()
   # -shared-libsan   Link with shared sanitizer runtimes (Clang)
   # -static-libsan   Link with static sanitizer runtimes (Clang)
   # -fuse-ld=*   Linker select flags for GCC
+  # -f{file|debug|macro}-prefix-map* needed for lto linking
   # -Wa,*Pass flags directly to the assembler
   # -Werror, -Werror=*   Report (specified) warnings as errors
   -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
   
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
   
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
   -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+  -ffile-prefix-map*|-fdebug-prefix-map*|-fmacro-prefix-map*| \
   -fdiagnostics-color*|-frecord-gcc-switches| \
   -fuse-ld=*|-Wa,*|-Werror|-Werror=*)
 func_quote_arg pretty "$arg"
-- 
2.39.2




[PATCH 1/3] ltmain.in: Handle prefix-map compiler options correctly

2024-01-17 Thread Richard Purdie
If lto is enabled, we need the prefix-map variables to be passed to the linker
to correctly link the objects using correctly mapped paths.

Add these to the list of options libtool passes through.

* build-aux/ltmain.in: Handle prefix-map compiler options
---
 build-aux/ltmain.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 830b3982..5b59d959 100644
--- a/build-aux/ltmain.in
+++ b/build-aux/ltmain.in
@@ -5413,12 +5413,14 @@ func_mode_link ()
   # -shared-libsan   Link with shared sanitizer runtimes (Clang)
   # -static-libsan   Link with static sanitizer runtimes (Clang)
   # -fuse-ld=*   Linker select flags for GCC
+  # -f{file|debug|macro|profile}-prefix-map* needed for lto linking
   # -Wa,*Pass flags directly to the assembler
   # -Werror, -Werror=*   Report (specified) warnings as errors
   -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
   
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
   
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
   -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \
+  
-ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*|
 \
   -fdiagnostics-color*|-frecord-gcc-switches| \
   -fuse-ld=*|-Wa,*|-Werror|-Werror=*)
 func_quote_arg pretty "$arg"
-- 
2.39.2




Re: [PATCH 1/3] ltmain.in: Handle prefix-map compiler options correctly

2024-01-16 Thread Mike Frysinger
On 16 Jan 2024 15:14, Richard Purdie wrote:
> --- a/build-aux/ltmain.in
> +++ b/build-aux/ltmain.in
> @@ -7,7 +7,6 @@
>  # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
>  # This is free software; see the source for copying conditions.  There is NO
>  # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> -
>  # GNU Libtool is free software; you can redistribute it and/or modify
>  # it under the terms of the GNU General Public License as published by
>  # the Free Software Foundation; either version 2 of the License, or

let's leave unrelated changes out please

> @@ -5413,12 +5412,14 @@ func_mode_link ()
># -shared-libsan   Link with shared sanitizer runtimes (Clang)
># -static-libsan   Link with static sanitizer runtimes (Clang)
># -fuse-ld=*   Linker select flags for GCC
> +  # -f{file|debug|macro}-prefix-map* needed for lto linking

these take the form of -ffile-prefix-map=xxx right ?
so we'd want to put a = before the glob at the end ?
-mike


signature.asc
Description: PGP signature


Re: [PATCH 1/3] ltmain.in: Handle prefix-map compiler options correctly

2024-01-17 Thread Richard Purdie
On Tue, 2024-01-16 at 20:47 -0500, Mike Frysinger wrote:
> On 16 Jan 2024 15:14, Richard Purdie wrote:
> > --- a/build-aux/ltmain.in
> > +++ b/build-aux/ltmain.in
> > @@ -7,7 +7,6 @@
> >  # Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc.
> >  # This is free software; see the source for copying conditions.  There is 
> > NO
> >  # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
> > PURPOSE.
> > -
> >  # GNU Libtool is free software; you can redistribute it and/or modify
> >  # it under the terms of the GNU General Public License as published by
> >  # the Free Software Foundation; either version 2 of the License, or
> 
> let's leave unrelated changes out please

Sorry.

> 
> > @@ -5413,12 +5412,14 @@ func_mode_link ()
> ># -shared-libsan   Link with shared sanitizer runtimes (Clang)
> ># -static-libsan   Link with static sanitizer runtimes (Clang)
> ># -fuse-ld=*   Linker select flags for GCC
> > +  # -f{file|debug|macro}-prefix-map* needed for lto linking
> 
> these take the form of -ffile-prefix-map=xxx right ?

Yes. There was talk of a 'read from file' version but that doesn't look
like it was merged anywhere.

> so we'd want to put a = before the glob at the end ?

Sure. I'll also add profile-prefix-map for completeness since it looks
like the naming debate was settled on that one and it was merged (I
personally don't need it).

Cheers,

Richard



Re: [PATCH 1/3] ltmain.in: Handle prefix-map compiler options correctly

2024-01-17 Thread Mike Frysinger
On 17 Jan 2024 12:39, Richard Purdie wrote:
> If lto is enabled, we need the prefix-map variables to be passed to the linker
> to correctly link the objects using correctly mapped paths.
> 
> Add these to the list of options libtool passes through.

merged, thanks
-mike


signature.asc
Description: PGP signature