Linking busybox fails with `cc1: note: someone does not honour COPTS correctly, passed 0 times`. Any ideas?

Ahoj,

I am trying to build OpenWRT 22.03 git branch with the following configuration:

Configuration:

Target:

  • grep -i target .config | grep -v '^#':
    CONFIG_TARGET_sunxi=y
    CONFIG_TARGET_sunxi_cortexa7=y
    CONFIG_TARGET_sunxi_cortexa7_DEVICE_xunlong_orangepi-plus=y
    CONFIG_HAS_SUBTARGETS=y
    CONFIG_TARGET_BOARD="sunxi"
    CONFIG_TARGET_SUBTARGET="cortexa7"
    CONFIG_TARGET_PROFILE="DEVICE_xunlong_orangepi-plus"
    CONFIG_TARGET_ARCH_PACKAGES="arm_cortex-a7_neon-vfpv4"
    [...]
    
  • grep -i target_optimization .config:
    CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe"
    CONFIG_TARGET_OPTIMIZATION="-O3 -pipe -g0"
    

Busybox configuration:

grep -i busybox .config (89 KiB, 2045 lines).

Full configuration:

→ Download .config (384 KiB, 10970 lines).

Host:

I am compiling on x86_64, GNU/Linux.

Problem:

When it comes to compile busybox, it fails with cc1: note: someone does not honour COPTS correctly, passed 0 times.

Last lines of the output of ake -j1 V=sc package/utils/busybox/clean && make -j1 V=sc package/utils/busybox/compile:

[...]
/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/busybox-default/busybox-1.35.0/scripts/trylink "busybox_unstripped" "ccache_cc" "-Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wdeclaration-after-statement -Wold-style-definition -finline-limit=0 -fno-builtin-strlen -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin-printf -Os -fpie -pie" " -L/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/usr/lib -L/[...]/openwrt-22.03/staging_dir/toolchain-arm_cortex-a7+neon-vfpv4_gcc-11.2.0_musl_eabi/lib -DPIC -fpic -specs=/[...]/openwrt-22.03/include/hardened-ld-pie.specs -znow -zrelro -flto=jobserver -fuse-linker-plugin" " applets/built-in.o" " archival/lib.a  archival/libarchive/lib.a  console-tools/lib.a  coreutils/lib.a  coreutils/libcoreutils/lib.a  debianutils/lib.a  klibc-utils/lib.a  e2fsprogs/lib.a  editors/lib.a  findutils/lib.a  init/lib.a  libbb/lib.a  libpwdgrp/lib.a  loginutils/lib.a  mailutils/lib.a  miscutils/lib.a  modutils/lib.a  networking/lib.a  networking/libiproute/lib.a  networking/udhcp/lib.a  printutils/lib.a  procps/lib.a  runit/lib.a  selinux/lib.a  shell/lib.a  sysklogd/lib.a  util-linux/lib.a  util-linux/volume_id/lib.a  archival/built-in.o  archival/libarchive/built-in.o  console-tools/built-in.o  coreutils/built-in.o  coreutils/libcoreutils/built-in.o  debianutils/built-in.o  klibc-utils/built-in.o  e2fsprogs/built-in.o  editors/built-in.o  findutils/built-in.o  init/built-in.o  libbb/built-in.o  libpwdgrp/built-in.o  loginutils/built-in.o  mailutils/built-in.o  miscutils/built-in.o  modutils/built-in.o  networking/built-in.o  networking/libiproute/built-in.o  networking/udhcp/built-in.o  printutils/built-in.o  procps/built-in.o  runit/built-in.o  selinux/built-in.o  shell/built-in.o  sysklogd/built-in.o  util-linux/built-in.o  util-linux/volume_id/built-in.o" "" """" && /[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/busybox-default/busybox-1.35.0/scripts/generate_BUFSIZ.sh --post include/common_bufsiz.h
Trying libraries: 
Final link with: <none>
cc1: note: someone does not honour COPTS correctly, passed 0 times
make[3]: *** [Makefile:719: busybox_unstripped] Error 1
make[3]: Leaving directory '/[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/busybox-default/busybox-1.35.0'
make[2]: *** [Makefile:166: /[...]/openwrt-22.03/build_dir/target-arm_cortex-a7+neon-vfpv4_musl_eabi/busybox-default/busybox-1.35.0/.built] Error 2
make[2]: Leaving directory '/[...]/openwrt-22.03/package/utils/busybox'
time: package/utils/busybox/default/compile#158.18#15.21#176.89
    ERROR: package/utils/busybox failed to build (build variant: default).
make[1]: *** [package/Makefile:116: package/utils/busybox/compile] Error 1
make[1]: Leaving directory '/[...]/openwrt-22.03'
make: *** [/[...]/openwrt-22.03/include/toplevel.mk:230: package/utils/busybox/compile] Error 2

→ Full output of make -j1 V=sc package/utils/busybox/compile (990 KiB, 1993 lines).

Questions:

Does anyone has an idea what is failing here and how I could fix it? Is it a bug to be reported or an issue on my side? I was internet-searching for cc1: note: someone does not honour COPTS correctly, passed 0 times but did not find anything useful.

Note that I don't know almost anything about C, the linker, and so on, and I completely do not understand the error message (I don't know what COPTS is meaning).

Regards!

When I use default configuration for busybox (removing all lines containing BUSYBOX from .config, running make defconfig to re-generate defaults, then running make), it builds fine.

An issue has been opened: → Here.

I never met this on making a build on openwrt original codes.

But when I compile my personal package c++ code, it happened. Refer google, I solved this:

(in Makefile):

org:	cd $(PKG_BUILD_DIR)/paho.mqtt.c && CC=$(TARGET_CC) AR=$(TARGET_AR) ../serial2mqtt/makePaho.sh
mod:	cd $(PKG_BUILD_DIR)/paho.mqtt.c && CC='$(TARGET_CC) -fhonour-copts' AR=$(TARGET_AR) ../serial2mqtt/makePaho.sh
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^         

the complete files:
https://github.com/RadioOperator/openwrt-serial2mqtt/blob/master/Makefile

I found out what is causing this: Having the option
"Use the end of BSS page" (CONFIG_BUSYBOX_CONFIG_FEATURE_USE_BSS_TAIL=y)
activated.

Setting CONFIG_BUSYBOX_CONFIG_FEATURE_USE_BSS_TAIL=n makes busybox build without this error in customised configuration.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.