From nobody Thu Aug 15 06:33:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WkwLn5kqPz5T2xP; Thu, 15 Aug 2024 06:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WkwLn558jz4STj; Thu, 15 Aug 2024 06:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723703633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fU1NKXW1upOFw091DB/LZpk1S7eMYRSvUfsK/2k5aDs=; b=dL4imPTearh4n/Jo0U7ELQdCYP2UY14/aeeSDpy5phy5Y+R+21SzUf+Wrf34OKNnsRciQL BOS0Ausiu5QqGgkfhO6FfwJRssUZ77nmwcxzqoRYEtZyx0q+J6JrrpxewY3J6PZ3cRJfxM A7jDI0dZXEmPFYKuTFI/2czfZsSaz2p5fMm3wbNJiHwWZFVuBAF/JRVNEN9zMrERdP96jq I7eIwt0r+v5RgKxTFUNvcx07Bc2f0Kg5yPyJImvLTX0Jwm37YncqwigwgzYNdqkkn7tDRT DBZEwRuQ48ZVwQ3QuBXLU4L3f+4QbdWI6PHaAkGR91UGVh+9cC9x0g8eD6doBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723703633; a=rsa-sha256; cv=none; b=LkjbXzbvnLpRYwqCwNuqgPfkASdJgdZ1XacmUdQmJcndOERp8AdQXOzb4/PCfixFWR/0+V Y78lXvoCaPLeHUhzXDBUSAsgCXVqcvi3FVJeiOxkx+V1slfjp+e8d/4+UiuUFJT2YGOjKO zhf22aMOl2PqJrmuvcqcUvSKWRubApPnTlaxnzyhB2zolIksze58mtinUCnR8KpjUcwxy8 Wvb/j7XtGeIK5OxTO129p1eVrGptIxbrfe76tnrN3kYOcKxGaj8NcHkYqOvyqiiPAxWrnv ohPkw0EN8eSFWjvS5+mkM0VUYTUUkqHxAZK0dLrAF8zKBahPFlBJu5lTqzd2rQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723703633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fU1NKXW1upOFw091DB/LZpk1S7eMYRSvUfsK/2k5aDs=; b=r3sdbCcxHaHBNUGYCgE9CoNnhWMfF3lo+aH1bKe556X722MQyHP51V4wQPm2Jm6uHK/X1J TrY06OCCpR4XLqt0Bv31TXHqh8xrpYQgy/Vyv2b6I2OvbIKjdTsid76lsP7nL8dvIoSc2B wEQgZrykKQpf7c9DHWqav/NF+OZaX6ksCYpWfXmeoDVwxfp5JO1KErY2pArtqfFLnYsjK3 om2nEn+Ca0GLc5dOSAK7QLc3vbD8wCEAqQ2bxwLuGHlTJqy8y321NadThrzr1rMeLurgS9 beyxw4T+SWkXo9zYOqWuOygZIz7ghDD8S8jkW61Thvj2Oa0pXPKODC4qxHNVFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WkwLn4J0wz1RHp; Thu, 15 Aug 2024 06:33:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47F6XrQw013877; Thu, 15 Aug 2024 06:33:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47F6Xr81013874; Thu, 15 Aug 2024 06:33:53 GMT (envelope-from git) Date: Thu, 15 Aug 2024 06:33:53 GMT Message-Id: <202408150633.47F6Xr81013874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 85434cac6ef2 - stable/14 - Fix EFI loader reproducibility with lld List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 85434cac6ef20d42653c966b317d5b2ae9c95973 Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=85434cac6ef20d42653c966b317d5b2ae9c95973 commit 85434cac6ef20d42653c966b317d5b2ae9c95973 Author: Dimitry Andric AuthorDate: 2024-08-11 19:48:27 +0000 Commit: Dimitry Andric CommitDate: 2024-08-15 06:33:35 +0000 Fix EFI loader reproducibility with lld When the various loaders under stand/efi are built, the resulting binaries differ over multiple runs, even if WITH_REPRODUCIBLE_BUILD is used. This is caused by lld multithreading and the custom linker scripts for the loaders, and affects the following binaries: * loader_4th.efi * loader_4th.sym * loader_4th.sym.full * loader_lua.efi * loader_lua.sym * loader_lua.sym.full * loader_simp.efi * loader_simp.sym * loader_simp.sym.full Work around this by disabling lld threading for these binaries. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46271 (cherry picked from commit f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7) --- stand/efi/loader/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index b3395bdfdf53..02563681c3e8 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -106,6 +106,11 @@ LDFLAGS+= -Wl,-T${LDSCRIPT},-Bsymbolic,-znotext -pie LDFLAGS+= -Wl,--no-dynamic-linker .endif +# When lld is using multiple threads, which it does by default, it can +# result in non-reproducible output with the custom linker script. Work +# around this by disabling threading. +LDFLAGS.lld+= -Wl,--threads=1 + CLEANFILES+= ${LOADER}.efi ${LOADER}.efi: ${PROG}