[uClibc] Equivalent of OPTIMIZE_FOR_CPU for newer menuconfig based buildroot

malk at sidehack.sat.gweep.net malk at sidehack.sat.gweep.net
Thu Dec 23 20:16:37 UTC 2004

Hi all-

In older buildroot setups, there was a variable OPTIMIZE_FOR_CPU that I think
would allow one to setup the cross compiler so it defaults to optimizing for
a particular CPU even if the default cpu for some ARCH is different
i.e. if doing ARCH i386, you could still optimize for i586 so by just cross
compiling w/ the resultant compiler w/ no -m args, it would produce i586
optimized code by default.

I would like w/ the new menuconfig driven buildroot accomplish this.

I've tried simply adding -march=i586 to "Target Optimizations" after
the -Os -pipe under the toolchain options menu and I configured the
kernel and uclibc for 586.

Reviewing the build log shows this seems to work -- kernel, uclibc,
and most of the targets have -march=i586 on the commandline.

busybox was a little kludgy because it's got a -march=i386 followed
by the -march=i586 (I suppose I could tune the busybox config to clean
that up so at least both say i586)

udhcp however has no -m options on its commandline so I'm guessing
that probably got built w/ default i386 optimizations.  If I knew
that the cross compiler w/ no -m options built i586 by default
then I'd have no worries.

Is there a better way to accomplish the i586 optimization for
everything than what I'm doing?  Always like to hear suggestions
from the experts.


-Eric Malkowski

More information about the uClibc mailing list