From nobody Mon Aug 12 13:32:15 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 4WjFmv3wFjz5Scs4; Mon, 12 Aug 2024 13:32:15 +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 4WjFmv2X0yz4bl5; Mon, 12 Aug 2024 13:32:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723469535; 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=chc4fn8pD1IEujb7T/gVZ7lebMIlzClVCyXR5DSUAHI=; b=DV6b+n7u3uTjTQR1n69FLiXxPBV8Cb35h4X62uKtQXwzUjDNwwbOOAxPG9sT1lMPd1b9ol EzNTYI5pbkzCgwt0Sleur02cZFJhtP5tYKTYOgYiavQogpWluBjO/Y1cqLjO5KChjipNYl h39JXBCdpmdTTEcuYGU3LoBqmiGWJoypCjM5bxo3oiVXBpd+vRjZ18I935E+hm2gBfyvpJ 1IGMZOQ2Bun0NiG0nHx03DtKu/jfZwVSsUsLPLcaum2Z1crNxHrZhZUk6ADb2q9GKKec1P CwSZYZsLotnP750I0oZjHvNEj94Atylg04SRwI3QGHuB2lvTy0YiGMSRs1mMNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723469535; a=rsa-sha256; cv=none; b=e0ItqkSM8z7jPKF4UaVeYDSZm7LLwtxznz8fLsl84RrgyhdoGJpAwUEujTjY+imuTI5nKc AZU8Us1x1uoFZUE+2xilHzjRidKx5lpGY9H7+8XC4MN66SfSPhOPYFyW8Y/S6GHBs4Qhea 58Ma5Lp+od4doUnG735UMZho/WAjbL9rbFQjFyNAJcS8qqXjavcexSsiUPDnaUyM3ouyMV 7uCgDgQrRs3QeQUh8Dpzx0UdlLQFcflm3ZTCFhQn8tcr/aLgy+wNbRFeBalrbrTalFKKIG /837dh0ncWxFSLqJm62dnLsmOsZqUB+Y4/skldCXsSzCJ7ZTwa9f0j1cvItsHw== 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=1723469535; 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=chc4fn8pD1IEujb7T/gVZ7lebMIlzClVCyXR5DSUAHI=; b=Y+QgO/4BaFhg6cNlO4dbCOo6+Ga6UhDQJ4iblZBeNQKmARi9dQINOTOcEbFOl49pumJY6p PJk7nCudYq55Zo+29CWoBEsRKJxyIahPAtqp02EL8nIWscnOUMoa10/eraM035AtD9IF3Z gfte2gPevS/a8YmYN+Vm+ENqIHwahd8oebfZttHeBwkWTA41yl96iXjTblRZ503Uqwcgku dpcEK8JbCpP6pSctbOp6dS4PiY6wUh7uOqolXcMBdscNCkY/MdH7dsdtGc/r+jH7QOsNg2 ON2AcRx9VuL6bpJvlHA+NVG8XofdABjK8saCxFcuWxxDJAoBRhMJVgUSNDG0wA== 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 4WjFmv27lzzTm1; Mon, 12 Aug 2024 13:32:15 +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 47CDWFqp007154; Mon, 12 Aug 2024 13:32:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47CDWFWU007151; Mon, 12 Aug 2024 13:32:15 GMT (envelope-from git) Date: Mon, 12 Aug 2024 13:32:15 GMT Message-Id: <202408121332.47CDWFWU007151@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: f5ce3f4ef562 - main - 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/main X-Git-Reftype: branch X-Git-Commit: f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 commit f5ce3f4ef562ea9fc4d8f9c13c268f48a5bacba7 Author: Dimitry Andric AuthorDate: 2024-08-11 19:48:27 +0000 Commit: Dimitry Andric CommitDate: 2024-08-12 13:31:02 +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 --- stand/efi/loader/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile index 057cb15fb7ff..8f6802831824 100644 --- a/stand/efi/loader/Makefile +++ b/stand/efi/loader/Makefile @@ -105,6 +105,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}