Compile error: Switch "--with-arch" may not be used with switch "--with-cpu"


I'm trying to upgrade to the latest snapshot. My last snapshot r9551 for my Zyxel NBG6817.

Main modifications are:

  • CONFIG_TARGET_OPTIMIZATION="-O2 -pipe -march=armv7-a+neon-vfpv4 -mtune=cortex-a15"
  • glibc
  • gcc 8.x
  • binutils 2.3

Build system: Arch Linux (latest)

I get the following error compliing the toolchain (gcc):

/openwrt/build_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.3.0_glibc_eabi/gcc-8.3.0/gcc/config.gcc: line 3855: [: missing `]'
Switch "--with-arch" may not be used with switch "--with-cpu"
make[3]: *** [Makefile:4192: configure-gcc] Error 1
make[3]: Leaving directory '/openwrt/build_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.3.0_glibc_eabi/gcc-8.3.0-minimal'
make[2]: *** [Makefile:30: /openwrt/build_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.3.0_glibc_eabi/gcc-8.3.0-minimal/.built] Error 2
make[2]: Leaving directory '/openwrt/toolchain/gcc/minimal'
time: toolchain/gcc/minimal/compile#9.71#3.23#14.57
make[1]: *** [toolchain/Makefile:100: toolchain/gcc/minimal/compile] Error 2
make[1]: Leaving directory '/openwrt'
make: *** [/openwrt/include/ toolchain/install] Fehler 2

I think the file config.gcc is missleading here. Sth. has changed in how the compiler is getting the cpu configuration. Even if I remove all cpu optimizations I cannot compile (same error). What do I have to change?

Any hint would be appriciated.
Kind regards.

So far I have found: (already merged; so not helping here).


hey anomeome,

thank you for your answer. I saw this change on gcc already. I've started from scratch, made a defconf (from old config) and removed any optimizations after. Same error. So I'm kind a confused. But maybe I cannot use the old config and I have to make the whole config from scratch too. Hmm ...

Yes, it requires a distclean (removal of .config due to change), but you can short circuit that a bit and just reconcile the diff into your diffconfig.

1 Like

Thx for pointing this out. I've missed the part that there where bigger changes on kernel this time. Well a lot of work is waiting ...