From patchwork Sat Aug 31 18:01:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atharva Lele X-Patchwork-Id: 1156194 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) 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=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Wst7h7WG"; dkim-atps=neutral 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 46LPL75hgrz9s5b for ; Sun, 1 Sep 2019 04:01:33 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E6CF2203D2; Sat, 31 Aug 2019 18:01:29 +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 UkzgP41Xai+z; Sat, 31 Aug 2019 18:01:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id B42CF20363; Sat, 31 Aug 2019 18:01:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 7A9081BF2AE for ; Sat, 31 Aug 2019 18:01:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 77AE185930 for ; Sat, 31 Aug 2019 18:01:26 +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 5ygj9P8GaTAA for ; Sat, 31 Aug 2019 18:01:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by hemlock.osuosl.org (Postfix) with ESMTPS id F31C082F21 for ; Sat, 31 Aug 2019 18:01:24 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id h195so26352pfe.5 for ; Sat, 31 Aug 2019 11:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ob8r5rPx7VitHM8eIOLoq+CAISIdb/SgNf/I9K0a73Y=; b=Wst7h7WG3AyP6twpnmbXrYWPvKNYcQDYQnxT57ctFvkR5BnWBkDc9ezH2YbwindtDq G29C76pqhYd/8VlfuJobKaNsklSEeos4rb4CP+NKEsYQrbbKanEvA2rk5DuuSBkBoIwU DkNqvPofXIzfMlXlE2hmoQU1tnTwUfFtW58pxXuW7LJ4MOv6vRa12xDU10ECCLRlqBSd +I9ZSmhEf8fWuQMU8mf7SghOxj+g6Flu4om8XukLDyjSFgXQASw4tRyhqfJYravBmYDR rYVMpMcT1H/PiY4KhlxKic/PL6eSGkhQRcZsnz1KBG8DPH4w6DhX++PBnN2Kurs6e40j /msg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ob8r5rPx7VitHM8eIOLoq+CAISIdb/SgNf/I9K0a73Y=; b=s2nJco4mynAtpKxw0ijV6Hjk8e2sx8nixgWW00Z9pRaYPKvqdwdr5lnRLkDq3qrNvI 7UoA/ySrhRr3KPp3MvY5Hs0HZ4kn1NeWjo0+kui3enzpEalvDY92KNPqSKspwqOeAMia 4IlcbfEkc6bgSGRkoil9TKkVlMKmaocgfb1PYf9KLi6oPjcEgJ6RG3rbE00fyIcCephp MzHL+zZadcX7TyFXXbPsniILCPZ4ZX4RFhG4ZfXvmrhVepJXeyh5RkaJsCOeRT/mCBGc f3qPd8VAtY0h4PL03ioTIDhZKhBECh4FzyJtG3H0MXrQ3fRilsiKStP9agFoe7rkafrX xwDQ== X-Gm-Message-State: APjAAAXVFSFFCY182SBarYkz8ki39nw6L83R2ddsNn+JGBD8J68SNHMG +zZWZy3N25YLeXOKATIxlKbNp9ZYCdA= X-Google-Smtp-Source: APXvYqx7eibMVCVQ4jwCt9h7CUaJGxxQ20eusg0wsbVNz5Id10kSbxLjrdNtbD3YErr4LY3919OA7g== X-Received: by 2002:a17:90a:f0c6:: with SMTP id fa6mr5010617pjb.131.1567274483582; Sat, 31 Aug 2019 11:01:23 -0700 (PDT) Received: from localhost.localdomain ([123.201.54.230]) by smtp.gmail.com with ESMTPSA id a23sm10672912pfo.80.2019.08.31.11.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2019 11:01:22 -0700 (PDT) From: Atharva Lele To: buildroot@buildroot.org Date: Sat, 31 Aug 2019 23:31:12 +0530 Message-Id: <20190831180113.16025-1-itsatharva@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 1/2] toolchain/toolchain-wrapper: explicitly set Build ID to none if BR2_REPRODUCIBLE 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: Atharva Lele , Thomas De Schampheleire , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Build ID is added to binaries at link time. Building in different output directories causes some packages to have different Build IDs, thus resulting in non-reproducibility. Adding "-Wl,--build-id=none" fixes this issue by disabling setting of Build ID. Diffoscope output for Build ID issue: https://gitlab.com/snippets/1886180/raw After this patch, build is reproducible - i.e. diffoscope does not produce any output. Signed-off-by: Atharva Lele Reviewed-by: Romain Naour --- Changes v1 -> v2: - Handle inside toolchain-wrapper.mk instead of both .mk and .c --- toolchain/toolchain-wrapper.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index 970bde76a0..88695a5b2d 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -21,6 +21,10 @@ TOOLCHAIN_WRAPPER_OPTS = \ $(call qstrip,$(BR2_SSP_OPTION)) \ $(call qstrip,$(BR2_TARGET_OPTIMIZATION)) +ifeq ($(BR2_REPRODUCIBLE),y) +TOOLCHAIN_WRAPPER_OPTS += -Wl,--build-id=none +endif + # We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a # separate argument when used in execv() by the toolchain wrapper. TOOLCHAIN_WRAPPER_ARGS += \