Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2025 16:20:04 -0400
From:      Ed Maste <emaste@freebsd.org>
To:        Nuno Teixeira <eduardo@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org,  dev-commits-src-main@freebsd.org
Subject:   Re: git: 1cae7121c667 - main - Enable LLVM_BINUTILS by default
Message-ID:  <CAPyFy2AT1ni_Q2cfbUqcjOWdOuCq0K1-JKPY%2BnvmqV7ZU%2Bq4AA@mail.gmail.com>
In-Reply-To: <CAFDf7UKBe51aU9XfR%2BqWrxFncSX2fKjiQuYeNitoL8OowOpRzg@mail.gmail.com>
References:  <202503141729.52EHTYis008114@gitrepo.freebsd.org> <CAFDf7UKBe51aU9XfR%2BqWrxFncSX2fKjiQuYeNitoL8OowOpRzg@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

On Fri, 14 Mar 2025 at 14:05, Nuno Teixeira <eduardo@freebsd.org> wrote:
>
> Hello Ed,
>
> I have a newbie question about building world/kernel with LTO.
> I did not found too much info googling, but I found https://wiki.freebsd.org/LinkTimeOptimization and it says:
>
> Build and link a kernel with:
>
> WITHOUT_CTF=yes
> WITHOUT_DTRACE=yes
> sys/conf/kern.mk -flto=thin (for all clang invocations)
>
> Is this the correct way to test LTO atm?

That page is pretty much completely out of date, unfortunately.
Eventually we want to have user-facing knobs for this (for example,
WITH_KERNEL_LTO in src.conf) but for experimentation you need to add
-flto or -flto=thin to the compiler and linker invocations. This
should be possible by setting CFLAGS and LDFLAGS on the command line
or by editing kern.mk.


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPyFy2AT1ni_Q2cfbUqcjOWdOuCq0K1-JKPY%2BnvmqV7ZU%2Bq4AA>