public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: Antoni Boucher <bouanto@zoho.com>
To: jit@gcc.gnu.org
Subject: Re: How do I enable -flto for Emacs nativecomp?
Date: Thu, 7 Mar 2024 12:57:40 -0500	[thread overview]
Message-ID: <dd6f69da-757b-49ba-864a-377a8dc393cf@zoho.com> (raw)
In-Reply-To: <87zfva0vyo.fsf@strawberrytea.xyz>

It seems to me that you forgot to enable the lto frontend.
Please add it to --enable-languages when configuring the gcc build.

Le 2024-03-07 à 12 h 53, StrawberryTea a écrit :
> Hello libgccjit people,
> 
> I'm trying to enable -flto for Emacs nativecomp. I have the following
> Emacs patch I am applying through Gentoo
> 
> diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
> index bb4552459dd..745612838cc 100644
> --- a/lisp/emacs-lisp/comp.el
> +++ b/lisp/emacs-lisp/comp.el
> @@ -193,8 +193,8 @@ native-comp-async-query-on-exit
>     :type 'boolean
>     :version "28.1")
> 
> -(defcustom native-comp-compiler-options nil
> +(defcustom native-comp-compiler-options '("-march=znver4" "-Ofast" "-g0" "-fno-finite-math-only" "-flto")
>     "Command line options passed verbatim to GCC compiler.
>   Note that not all options are meaningful and some options might even
>   break your Emacs.  Use at your own risk.
>   affecting the assembler and linker are likely to be useful.
> 
> However, Emacs fails to compile with the following error:
> libgccjit.so: error: LTO support has not been enabled in this configuration
> Assembler messages:
> Error: can't open /var/tmp/portage/app-editors/emacs-30.0.9999/temp/libgccjit-1Escx1/fake.s for reading: No such file or directory
> libgccjit.so: error: error invoking gcc driver
> 
> This is a link to the entire build log: https://0x0.st/H7h2.txt
> And this is one for the build environment: https://0x0.st/H7hL.txt
> And this is the output of gcc --version --verbose: https://0x0.st/H7hp.txt
> 
> I can pass options to the compiler and to the driver but I am not sure
> what else to pass to enable LTO or if I need to recompile GCC, etc, etc.
> 
> Sincerely,
> StrawberryTea

  reply	other threads:[~2024-03-07 17:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 17:53 StrawberryTea
2024-03-07 17:57 ` Antoni Boucher [this message]
2024-03-07 18:05   ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd6f69da-757b-49ba-864a-377a8dc393cf@zoho.com \
    --to=bouanto@zoho.com \
    --cc=jit@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).