On 13 November 2012 22:58, Matthias Klose doko@ubuntu.com wrote:
Am 12.11.2012 03:27, schrieb Michael Hope:
I think I've found the problem. We pass -U_FORTIFY and -fno-stack-protector to make the binary more universal, and the way that crosstool-NG passes these flags on to the tool overrides the default package flags and turns off any optimisations.
Short story: GCC was being built without optimisations. I've got a test build running to verify.
setting STAGE1_CFLAGS should not overwrite the CFLAGS used for the build. Setting these flags for a native stage3 build should not be necessary. The stage1 compiler isn't shipped.
With our configuration, crosstool-NG sets CFLAGS to -pipe -fno-stack-protector -U_FORTIFY. This overrides the default -O2 -g for later stages and gives us an unoptimised GCC.
The test build has just come in. Before:
michaelh@crucis:$ time arm-linux-gnueabihf-gcc ... -O3 -mfpu=neon -c -o pcre_compile.lo pcre_compile.c
real 0m5.752s user 0m5.692s sys 0m0.040s
After:
real 0m2.689s user 0m2.640s sys 0m0.036s
Frank, I've put a test build up at: http://people.linaro.org/~michaelh/incoming/gcc-linaro-arm-linux-gnueabihf-4...
Could you give it a try? I'll commit the fix now and it'll be part of the end of month release.
-- Michael