Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Mar 2024 12:51:12 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 277902] Mk/Uses/cargo.mk: WITH_LTO no longer applies
Message-ID:  <bug-277902-7788-demTOZ0lcX@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-277902-7788@https.bugs.freebsd.org/bugzilla/>
References:  <bug-277902-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277902

--- Comment #4 from Gleb Popov <arrowd@FreeBSD.org> ---
What I'm suggesting is

diff --git a/Mk/Features/lto.mk b/Mk/Features/lto.mk
index 3fef5a223e9c..3fbff00d5f5e 100644
--- a/Mk/Features/lto.mk
+++ b/Mk/Features/lto.mk
@@ -10,17 +10,17 @@ LTO_Include_MAINTAINER=3D     pkubaj@FreeBSD.org
 .  if !defined(LTO_UNSAFE) || defined(LTO_DISABLE_CHECK)
 .    if "${ARCH}" =3D=3D "riscv64" && !defined(LTO_DISABLE_CHECK)
        DEV_WARNING+=3D   "LTO is currently broken on riscv64, to override =
set
LTO_DISABLE_CHECK=3Dyes"
-.    elif defined(_INCLUDE_USES_CARGO_MK)
-   CARGO_ENV+=3D CARGO_PROFILE_RELEASE_LTO=3D"true" \
+.    else
+   CARGO_LTO_ENV=3D      CARGO_PROFILE_RELEASE_LTO=3D"true" \
                CARGO_PROFILE_RELEASE_PANIC=3D"abort" \
                CARGO_PROFILE_RELEASE_CODEGEN_UNITS=3D1
-.    elif defined(_INCLUDE_USES_MESON_MK)
-   MESON_ARGS+=3D        -Db_lto=3Dtrue
-.    elif defined(_INCLUDE_USES_CABAL_MK)
+
+   MESON_LTO_ARGS=3D     -Db_lto=3Dtrue
+
    CABAL_LTO_ARGS=3D     --ghc-options=3D-split-sections \
                        --gcc-options=3D"-fdata-sections -ffunction-section=
s" \
                        --ld-options=3D-Wl,--gc-sections,--build-id,--icf=
=3Dall
-.    else
+
 # Overridable as a user may want to use -flto
    LTO_FLAGS?=3D -flto=3Dthin
    CFLAGS+=3D    ${LTO_FLAGS}


and then use CARGO_LTO_ENV in Uses/cargo.mk

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-277902-7788-demTOZ0lcX>