[Buildroot] [PATCH] package/gcc/gcc-final: map debug prefix when reproducible

Yann E. MORIN yann.morin.1998 at free.fr
Tue Feb 7 13:55:03 UTC 2023


John, All,

On 2023-02-06 16:26 +0000, John Keeping spake thusly:
> When building with BR2_REPRODUCIBLE the toolchain wrapper passes
> -fdebug-prefix-map for all packages that are built.  But this doesn't
> affect the target libraries (like libgcc) built by GCC's build system.
> 
> GCC 4.3 added a configure option to set the debug prefix map for these
> libraries, which is used here to avoid encoding potentially
> non-reproducible build paths into the debug data.

Thanks, this is indeed very interesting. We (briefly) discussed this at
the developers day minutes ago, and the question that was brought up
was: why is not needed for the first-stage compiler?

Indeed, the first-stage compiler builds objects files that are then used
by the C library, we would expect the debug symbols for those to also
need prefix mapping.

Could you look into that, and either pass the option to both the initial
and final gcc if needed, or explain in the commit log why it is not
needed for the initial gcc, please?

In the meantime, I've marked this patch as changes-requested in
patchwork.

Regards,
Yann E. MORIN.

> Signed-off-by: John Keeping <john at metanate.com>
> ---
>  package/gcc/gcc-final/gcc-final.mk | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
> index aa883beb7b..5f222a324c 100644
> --- a/package/gcc/gcc-final/gcc-final.mk
> +++ b/package/gcc/gcc-final/gcc-final.mk
> @@ -108,6 +108,10 @@ else
>  HOST_GCC_FINAL_CONF_OPTS += --disable-libgomp
>  endif
>  
> +ifeq ($(BR2_REPRODUCIBLE),y)
> +HOST_GCC_FINAL_CONF_OPTS += --with-debug-prefix-map=$(BASE_DIR)=buildroot
> +endif
> +
>  # End with user-provided options, so that they can override previously
>  # defined options.
>  HOST_GCC_FINAL_CONF_OPTS += \
> -- 
> 2.39.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list