Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

COMMON_FLAGS march=native

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
19 posts • Page 1 of 1
Author
Message
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

COMMON_FLAGS march=native

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 12:26 pm

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?
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Dec 13, 2022 12:40 pm

What kind of virtualized cpu does Parallels assign to your vm?
Safest is to omit -march= or set it to

Code: Select all

-march=x86-64
You can also run

Code: Select all

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.
:)
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 12:43 pm

alamahant wrote:What kind of virtualized cpu does Parallels assign to your vm?
Safest is to omit -march= or set it to

Code: Select all

-march=x86-64
Apple M1 Max
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Dec 13, 2022 12:48 pm

Plz check it with

Code: Select all

gcc -march=native -E -v - </dev/null 2>&1 | grep cc1

:)
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 12:49 pm

alamahant wrote:Plz check it with

Code: Select all

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?
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Dec 13, 2022 12:52 pm

Better just omit -march=
:)
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 12:53 pm

alamahant wrote:Better just omit -march=
what do you mean?
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Dec 13, 2022 12:57 pm

In COMMON_FLAGS do not include anything "-march=xxxx"
:)
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 12:58 pm

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 :-)
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 13, 2022 1:00 pm

leonchik1976,

The M1 is an aarch64 CPU. That's 64 bit ARM.
The

Code: Select all

-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

Code: Select all

-march=x86-64 
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.
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Tue Dec 13, 2022 1:01 pm

The say -march=native does not work with Apple M1.
They also say clang15 does support it.
see
https://stackoverflow.com/questions/659 ... n-apple-m1
etc
:)
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 13, 2022 1:01 pm

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.
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 1:02 pm

NeddySeagoon wrote:leonchik1976,

The M1 is an aarch64 CPU. That's 64 bit ARM.
The

Code: Select all

-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

Code: Select all

-march=x86-64 
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
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 1:05 pm

i have clang 15
sys-devel/clang-15.0.6
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 13, 2022 1:34 pm

leonchik1976,

Lets test with

Code: Select all

-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.
Top
leonchik1976
Guru
Guru
Posts: 344
Joined: Sun Jan 24, 2010 1:28 pm

  • Quote

Post by leonchik1976 » Tue Dec 13, 2022 5:34 pm

NeddySeagoon wrote:leonchik1976,

Lets test with

Code: Select all

-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?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 13, 2022 7:01 pm

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.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56104
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Dec 13, 2022 8:38 pm

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.
Top
flysideways
Guru
Guru
Posts: 527
Joined: Sat Jan 29, 2005 1:06 pm

  • Quote

Post by flysideways » Wed Dec 14, 2022 2:23 am

https://opensource.apple.com/projects/llvm-clang/

LLVM/Clang are not gpl, but rather a modified Apache. https://llvm.org/LICENSE.txt
Top
Post Reply
  • Print view

19 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic