public inbox for jit@gcc.gnu.org
 help / color / mirror / Atom feed
From: StrawberryTea <look@strawberrytea.xyz>
To: jit@gcc.gnu.org
Subject: How do I enable -flto for Emacs nativecomp?
Date: Thu, 07 Mar 2024 11:53:51 -0600	[thread overview]
Message-ID: <87zfva0vyo.fsf@strawberrytea.xyz> (raw)

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:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 17:53 StrawberryTea [this message]
2024-03-07 17:57 ` Antoni Boucher
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=87zfva0vyo.fsf@strawberrytea.xyz \
    --to=look@strawberrytea.xyz \
    --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).