View previous topic :: View next topic |
Author |
Message |
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 12:26 pm Post subject: COMMON_FLAGS march=native |
|
|
I have gentoo installed in Parallels Desktop VM on my mac studio M1 Max, and i have a lot of issues when i set "-march=native:
COMMON_FLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
how can i know, what should i put instead so it will suitable for this CPU? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
Posted: Tue Dec 13, 2022 12:40 pm Post subject: |
|
|
What kind of virtualized cpu does Parallels assign to your vm?
Safest is to omit -march= or set it to
You can also run
Code: |
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
|
to see as what arch GCC recognizes the virt cpu. _________________
Last edited by alamahant on Tue Dec 13, 2022 12:47 pm; edited 1 time in total |
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 12:43 pm Post subject: |
|
|
alamahant wrote: | What kind of virtualized cpu does Parallels assign to your vm?
Safest is to omit -march= or set it to
|
Apple M1 Max |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
Posted: Tue Dec 13, 2022 12:48 pm Post subject: |
|
|
Plz check it with
Code: |
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
|
_________________
|
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 12:49 pm Post subject: |
|
|
alamahant wrote: | Plz check it with
Code: |
gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
|
|
# gcc -march=native -E -v - </dev/null 2>&1 | grep cc1
/usr/libexec/gcc/aarch64-unknown-linux-gnu/12/cc1 -E -quiet -v - -mlittle-endian -mabi=lp64 -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth -dumpbase -
so what from this should i put in COMMON_FLAGS? the whole line as is? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
Posted: Tue Dec 13, 2022 12:52 pm Post subject: |
|
|
Better just omit -march= _________________
|
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 12:53 pm Post subject: |
|
|
alamahant wrote: | Better just omit -march= |
what do you mean? |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
Posted: Tue Dec 13, 2022 12:57 pm Post subject: |
|
|
In COMMON_FLAGS do not include anything "-march=xxxx" _________________
|
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 12:58 pm Post subject: |
|
|
alamahant wrote: | In COMMON_FLAGS do not include anything "-march=xxxx" |
so i confused a little bit - if it will grab what it needs without -march=native, why it's required |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54600 Location: 56N 3W
|
Posted: Tue Dec 13, 2022 1:00 pm Post subject: |
|
|
leonchik1976,
The M1 is an aarch64 CPU. That's 64 bit ARM.
The Code: | -mlittle-endian -mabi=lp64 -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth -dumpbase - | is what gcc uses for -march=native.
Don't use as gcc will try to output code for amd64 and fail. It will be harmless though.
What problems are you having. gcc should be OK.
clang needs version 15 to understand --march=native on your CPU _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3918
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54600 Location: 56N 3W
|
Posted: Tue Dec 13, 2022 1:01 pm Post subject: |
|
|
Moved from Installing Gentoo to Gentoo on ARM.
Its one of these _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 1:02 pm Post subject: |
|
|
NeddySeagoon wrote: | leonchik1976,
The M1 is an aarch64 CPU. That's 64 bit ARM.
The Code: | -mlittle-endian -mabi=lp64 -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth -dumpbase - | is what gcc uses for -march=native.
Don't use as gcc will try to output code for amd64 and fail. It will be harmless though.
What problems are you having. gcc should be OK.
clang needs version 15 to understand --march=native on your CPU |
some packages can't build with -marth=native. for example - www-client/chromium.
but now - i can't even upgrade gcc - https://bugs.gentoo.org/884497 |
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 1:05 pm Post subject: |
|
|
i have clang 15
sys-devel/clang-15.0.6 |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54600 Location: 56N 3W
|
Posted: Tue Dec 13, 2022 1:34 pm Post subject: |
|
|
leonchik1976,
Lets test with Code: | -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth | which is what gcc detected.
That will be used by both gcc and clang. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
leonchik1976 Guru
Joined: 24 Jan 2010 Posts: 337
|
Posted: Tue Dec 13, 2022 5:34 pm Post subject: |
|
|
NeddySeagoon wrote: | leonchik1976,
Lets test with Code: | -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth | which is what gcc detected.
That will be used by both gcc and clang. |
NeddySeagoon, after replacing -march=native with -march=armv8-a+crypto+crc+lse+rcpc+rdma+dotprod+fp16fml+sb+ssbs+flagm+pauth,
i was able to upgrade gcc without any issue.
so - should, i revert now back to -march=native - or leave it expanded? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54600 Location: 56N 3W
|
Posted: Tue Dec 13, 2022 7:01 pm Post subject: |
|
|
leonchik1976,
Leave it as expanded. The expanded form is what gcc claims it would do, so there should be no difference ... but one works. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54600 Location: 56N 3W
|
Posted: Tue Dec 13, 2022 8:38 pm Post subject: |
|
|
leonchik1976,
See Gentoo Virtual Machine in the UTM App on Macbook Pro M1 Max for a better fix.
-march infers different things on amd64 and arm64. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
flysideways Guru
Joined: 29 Jan 2005 Posts: 496
|
|
Back to top |
|
|
|