From patchwork Wed Apr 15 22:00:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1271431 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=rockwellcollins.com Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 492brt3HSTz9s71 for ; Thu, 16 Apr 2020 08:00:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EF6178749A; Wed, 15 Apr 2020 22:00:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VQ9B6NkSbNzO; Wed, 15 Apr 2020 22:00:44 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5390F87CDD; Wed, 15 Apr 2020 22:00:44 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 20A431BF4D5 for ; Wed, 15 Apr 2020 22:00:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1D30C2206E for ; Wed, 15 Apr 2020 22:00:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jW93wFqdnPDW for ; Wed, 15 Apr 2020 22:00:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs04.rockwellcollins.com (da1vs04.rockwellcollins.com [205.175.227.52]) by silver.osuosl.org (Postfix) with ESMTPS id 15BA22207F for ; Wed, 15 Apr 2020 22:00:40 +0000 (UTC) IronPort-SDR: yTj5tpfbeb1m10CQVMlrk39xjpvnH2MsXd2SpZedkjk6ZCCP/i+DUWt0/9sC+/yxKl5KeHQH6M nueSJZ96gq55Wot9cF6yG/OLrXkWnAU14Aj5ntzgjl1xHmDq6BWfm2VxD36hBQWOPRj1z6xmp5 T0w13kDwWj03bFEyJqOfVQSF1VX8BI/EkPkaPt70giF0rpC3x0R12RstLIh25rPafvlXg8BlUd Go7WvjuKJCPGmaRMqSHfIVn5rHEjZWLVMP+CMSK+cPRORjJ2C4QfV9nApGLtfSSrQpUM9MIPSN X3w= Received: from ofwda1n02.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.227.14]) by da1vs04.rockwellcollins.com with ESMTP; 15 Apr 2020 17:00:40 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by dtulimr01.rockwellcollins.com (Postfix) with ESMTP id C6F0A603CA; Wed, 15 Apr 2020 17:00:39 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Wed, 15 Apr 2020 17:00:31 -0500 Message-Id: <20200415220032.140083-1-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] toolchain/toolchain-wrapper: Handle debug info paths in gcc7 or below for reproducibility X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: matthew.weber@rockwellcollins.com, Brandon Maier , Thomas De Schampheleire , Thomas Petazzoni , Romain Naour Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In GCC8 the flag -ffile-prefix-map handles cleaning up both the __FILE__ macros and the debug info paths. In GCC7 or below we are manually handling the __FILE__ macros, but not debug info paths. Use -fdebug-prefix-map to clean them up. See for more detail: https://reproducible-builds.org/docs/build-path/ Signed-off-by: Brandon Maier --- toolchain/toolchain-wrapper.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 09dda17890..7d55050135 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -26,6 +26,7 @@ TOOLCHAIN_WRAPPER_OPTS += -Wl,--build-id=none ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y) TOOLCHAIN_WRAPPER_OPTS += -ffile-prefix-map=$(BASE_DIR)=buildroot else +TOOLCHAIN_WRAPPER_OPTS += -fdebug-prefix-map=$(BASE_DIR)=buildroot TOOLCHAIN_WRAPPER_OPTS += -D__FILE__=\"\" -D__BASE_FILE__=\"\" -Wno-builtin-macro-redefined endif endif