From nobody Thu Aug 15 06:38:40 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 4WkwSJ1rHYz5T31f; Thu, 15 Aug 2024 06:38:40 +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 4WkwSJ1DWlz4SyB; Thu, 15 Aug 2024 06:38:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723703920; 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=ov5ztVuQvBZq27Jw3eRlaVZ10kjTASI5+eC1N8tFZwI=; b=YhlFooZVcijQnJWruDksmLdflW2age2LQSMYLSuXTdB5SgwZbbzifrg2XR8tTB1iT/K/62 wvOentQO8nxUiPTTYx8wJytrDkN6sm32gnl7zuv2zoiVOLf7Fl9DMWXKoFve6BPxxdSsYb FFgSAX/06iwUEkDKHgDCYvorLbl30HA9te6ee5ZveP11dyTAayNoTZjhq3XLUUFTl0IvmK aXk6sZL+P9vFSD8y02Wu8mE3AomrwDu+d334X2/djTUqqfBJYMZDE5qFm1EuVetPIxeGCY dDW0vKfsXcYlFfTFDGGkUgvaGgLktPbHkoPQAr1P1ie8TIcfk7ugvaddOol3LQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723703920; a=rsa-sha256; cv=none; b=lwhk7Mfqj7pawgyr7WfLmvbYxThtAj6BWnpr3XWIkcW6EGKtjdcfhfLHUApa01RxT7IEI6 Isl2lzMsSJ8ExaO51EJYgU7wcZFTndoiVtR57ptAalAnkudNay4MIRcjfKtYMRFhrI4biT npTHItkyAWklkZym29Gz8lgtSs5vSs2tnD93Yqn3HIfgEuUyIiUUJ+2c3M9pW5FCNqbjMR p5d4CmImkrN26nfYEPaQHr3UjaVXUakFujK0iiuWlOafqKZpCnCnZS3BL7B+5L6guhy59L jES/G92tj4ap3sJ5CBAbBOZncUgnv+OFplaLax4SUgkC38GerKdnHW+cZU6ACw== 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=1723703920; 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=ov5ztVuQvBZq27Jw3eRlaVZ10kjTASI5+eC1N8tFZwI=; b=a9pRzztx/U9ZGEmynMZUug5XVXOiJCnSSq9iCy/jXlVjZ1G+yw1H5oNaWmff3g+s3Dfd9U k8QFP1wDVYMSW4wk81Zn4zKyvjLx08gKZfibS8moJEpPWFLdHPFJBi/ai4SghPW+yvtbyh sfG7gvRYRvXUObV42wOtt//C9M+P8759MW3fcpMg2un7bKS851jqvdgjbyxvE4OBn2X+k8 Lv2S5j+TmIeiLKDZ6NR8+4VamPlo5D/oFoDAUjBdeQ4T2SvoXwcEH8zhH232OhNlSfzkSP jzbT+qLCkWr+HEItd0p2xSxEyIvJHimQfNmbpJiRuVxiCVngroJT/Cq71SOrdQ== 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 4WkwSJ0qVqz1QwH; Thu, 15 Aug 2024 06:38:40 +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 47F6cejk014614; Thu, 15 Aug 2024 06:38:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47F6ce9u014611; Thu, 15 Aug 2024 06:38:40 GMT (envelope-from git) Date: Thu, 15 Aug 2024 06:38:40 GMT Message-Id: <202408150638.47F6ce9u014611@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: 8a4fd438ef6c - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 8a4fd438ef6c874110b9ed320d3cd54e2bf93459 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8a4fd438ef6c874110b9ed320d3cd54e2bf93459 commit 8a4fd438ef6c874110b9ed320d3cd54e2bf93459 Author: Dimitry Andric AuthorDate: 2024-08-11 19:48:27 +0000 Commit: Dimitry Andric CommitDate: 2024-08-15 06:33:40 +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 ec2a147bd69f..c5503da655f9 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}