From patchwork Wed Apr 15 22:00:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1271432 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.136; helo=silver.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 silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 492brz49bmz9s71 for ; Thu, 16 Apr 2020 08:00:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 6A6AF220C5; Wed, 15 Apr 2020 22:00:49 +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 wGyUI9n4AsXq; Wed, 15 Apr 2020 22:00:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8447B220CE; Wed, 15 Apr 2020 22:00:46 +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 E8D421BF4D5 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 E3E74220C5 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 I08O8wbhG+7A for ; Wed, 15 Apr 2020 22:00:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs03.rockwellcollins.com (ch3vs03.rockwellcollins.com [205.175.226.47]) by silver.osuosl.org (Postfix) with ESMTPS id C3FAD220EC for ; Wed, 15 Apr 2020 22:00:42 +0000 (UTC) IronPort-SDR: mJrbz6NwLkcL9bC279uPFY1fJn+jeOxNWxZqvpFD6Cbs7xEuLaPh8373SwFU2V2CkhoRLc51NH 8LnNcegHY8K1u/lAh9KJWetl22s4tIsUEUA3lvqgwdNWEU8xwkWWepQCxpKAGqLj7qhsGOcYCI Q9cC54O5yVmgB6B2AcDp1C9FWyJ+tEOXQeGJ2pNFvYvuf5fzIqdWrCW6tE6DxnFyQWqM6JxDfY sFxb4WD3q4qM1a36m02AmvOFs4aXP5QoQ35sUFIWYA+3j0l4YDaGw3871zKCmssi8rc2hw71sH AVM= Received: from ofwch3n02.rockwellcollins.com (HELO dtulimr01.rockwellcollins.com) ([205.175.226.14]) by ch3vs03.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 32A8C603C5; Wed, 15 Apr 2020 17:00:40 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Wed, 15 Apr 2020 17:00:32 -0500 Message-Id: <20200415220032.140083-2-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200415220032.140083-1-brandon.maier@rockwellcollins.com> References: <20200415220032.140083-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] toolchain/toolchain-wrapper: Omit absolute paths from debug symbols 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 GCC6 the compiler was made smarter to omit the flag -fdebug-prefix-map from the DWARF DW_AT_producer section[1]. That flag contains the absolute path '$(BASE_DIR)' which breaks reproducibility. Prior to GCC6 however, the only way to omit the flag is to use -gno-record-gcc-switches which omits all flags. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=266cc0c181549c2fb6b50f8f26213cdc89101026 Signed-off-by: Brandon Maier --- toolchain/toolchain-wrapper.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 7d55050135..291366b093 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -29,6 +29,9 @@ else TOOLCHAIN_WRAPPER_OPTS += -fdebug-prefix-map=$(BASE_DIR)=buildroot TOOLCHAIN_WRAPPER_OPTS += -D__FILE__=\"\" -D__BASE_FILE__=\"\" -Wno-builtin-macro-redefined endif +ifneq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_6),y) +TOOLCHAIN_WRAPPER_OPTS += -gno-record-gcc-switches +endif endif # We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a