Help needed building gcc on Arm

Tim Janes
Sun Jun 23 18:44:00 GMT 2019

I am attempting to build gcc 9.1.0 on an Arm7 (Raspberry Pi) running 
piCore Linux distribution, but i wish it to be build to also run on Arm6 
(older Pi).

My build script looks like this

export CFLAGS="-O2 -pipe -march=armv6zk -mtune=arm1176jzf-s 
-mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard-fuse-ld=gold"
export CXXFLAGS="-O2 -pipe -fno-exceptions -march=armv6zk 
-mtune=arm1176jzf-s -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard 
export LDFLAGS="-L/usr/local/lib"

  ../gcc-9.1.0/configure \
     --libdir=/usr/lib \
     --enable-shared \
     --enable-threads=posix \
     --enable-__cxa_atexit \
     --enable-c99 \
     --enable-long-long \
     --enable-clocale=gnu \
     --enable-languages=c,c++ \
     --disable-multilib \
     --disable-libstdcxx-pch \
     --enable-cloog-backend=isl \
     --with-isl=/usr \
     --with-system-zlib \
     --enable-frame-pointer \
     --disable-bootstrap \
     --enable-lto \
     --with-pkgversion=piCore \
     --with-arch=armv6zk \
     --with-tune=arm1176jzf-s \
     --with-fpu=vfp \
     --with-float=hard \

but this fails with

libtool: compile: 
-B/usr/local/armv7l-unknown-linux-gnueabihf/lib/ -isystem 
/usr/local/armv7l-unknown-linux-gnueabihf/include -isystem 
/usr/local/armv7l-unknown-linux-gnueabihf/sys-include -DHAVE_CONFIG_H 
-I../../../gcc-9.1.0/libatomic -I. -Wall -Werror -pthread -g -O2 -pipe 
-march=armv6zk -mtune=arm1176jzf-s -mcpu=arm1176jzf-s -mfpu=vfp 
-mfloat-abi=hard -fuse-ld=gold -MT load_1_1_.lo -MD -MP -MF 
.deps/load_1_1_.lo.Ppo -DN=1 -DIFUNC_ALT=1 -march=armv7-a+fp -c 
../../../gcc-9.1.0/libatomic/config/linux/arm/load_n.c  -fPIC -DPIC -o 
cc1: error: switch '-mcpu=arm1176jzf-s' conflicts with '-march=armv7-a' 
switch [-Werror]
cc1: all warnings being treated as errors
make[4]: *** [Makefile:854: load_1_1_.lo] Error 1

How do I stop it picking up march=armv7-a - presumably it is getting 
that from the machine I am running on.?

I have tried adding --with-cpu=arm1176jzf-s to the configuration, with 
this I had to remove with-arch and with-tune, but the build gives 
exactly the same error.

Any help or suggestuions would be welcome.



More information about the Gcc-help mailing list