--with-arch=i486 (was Re: Merging the jh branch to trunk)

Dan Nicholson dbn.lists at gmail.com
Sat Sep 15 08:59:07 PDT 2007

On 9/15/07, Dan Nicholson <dbn.lists at gmail.com> wrote:
> On 9/15/07, Jeremy Huntwork <jhuntwork at linuxfromscratch.org> wrote:
> >
> > I suppose it might be possible to introduce the -march flag to CFLAGS
> > without specifying the whole of CFLAGS on the command line... I'll take
> > a look.
> For LFS, I think it would be better if we just `sed' the -march into
> the appropriate default. I'd rather avoid the whole '-O2 -pipe' part,
> even though those are obviously very sane flags. Since I've done squat
> lately, I'm gonna take a quick look at this.

I'm pretty sure that the default CFLAGS are set during the AC_PROG_CC
autoconf macro. So, we could either add our own customized macro and
rebuild the autotools, or just hack the already generated configure
script. This seems to work (I just did a successful build):

sed -i.bak 's/CFLAGS=.*-O2/& -march=i486/' configure

And now I can see what Greg and Jeremy are talking about where you
don't want the -march populating all calls to $CC (as would happen
with CC="gcc -march=i486" or by making that the default with
--with-arch=i486 to gcc). Glibc seems to have a whole raft of ways it
wants to use the compiler. They also have some, uh, creative use of
GNU make.


More information about the lfs-dev mailing list