U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
	Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH] Makefile: Use relative paths for debugging symbols.
Date: Sun, 28 Aug 2022 11:01:35 -0700	[thread overview]
Message-ID: <87h71wjlhc.fsf@contorta> (raw)
In-Reply-To: <98ebd28a-58c3-1875-b320-1f9c86f04e14@prevas.dk>

[-- Attachment #1: Type: text/plain, Size: 1808 bytes --]

On 2022-08-28, Rasmus Villemoes wrote:
> On 26/08/2022 22.59, Tom Rini wrote:
>> On Thu, Aug 18, 2022 at 10:31:34AM -0700, Vagrant Cascadian wrote:
>> 
>>> From: Vagrant Cascadian <vagrant@reproducible-builds.org>
>>>
>>> The KBUILD_CFLAGS and KBUILD_AFLAGS variables are adjusted to use
>>> -ffile-prefix-map and --debug-prefix-map, respectively, to use
>>> relative paths for occurrences of __FILE__ and debug paths.
>>>
>>> This enables reproducible builds regardless of the absolute path to
>>> the build directory:
>>>
>>>   https://reproducible-builds.org/docs/build-path/
>>>
>>> Signed-off-by: Vagrant Cascadian <vagrant@reproducible-builds.org>
>>> Acked-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
>> 
>> This needs some sort of clang check and then perhaps different flag
>> used? How does the linux kernel handle this?
>
> Well, interestingly it seems that the kernel doesn't do anything like
> this for debug info, they only apply the -fmacro-prefix-map. Which one
> should probably raise with them at some point.
>
> It seems we're not actually calling gas directly, but always invokes
> $(CC) whatever that may be to compile assembler files. So I think the
> right fix is to simply pass the same -ffile-prefix-map in both
> KBUILD_CFLAGS as in KBUILD_AFLAGS - and if there's some variable that
> ends up being included in both automatically, then just adding it there
> should do the trick.

I tried just adding -ffile-prefix-map and that helped, but was not
sufficient to solve the reproducibility issues. It also needs the
--debug-prefix-map to make it the assembly code build reproducibly.

Though I guess I didn't try adding -ffile-prefix-map to KBUILD_AFLAGS,
now that I think about it... will test that too, thanks!


live well,
  vagrant

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2022-08-28 18:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18 17:31 [PATCH] Makefile: Use relative paths for debugging symbols Vagrant Cascadian
2022-08-19  9:54 ` Rasmus Villemoes
2022-08-26 20:59 ` Tom Rini
2022-08-28 12:24   ` Rasmus Villemoes
2022-08-28 18:01     ` Vagrant Cascadian [this message]
2022-08-28 21:46       ` Vagrant Cascadian
2022-08-29  7:15         ` Rasmus Villemoes
2022-08-29  7:55           ` Rasmus Villemoes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h71wjlhc.fsf@contorta \
    --to=vagrant@reproducible-builds.org \
    --cc=rasmus.villemoes@prevas.dk \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox