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 D4D4DECAAA2 for ; Sun, 28 Aug 2022 21:46:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E280B84565; Sun, 28 Aug 2022 23:46:56 +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="GE5vwCHi"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0011C84540; Sun, 28 Aug 2022 23:46:54 +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 CB8CB84540 for ; Sun, 28 Aug 2022 23:46:51 +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 A16D31AC55; Sun, 28 Aug 2022 14:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=reproducible-builds.org; s=1.vagrant; t=1661723210; bh=xkyezghLsSm9487Cwfj29bqmZ1C0NcJiCAkjSw5794U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GE5vwCHi019vYvVEdPUwXKpc6uu2HJ/8FPyAVnxmUpWF3P9pzuh0vQ8TXYgddDhPN uJ+A3dw7BppIMmxwr/oOFdFZ/TNSpUTZGP5vQeLPl+cqjGnYYAGswHU08kFdCL4/9A btTQ9ePxmfqVbhifeODs65+YEMjBX05Zj5rXfa4QAF3y+D23IeN5t1+10NC0Elpkhh SE8iXYXjTX9UVTI7vaZ5IeSnL00rUyzsZli+VkYJ93ogR5+dwFJlMTxW1Q8bqsPVcW hL7JtqhUTwkhz/Tla0dnKbdwyqSYPcGkBR6ml7lQTLVc2HPqgVitLnrSVs7QfDTlF5 54hY0Cp+cnr/Q== 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: <87h71wjlhc.fsf@contorta> References: <20220818173133.12552-1-vagrant@debian.org> <20220826205900.GA3931749@bill-the-cat> <98ebd28a-58c3-1875-b320-1f9c86f04e14@prevas.dk> <87h71wjlhc.fsf@contorta> Date: Sun, 28 Aug 2022 14:46:30 -0700 Message-ID: <87edx0jb2h.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, Vagrant Cascadian wrote: > 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 >>>> >>>> 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 > --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! Nope, that built, but not reproducibly... I was able to guard it with "as-option": +KBUILD_AFLAGS +=3D $(call as-option,--debug-prefix-map=3D$(srctree)/= =3D) And it builds reproducibly for me. That should be sufficient to fix build failures with clang... or is there a more appropriate guard to use? I am not familiar with clang and it's relevent tools to know if there is a relevent comprable option to =2D-debug-prefix-map. live well, vagrant --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCYwviNgAKCRDcUY/If5cW qktRAQDyu0Y7mzD7uTRnAevVWzp6oJwFdfZghtxEKHSX1ENfSgD/TkwSX9kxL84L j0p/B+c8s0uObB+1hQl6n6/lINq5zwc= =olX4 -----END PGP SIGNATURE----- --=-=-=--