GNU bug report logs - #58434
Native compile results in error if -march and -mtune are specified

Previous Next

Package: emacs;

Reported by: Loreno Heer <loreno.heer <at> bluewin.ch>

Date: Tue, 11 Oct 2022 11:24:02 UTC

Severity: normal

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58434 in the body.
You can then email your comments to 58434 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Tue, 11 Oct 2022 11:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Loreno Heer <loreno.heer <at> bluewin.ch>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 11 Oct 2022 11:24:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Loreno Heer <loreno.heer <at> bluewin.ch>
To: bug-gnu-emacs <at> gnu.org
Subject: Native compile results in error if -march and -mtune are specified
Date: Tue, 11 Oct 2022 11:00:53 +0200
The latest compile of emacs (from git from yesterday night) (on both
linux and windows) gives the following error with native compile and
-march options specified:

libgccjit-0.dll: error: bad value 'native' for '-march=' switch
libgccjit-0.dll: note: valid arguments to '-march=' switch are: nocona
core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge
core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake
icelake-client rocketlake icelake-server cascadelake tigerlake
cooperlake sapphirerapids alderlake bonnell atom silvermont slm goldmont
goldmont-plus tremont knl knm x86-64 x86-64-v2 x86-64-v3 x86-64-v4
eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8
k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10
barcelona bdver1 bdver2 bdver3 bdver4 znver1 znver2 znver3 btver1 btver2
native




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Tue, 11 Oct 2022 13:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Loreno Heer <loreno.heer <at> bluewin.ch>
Cc: 58434 <at> debbugs.gnu.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Tue, 11 Oct 2022 16:40:26 +0300
> Date: Tue, 11 Oct 2022 11:00:53 +0200
> From: Loreno Heer <loreno.heer <at> bluewin.ch>
> 
> 
> The latest compile of emacs (from git from yesterday night) (on both
> linux and windows) gives the following error with native compile and
> -march options specified:

How did you specify -march, and why did you specify it?  AFAIK, the
default configuration doesn't use that switch.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Tue, 11 Oct 2022 15:53:02 GMT) Full text and rfc822 format available.

Message #11 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Loreno Heer <loreno.heer <at> bluewin.ch>, Andrea Corallo <akrl <at> sdf.org>
Cc: 58434 <at> debbugs.gnu.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Tue, 11 Oct 2022 18:52:23 +0300
[Please use Reply All to keep the bug tracker on the CC list.]

> Date: Tue, 11 Oct 2022 15:48:54 +0200
> From: Loreno Heer <loreno.heer <at> bluewin.ch>
> 
> (setq native-comp-compiler-options '("-O2" "-march=native" "-mtune=native"))
> 
> in my .emacs file.
> I wanted to speed up the installation a bit. I found the suggestion
> here:
> https://www.reddit.com/r/emacs/comments/prihh8/optimization_flags_for_nativecomp_whats_the/

OK, so the compiler told you it doesn't support -march=native, so you
will have to specify the exact architecture.

Btw, I think you should use native-comp-driver-options for this, not
native-comp-compiler-options.  Andrea, am I right?  I think GCC is
"driver" and "compiler" means cc1, no?  (If I'm right, we need to fix
the doc strings.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Tue, 11 Oct 2022 19:23:04 GMT) Full text and rfc822 format available.

Message #14 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Loreno Heer <loreno.heer <at> bluewin.ch>
To: Eli Zaretskii <eliz <at> gnu.org>, Andrea Corallo <akrl <at> sdf.org>
Cc: 58434 <at> debbugs.gnu.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Tue, 11 Oct 2022 20:58:27 +0200
Specifying the architecture directly works.

I used the following snippet

cc -march=native -Q --help=target

to query which architecture native would give me then replaced it. Both
windows (nehalem) and linux (tigerlake) seem to work fine so far, but
the packages that failed to compile previously need to be reinstalled I
guess.

Thanks for the help

On 11.10.2022 17:52, Eli Zaretskii wrote:
> [Please use Reply All to keep the bug tracker on the CC list.]
> 
>> Date: Tue, 11 Oct 2022 15:48:54 +0200
>> From: Loreno Heer <loreno.heer <at> bluewin.ch>
>>
>> (setq native-comp-compiler-options '("-O2" "-march=native" "-mtune=native"))
>>
>> in my .emacs file.
>> I wanted to speed up the installation a bit. I found the suggestion
>> here:
>> https://www.reddit.com/r/emacs/comments/prihh8/optimization_flags_for_nativecomp_whats_the/
> 
> OK, so the compiler told you it doesn't support -march=native, so you
> will have to specify the exact architecture.
> 
> Btw, I think you should use native-comp-driver-options for this, not
> native-comp-compiler-options.  Andrea, am I right?  I think GCC is
> "driver" and "compiler" means cc1, no?  (If I'm right, we need to fix
> the doc strings.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Tue, 11 Oct 2022 19:44:02 GMT) Full text and rfc822 format available.

Message #17 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58434 <at> debbugs.gnu.org, Loreno Heer <loreno.heer <at> bluewin.ch>
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Tue, 11 Oct 2022 19:43:22 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

> [Please use Reply All to keep the bug tracker on the CC list.]
>
>> Date: Tue, 11 Oct 2022 15:48:54 +0200
>> From: Loreno Heer <loreno.heer <at> bluewin.ch>
>> 
>> (setq native-comp-compiler-options '("-O2" "-march=native" "-mtune=native"))
>> 
>> in my .emacs file.
>> I wanted to speed up the installation a bit. I found the suggestion
>> here:
>> https://www.reddit.com/r/emacs/comments/prihh8/optimization_flags_for_nativecomp_whats_the/
>
> OK, so the compiler told you it doesn't support -march=native, so you
> will have to specify the exact architecture.
>
> Btw, I think you should use native-comp-driver-options for this, not
> native-comp-compiler-options.  Andrea, am I right?  I think GCC is
> "driver" and "compiler" means cc1, no?  (If I'm right, we need to fix
> the doc strings.)

Hi Eli,

native-comp-driver-options is for assembler and linker while
native-comp-compiler-options is for the compiler.  AFAIK 'march' affects
code generation so it should got to the compiler, then I believe the use
of native-comp-compiler-options here is correct.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Wed, 12 Oct 2022 04:57:01 GMT) Full text and rfc822 format available.

Message #20 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Andrea Corallo <akrl <at> sdf.org>
Cc: 58434 <at> debbugs.gnu.org, loreno.heer <at> bluewin.ch
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Wed, 12 Oct 2022 07:55:59 +0300
> From: Andrea Corallo <akrl <at> sdf.org>
> Cc: Loreno Heer <loreno.heer <at> bluewin.ch>, 58434 <at> debbugs.gnu.org
> Date: Tue, 11 Oct 2022 19:43:22 +0000
> 
> > OK, so the compiler told you it doesn't support -march=native, so you
> > will have to specify the exact architecture.
> >
> > Btw, I think you should use native-comp-driver-options for this, not
> > native-comp-compiler-options.  Andrea, am I right?  I think GCC is
> > "driver" and "compiler" means cc1, no?  (If I'm right, we need to fix
> > the doc strings.)
> 
> Hi Eli,
> 
> native-comp-driver-options is for assembler and linker while
> native-comp-compiler-options is for the compiler.  AFAIK 'march' affects
> code generation so it should got to the compiler, then I believe the use
> of native-comp-compiler-options here is correct.

OK, so I guess the only problem is that the compiler doesn't support
"-march=native", and needs a specific architecture instead of a
generic one.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Wed, 12 Oct 2022 07:30:02 GMT) Full text and rfc822 format available.

Message #23 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Loreno Heer <loreno.heer <at> bluewin.ch>
Cc: 58434 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Wed, 12 Oct 2022 10:29:48 +0300
> Date: Wed, 12 Oct 2022 09:13:34 +0200
> Cc: 58434 <at> debbugs.gnu.org
> From: Loreno Heer <loreno.heer <at> bluewin.ch>
> 
> > OK, so I guess the only problem is that the compiler doesn't support
> > "-march=native", and needs a specific architecture instead of a
> > generic one.
> 
> Yes, but there might be some disadvantages of specifying the
> architecture directly. For example cache sizes are not supplied.
> (https://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-native-will-activate?noredirect=1&lq=1)

What can Emacs do about this?  The problem seems to be between you and
libgccjit/GCC you have installed.  The rejection comes from there, not
from Emacs, AFAIU.




Reply sent to Andrea Corallo <akrl <at> sdf.org>:
You have taken responsibility. (Wed, 12 Oct 2022 11:47:07 GMT) Full text and rfc822 format available.

Notification sent to Loreno Heer <loreno.heer <at> bluewin.ch>:
bug acknowledged by developer. (Wed, 12 Oct 2022 11:47:07 GMT) Full text and rfc822 format available.

Message #28 received at 58434-done <at> debbugs.gnu.org (full text, mbox):

From: Andrea Corallo <akrl <at> sdf.org>
To: Loreno Heer <loreno.heer <at> bluewin.ch>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 58434-done <at> debbugs.gnu.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Wed, 12 Oct 2022 11:45:40 +0000
Loreno Heer <loreno.heer <at> bluewin.ch> writes:

> You are right, did not notice this is a gccjit issue. I filed a bug
> report with the gcc people. (might also be a packaging problem on mingw
> and debian, that I don't know)

Thanks, closing then.

  Andrea




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Wed, 12 Oct 2022 13:20:04 GMT) Full text and rfc822 format available.

Message #31 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Loreno Heer <loreno.heer <at> bluewin.ch>
To: Eli Zaretskii <eliz <at> gnu.org>, Andrea Corallo <akrl <at> sdf.org>
Cc: 58434 <at> debbugs.gnu.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Wed, 12 Oct 2022 09:13:34 +0200
>> From: Andrea Corallo <akrl <at> sdf.org>
>> Cc: Loreno Heer <loreno.heer <at> bluewin.ch>, 58434 <at> debbugs.gnu.org
>> Date: Tue, 11 Oct 2022 19:43:22 +0000
>>
>>> OK, so the compiler told you it doesn't support -march=native, so you
>>> will have to specify the exact architecture.
>>>
>>> Btw, I think you should use native-comp-driver-options for this, not
>>> native-comp-compiler-options.  Andrea, am I right?  I think GCC is
>>> "driver" and "compiler" means cc1, no?  (If I'm right, we need to fix
>>> the doc strings.)
>>
>> Hi Eli,
>>
>> native-comp-driver-options is for assembler and linker while
>> native-comp-compiler-options is for the compiler.  AFAIK 'march' affects
>> code generation so it should got to the compiler, then I believe the use
>> of native-comp-compiler-options here is correct.
> 
> OK, so I guess the only problem is that the compiler doesn't support
> "-march=native", and needs a specific architecture instead of a
> generic one.

Yes, but there might be some disadvantages of specifying the
architecture directly. For example cache sizes are not supplied.
(https://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-native-will-activate?noredirect=1&lq=1)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58434; Package emacs. (Wed, 12 Oct 2022 13:20:04 GMT) Full text and rfc822 format available.

Message #34 received at 58434 <at> debbugs.gnu.org (full text, mbox):

From: Loreno Heer <loreno.heer <at> bluewin.ch>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 58434 <at> debbugs.gnu.org, akrl <at> sdf.org
Subject: Re: bug#58434: Native compile results in error if -march and -mtune
 are specified
Date: Wed, 12 Oct 2022 12:35:38 +0200
You are right, did not notice this is a gccjit issue. I filed a bug
report with the gcc people. (might also be a packaging problem on mingw
and debian, that I don't know)

On 12.10.2022 09:29, Eli Zaretskii wrote:
>> Date: Wed, 12 Oct 2022 09:13:34 +0200
>> Cc: 58434 <at> debbugs.gnu.org
>> From: Loreno Heer <loreno.heer <at> bluewin.ch>
>>
>>> OK, so I guess the only problem is that the compiler doesn't support
>>> "-march=native", and needs a specific architecture instead of a
>>> generic one.
>>
>> Yes, but there might be some disadvantages of specifying the
>> architecture directly. For example cache sizes are not supplied.
>> (https://stackoverflow.com/questions/5470257/how-to-see-which-flags-march-native-will-activate?noredirect=1&lq=1)
> 
> What can Emacs do about this?  The problem seems to be between you and
> libgccjit/GCC you have installed.  The rejection comes from there, not
> from Emacs, AFAIU.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Nov 2022 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.