You are not logged in.

#1 2008-09-23 21:59:51

Falcata
Member
From: Michiana
Registered: 2008-01-23
Posts: 501
Website

Processor flags?

The processor my new homemade system uses is a AMD Athlon X2 5000+ Brisbane, running Arch in 32-bit.  What would I set the -march and -mtune flags to if I wanted to compile a package specifically for this architecture, and what flag would I use to make it compile as 32bit?  Is it -m32 or something like that?

Offline

#2 2008-09-24 02:10:38

FallenWizard
Member
From: Vienna/ Austria
Registered: 2007-12-10
Posts: 99

Re: Processor flags?

-march=native should be enough.
-march includes mtune and -m32 is only needed if you want to compile packages which doesn't compile on 64 bit machines. (Like Zsnes).

You are running 32 Bit, so -m32 is not needed.

Last edited by FallenWizard (2008-09-24 02:11:13)

Offline

#3 2008-09-24 02:52:58

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Processor flags?

Falcata wrote:

The processor my new homemade system uses is a AMD Athlon X2 5000+ Brisbane, running Arch in 32-bit.  What would I set the -march and -mtune flags to if I wanted to compile a package specifically for this architecture, and what flag would I use to make it compile as 32bit?  Is it -m32 or something like that?

There is no point, if you use makepkg to compile your arch specific packages they will already be optimized for your processor.

in case your curious

/etc/makepkg.conf

Offline

#4 2008-09-24 03:12:18

FallenWizard
Member
From: Vienna/ Austria
Registered: 2007-12-10
Posts: 99

Re: Processor flags?

jacko wrote:

There is no point, if you use makepkg to compile your arch specific packages they will already be optimized for your processor.

in case your curious

/etc/makepkg.conf

Wrong, makepkg optimizes for i686 by default, but there is not really a noticable difference between the standard flags and -march=native. The speed increase is very minimal because all important packages like gcc and etc.. are optimized for i686.

Last edited by FallenWizard (2008-09-24 03:50:48)

Offline

#5 2008-09-24 04:15:30

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,399
Website

Re: Processor flags?

Just a FYI.  There is no -m32 option in any of Arch's gcc packages.  That option allows gcc on a 64bit system to build 32bit binaries, provided the system is a miltilib one.  Arch doesn't do multilib so there is no -m32 flag in x86_64 gcc.

Offline

#6 2008-09-24 04:25:42

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Processor flags?

FallenWizard wrote:
jacko wrote:

There is no point, if you use makepkg to compile your arch specific packages they will already be optimized for your processor.

in case your curious

/etc/makepkg.conf

Wrong, makepkg optimizes for i686 by default, but there is not really a noticable difference between the standard flags and -march=native. The speed increase is very minimal because all important packages like gcc and etc.. are optimized for i686.

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

#-- Exclusive: will only run on -march=x86-64 
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=native -mtune=native -O2 -pipe"
CXXFLAGS="-march=native -mtune=native -O2 -pipe"
#-- Make Flags: change this for DistCC/SMP systems
MAKEFLAGS="-j3"

CFLAGS and CXXFLAGS are both set to -march=native -mtune=native in /etc/makepkg.conf

http://gcc.gnu.org/onlinedocs/gcc/i386- … tions.html

native
    This selects the CPU to tune for at compilation time by determining the processor type of the compiling machine. Using -mtune=native will produce code optimized for the local machine under the constraints of the selected instruction set. Using -march=native will enable all instruction subsets supported by the local machine (hence the result might not run on different machines).

now who is wrong?

Last edited by jacko (2008-09-24 04:27:22)

Offline

#7 2008-09-24 04:30:03

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,399
Website

Re: Processor flags?

jacko wrote:

now who is wrong?

The guy who has changed his makepkg.conf and does not realize the default makepkg.conf looks like....

CFLAGS="-march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe"

or -march=x86-64 for that arch.

Offline

#8 2008-09-24 04:40:54

jacko
Member
Registered: 2007-11-23
Posts: 840

Re: Processor flags?

odd, last time the file was modified was when I installed arch over 8 months ago. Maybe something else has changed???

That still doesn't negate the fact that makepkg is specific to your OS platform, not i686. Why would one compile i686 optimized binaries on x86_64 bit platform by default? or vice versa?

my makepkg.conf.pacnew

CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"
CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe"

Last edited by jacko (2008-09-24 04:49:11)

Offline

#9 2008-10-11 14:12:56

Cotton
Member
From: Cornwall, UK
Registered: 2004-09-17
Posts: 568

Re: Processor flags?

Are you saying its not possible to create i686 packages on a x86_64 system?
I would like to be able to do this to transfer the resultant packages to an older under-resourced machine that can't (easily) compile the PKGBUILDs itself.

Offline

#10 2008-10-11 15:34:27

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Processor flags?

jacko wrote:

odd, last time the file was modified was when I installed arch over 8 months ago. Maybe something else has changed???

Of course something else has changed. It all depends on how vanilla your makepkg.conf is/was and how you handle .pacnew files. A non-vanilla config file will never be replaced by pacman, it will leave a .pacnew for you to merge. If you just trash them, nothing gets merged. Pretty simple.

That still doesn't negate the fact that makepkg is specific to your OS platform, not i686. Why would one compile i686 optimized binaries on x86_64 bit platform by default? or vice versa?

An OS and a platform are two different things. Arch on i686 and on x86_64 are still the same OS, just compiled for a different platform. People wanting to cross-compile would like to use something else than -march=native, people compiling for other systems would like a generic set of instructions (I have an online repo of myself I use to share packages between my systems and systems of others I maintain, if I'd optimise all packages for my Core 2 Duo they'd be useless on the AMD Sempron 3000+ and AMD Athlon XP 3200+).

As Allan said, since Arch 64 is pure 64 bit (the compiler at least), you'd need another toolchain to cross-compile. But there's tons of situations where cross-compiling is a valid and preferable option. You don't see people compiling stuff on their MIPS routers, for example.

Last edited by B (2008-10-11 15:34:47)


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB