On 20/05/18 18:23, Alexey Neyman wrote: > Hi, > > I am seeing a failure to build in crosstool-NG configurations where GCC8 > is configured with --with-cpu=... option: > > [ALL ] libtool: compile: > /home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/build/build-cc-gcc-final/./gcc/xgcc > -B/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/build/build-cc-gcc-final/./gcc/ > -B/home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/bin/ > -B/home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/lib/ > -isystem > /home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/include > -isystem > /home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/sys-include > -DHAVE_CONFIG_H > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/libatomic/config/arm > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/libatomic/config/linux/arm > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/libatomic/config/posix > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/libatomic > -I. -Wall -Werror -pthread -mlittle-endian -mcpu=cortex-a15 > -mfpu=neon-vfpv4 -mhard-float -g -Os -MT load_1_1_.lo -MD -MP -MF > .deps/load_1_1_.lo.Ppo -DN=1 -DIFUNC_ALT=1 -march=armv7-a+fp -c > /home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/libatomic/config/linux/arm/load_n.c > -fPIC -DPIC -o .libs/load_1_1_.o > [ERROR] cc1: error: switch -mcpu=cortex-a15 conflicts with > -march=armv7-a switch [-Werror] > > GCC is configured with: > > CC_FOR_BUILD='x86_64-build_pc-linux-gnu-gcc' CFLAGS='-O2 -g -pipe > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools/include > ' CFLAGS_FOR_BUILD='-O2 -g -pipe > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools/include > ' CXXFLAGS='-O2 -g -pipe > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools/include > ' CXXFLAGS_FOR_BUILD='-O2 -g -pipe > -I/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools/include > ' > LDFLAGS='-L/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools/lib > -lstdc++ -lm' CFLAGS_FOR_TARGET=' -mlittle-endian -mcpu=cortex-a15 > -mfpu=neon-vfpv4 -mhard-float ' CXXFLAGS_FOR_TARGET=' > -mlittle-endian -mcpu=cortex-a15 -mfpu=neon-vfpv4 -mhard-float ' > LDFLAGS_FOR_TARGET=' -Wl,-EL ' '/bin/bash' > '/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/src/gcc/configure' > '--build=x86_64-build_pc-linux-gnu' '--host=x86_64-build_pc-linux-gnu' > '--target=arm-cortex_a15-linux-gnueabihf' > '--prefix=/home/avn/x-tools/arm-cortex_a15-linux-gnueabihf' > '--with-sysroot=/home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/sysroot' > '--enable-languages=c,c++' '--with-cpu=cortex-a15' > '--with-fpu=neon-vfpv4' '--with-float=hard' > '--with-pkgversion=crosstool-NG 1.23.0-392-gd274ab06-dirty' > '--enable-__cxa_atexit' '--disable-libmudflap' '--disable-libgomp' > '--disable-libssp' '--disable-libquadmath' > '--disable-libquadmath-support' '--disable-libsanitizer' > '--disable-libmpx' > '--with-gmp=/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools' > '--with-mpfr=/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools' > '--with-mpc=/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools' > '--with-isl=/home/avn/work/ctng/crosstool-ng/.build/arm-cortex_a15-linux-gnueabihf/buildtools' > '--enable-lto' '--with-host-libstdcxx=-static-libgcc > -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' '--enable-threads=posix' > '--enable-target-optspace' '--enable-plugin' '--enable-gold' > '--disable-nls' '--disable-multilib' > '--with-local-prefix=/home/avn/x-tools/arm-cortex_a15-linux-gnueabihf/arm-cortex_a15-linux-gnueabihf/sysroot' > '--enable-long-long' > > The problem, as far as I understand, is that libatomic unconditionally > adds -march=armv7-a for arm-*-linux configurations; here is a fragment > of its Makefile.am: > > ## On a target-specific basis, include alternates to be selected by IFUNC. > if HAVE_IFUNC > ... > if ARCH_ARM_LINUX > IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64 > libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix > _$(s)_1_.lo,$(SIZEOBJS))) > libatomic_la_LIBADD += $(addsuffix _8_2_.lo,$(SIZEOBJS)) > endif > > The -mcpu=cortex-a15 comes from the CPU selected during configure. > > Is --with-cpu still allowed for ARM/Linux targets with GCC8? If it is, > what should be the fix for this - only add -march=... if CPU is not > selected? > I think your problem is that you're trying to override C(XX)FLAGS_FOR_TARGET with options that contain a CPU. That means that the settings from that variable are conflicting with those added by the makefile - so it's nothing to do with the configure's --with-cpu option. R. > Regards, > Alexey. >