Gentoo Archives: gentoo-dev

From: Padraig Brady <padraig.brady@××××××.com>
To: Chris PeBenito <pebenito@g.o>
Cc: Mark Gordon <mark.gt@×××××××××××××××.uk>, gentoo-dev@g.o
Subject: Re: [gentoo-dev] auto selection of optimal gcc architecture settings
Date: Tue, 29 Apr 2003 09:41:26
Message-Id: 3EAE474F.9040006@corvil.com
In Reply to: Re: [gentoo-dev] auto selection of optimal gcc architecture settings by Chris PeBenito
1 Chris PeBenito wrote:
2 > On Mon, 2003-04-28 at 08:30, Mark Gordon wrote:
3 > [cut]
4 >
5 >>>>>I've been testing http://www.pixelbeat.org/scripts/gcccpuopt
6 >>>>>over the last while with good results. Essentially it's
7 >>>>>a Linux specific script that only helps on x86 at present
8 >>>>>but can be updated to other architectures easily.
9 >
10 > [cut]
11 >
12 >>>>>It would be beneficial IMHO for gentoo to run it at
13 >>>>>installation time and update /etc/make.conf appropriately?
14 >
15 > [cut]
16 >
17 >>It needs extending even for the x86 compatible world.
18 >>
19 >>markg@brenda markg $ ./gcccpuopt
20 >> -march=pentium2 -mmmx
21 >
22 > [cut]
23 >
24 > I think this would probably be more useful if it dumped out the CHOST
25 > line in addition to the optimizations. This would help with people that
26 > have the more uncommon processors to set the correct CHOST. I seen more
27 > than a few times K6* users have had CHOST="i686-pc-linux-gnu", when it
28 > should be i586-pc-linux-gnu.
29 >
30 > so it'd print this for a K6-2:
31 >
32 > $ ./gcccpuopt
33 > CHOST="i586-pc-linux-gnu"
34 > CFLAGS="-march=k6-2"
35 >
36 > So it could easily be pasted into make.conf. (-mmmx is redundant)
37
38 I would do that as an explicit option as it's handy (outside
39 the gentoo context) to do things like:
40 export CFLAGS="$CFLAGS `gcccpuopt` -O3 -pipe -fomit-frame-pointer"
41
42 Other useful options would be KERNEL which would output the
43 appropriate kernel config (e.g. CONFIG_MK7), and GCCVER which would
44 specify which gcc to use rather than the installed one.
45
46 so in summary options to gcccpuopt should be:
47 [-CFLAGS | -CHOST | -KERNEL] [-GCCVER]
48
49 Pádraig.
50
51
52 --
53 gentoo-dev@g.o mailing list