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 B268CC00140 for ; Thu, 18 Aug 2022 17:32:11 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E06C84917; Thu, 18 Aug 2022 19:32:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.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; secure) header.d=debian.org header.i=@debian.org header.b="GuaijwVw"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 129DB84968; Thu, 18 Aug 2022 19:32:08 +0200 (CEST) Received: from cascadia.aikidev.net (cascadia.aikidev.net [173.255.214.101]) by phobos.denx.de (Postfix) with ESMTP id D419384879 for ; Thu, 18 Aug 2022 19:32:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=vagrant@aikidev.net 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 D7DF61AB77; Thu, 18 Aug 2022 10:32:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=debian.org; s=1.vagrant.user; t=1660843920; bh=JGUdH62wdBR5uLZpSWQheQoCJJ2bL6hLHfCAU154pbI=; h=From:To:Cc:Subject:Date:From; b=GuaijwVwV1Hl4Qy1vBbKqgwKK6r3pnZ/lPwRAm69/t+bpy0ciEaiGOK0b2I9SrU+F QptdBZoMA2sdfbKOLQcjdUx26Yem6EQ1Dy0QgpZC5a1N5XIbN1ZidqmCoD+9Skd3IH MmbvRhmLKhjgeJqqtoQ0e5s9DYP5Y9bL7yYbwD9K3QdyG1Vs1rblZyP8LXoMYiTvNq YQyAWIWL4fsVK9coMzeuwzzMJ/ScWIMgNACyBmFTq7NkDylIKNiFT3Hvge1jJR+5yY o8TWYDM8OeqVKsU18VaeJfyXcZYYGRj8YxhlIGON5hqYBTZ9kYcDRsGj4XBQoPBSLW lMMwkzpK3D1bg== From: Vagrant Cascadian To: u-boot@lists.denx.de Cc: Vagrant Cascadian , Heinrich Schuchardt , Simon Glass Subject: [PATCH] Makefile: Use relative paths for debugging symbols. Date: Thu, 18 Aug 2022 10:31:34 -0700 Message-Id: <20220818173133.12552-1-vagrant@debian.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1a66f69a4b..b40b9b2444 100644 --- a/Makefile +++ b/Makefile @@ -751,14 +751,18 @@ KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) # Enabled with W=2, disabled by default as noisy KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized) -# change __FILE__ to the relative path from the srctree -KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) +# change __FILE__ and debugging symbols to the relative path from the +# srctree +KBUILD_CFLAGS += $(call cc-option,-ffile-prefix-map=$(srctree)/=) KBUILD_CFLAGS += -g # $(KBUILD_AFLAGS) sets -g, which causes gcc to pass a suitable -g # option to the assembler. KBUILD_AFLAGS += -g +# Use relative paths in debugging symbols +KBUILD_AFLAGS += --debug-prefix-map=$(srctree)/= + # Report stack usage if supported # ARC tools based on GCC 7.1 has an issue with stack usage # with naked functions, see commit message for more details -- 2.35.1