From patchwork Thu Aug 18 17:31:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vagrant Cascadian X-Patchwork-Id: 1667818 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=debian.org header.i=@debian.org header.a=rsa-sha256 header.s=1.vagrant.user header.b=GuaijwVw; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4M7sQT69jBz1ygl for ; Fri, 19 Aug 2022 03:32:17 +1000 (AEST) 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) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 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 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 Acked-by: Rasmus Villemoes --- 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