From nobody Sat Jan 07 19:24:40 2023 X-Original-To: dev-commits-ports-main@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 4Nq9Bd0N10z2sN4H; Sat, 7 Jan 2023 19:24:41 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Nq9Bc6sFCz3kr1; Sat, 7 Jan 2023 19:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673119481; 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=uBN9UASX9SWAencqVP82u2Vy8YQfIrv7eYBVKU/M7zU=; b=ObsQTfOGM+shun2Lq5+ra4/DxbzkX7lNSYcM28/BtcaKq6sL0Pjd141XXST855VVgBDQnb naJV1sHzplAJMzIXbk0r81c3AozY8euKo1wNfHfXrpPHut/nWX9reXXVKRA6ixgwXx4xDm KxSTjKicD89HHPaFwxtT1vqUogoDFwH+sLQPPEEUrZ0e/5NE1jV5MWdPaN3/0tFF6bIz2T QjzrkFhtJfGQifkepN0mmOX0shvSR8sspSUcHLTk2pEfEOjrWNaqNKiZ5U1eeygdIjQlyA Z1pD10Kq3GV8sWdF25IJlmK862L23XydBLNG+bZd8EIGt8pVAChkenS8xSQwYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673119481; 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=uBN9UASX9SWAencqVP82u2Vy8YQfIrv7eYBVKU/M7zU=; b=FKiqaXVo68PLXIoyBMNbz5pYLYqtrfRBZsvc7AMo24wzULUztjysSl5NDy//0J+Z6W3VLL ixWwstBsToyb8nWtMl5cR/pvjV4VNApoDL3W6LIjjXOIhtL79dcOBqaejE2cO1kGlBDW8Q NgQrR1BkMVWgSAqpa8VxycKvan8Anepzs7jLXpgXWQ8GzJzoovoy6e2/+OHSzL6JaGyGMA kBJfVp/6BAG+vgficECMXk/wli71CZqnj87plrcZgvTXIKjc3RSCOhQQ9VItZJrXGqaA3h UIOvG/Kon3HXd5q5/lrGAhyPzrYo3K6ZGz4OkpsRmQydd6/4CTYAg2xJqNddWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673119481; a=rsa-sha256; cv=none; b=J5XCiqqX87CKm3HiROnxnCDdWdMNHSD0N7Ue3+JKt0G1NV0rXCXlquKoO9H0bWHLAy9+nE zjQOGa1W5pYZnFKFIvtQmRV705lMJNmoy47o3IfJUq3A1c78jvLVejiFmq/DHvGEw1T1AQ AaSnEIQwQYmbIi12eE86l1lwcB/j94Ed+6zIRHNSynOkrX4vBKSsI2IwOmMPSST3KdiMJx l9tGnDkQf9b7Zo5qKq/GtIaFs7jDYfJWaJard5BjgDV0HbStHReVyymdlnNTXRSK8QD6Oj PaMYHqPkmqGkC0Bb5LomSkPEaZ7No0O3TmlrOV+x7Uf2I/pVQ5DxCQ9/iInJZQ== 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 4Nq9Bc5vg0zLfx; Sat, 7 Jan 2023 19:24:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 307JOexA084660; Sat, 7 Jan 2023 19:24:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 307JOePk084659; Sat, 7 Jan 2023 19:24:40 GMT (envelope-from git) Date: Sat, 7 Jan 2023 19:24:40 GMT Message-Id: <202301071924.307JOePk084659@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: 967022fd812c - main - Mk/Uses/cargo.mk: Enable WITH_LTO by default List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 967022fd812cf67dec264ee4e53bd016b69e7a2b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=967022fd812cf67dec264ee4e53bd016b69e7a2b commit 967022fd812cf67dec264ee4e53bd016b69e7a2b Author: Daniel Engberg AuthorDate: 2023-01-07 19:08:44 +0000 Commit: Daniel Engberg CommitDate: 2023-01-07 19:22:36 +0000 Mk/Uses/cargo.mk: Enable WITH_LTO by default Ports utilizing Cargo will now enable Link Time Optimization (LTO), set error handling mechanism to abort and codegen-units to 1 by default. Exceptions are powerpc64 and riscv64 where LTO is known to be broken and disabled to avoid unnecessary breakage. Ports utilizing LTO will output "Additional optimization to port applied" during build. WITH_LTO is handled by Mk/Features/lto.mk and to disable define LTO_UNSAFE=yes. I'd also like to mention arrowd and tobik for helpful input and thanks to everyone involved. Reviewed by: mikael (via irc), pkubaj Tested by: eduardo (build) Approved by: rust (mikael, pkubaj) Differential Revision: https://reviews.freebsd.org/D36736 --- Mk/Uses/cargo.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 5b6dfd268404..d3d7556c7630 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -139,6 +139,11 @@ CARGO_ENV+= \ CARGO_ENV+= RUST_BACKTRACE=1 . endif +. if !defined(LTO_UNSAFE) || (defined(LTO_DISABLE_CHECK) && ${ARCH} == powerpc64) || (defined(LTO_DISABLE_CHECK) && ${ARCH} == riscv64) +_CARGO_MSG= "===> Additional optimization to port applied" +WITH_LTO= yes +. endif + # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk . if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} @@ -295,6 +300,9 @@ cargo-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh +. if defined(_CARGO_MSG) + @${ECHO_MSG} ${_CARGO_MSG} +. endif @${ECHO_MSG} "===> Cargo config:" @${MKDIR} ${WRKDIR}/.cargo @: > ${WRKDIR}/.cargo/config.toml