From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D6B3ECAAA2 for ; Sun, 28 Aug 2022 18:02:13 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 46D0B84540; Sun, 28 Aug 2022 20:02:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=reproducible-builds.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=reproducible-builds.org header.i=@reproducible-builds.org header.b="0514+v4n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2EC8984565; Sun, 28 Aug 2022 20:02:08 +0200 (CEST) Received: from cascadia.aikidev.net (cascadia.aikidev.net [IPv6:2600:3c01:e000:267:0:a171:de7:c]) by phobos.denx.de (Postfix) with ESMTP id 03C6B840E4 for ; Sun, 28 Aug 2022 20:02:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=reproducible-builds.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vagrant@reproducible-builds.org Received: from localhost (unknown [IPv6:2600:3c01:e000:21:7:77:0:20]) (Authenticated sender: vagrant@aikidev.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id A15C71AC55; Sun, 28 Aug 2022 11:02:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=reproducible-builds.org; s=1.vagrant; t=1661709723; bh=IC7cH0PEtq3D5Jf9EfYdL3gLVc9EOtbGqsHR/couvkg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=0514+v4nsB2h2SPWSmmwIPc0/nSfiAgZX8YgmDZqF8KsI1KjZXQylh7KfxK4F7lAZ 6A3qyrFA0OsxWv6y6kEocdQ4dDIGyn0BhgQDj1Vu250U0yEHuUOLtLXLWIqinqugbK 2iY2/u0h/3XzJGVH86pHkAYi+EQ4hTuMEBwlWLDvyXb50zU854b1Lc85fi/oV+s2CY hYXQ/a+Rjgq8/8Jnh3CMN7Y9vrWivBlAfyq3ctDpVhE/uMnDNQMPYOiuTzs75SnXxP jt9lq6yKHKDeqAlW/kSdvSoZjr3FzTDbEJWETZG0vhi1qJtSPTmLUhC8ZlH/ZKdVkN jTfRN9ItHMSng== From: Vagrant Cascadian To: Rasmus Villemoes , Tom Rini Cc: u-boot@lists.denx.de, Heinrich Schuchardt , Simon Glass Subject: Re: [PATCH] Makefile: Use relative paths for debugging symbols. In-Reply-To: <98ebd28a-58c3-1875-b320-1f9c86f04e14@prevas.dk> References: <20220818173133.12552-1-vagrant@debian.org> <20220826205900.GA3931749@bill-the-cat> <98ebd28a-58c3-1875-b320-1f9c86f04e14@prevas.dk> Date: Sun, 28 Aug 2022 11:01:35 -0700 Message-ID: <87h71wjlhc.fsf@contorta> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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: >>=20 >>> From: Vagrant Cascadian >>> >>> 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 >>> Acked-by: Rasmus Villemoes >>=20 >> 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 =2D-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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYwutgAAKCRDcUY/If5cW qtxfAP4zAulnRXoXjjgcS1d6wXzGicmjCocX0n35tLk/5+MBUAEA1NbvG5MN5xBM kv2peEbZ+myVUXjhNJyh0DfiuZFAOAA= =nSVO -----END PGP SIGNATURE----- --=-=-=--