Error compiling latest master but unclear why

I tried building from master (217877d0) this morning but the compilation ended in errors. Reading through the build log, it's not clear to me why. Any thoughts are appreciated.

My .config and the build log with make V=s.

EDIT: I am thinking the issue might be in my config. If I create a fresh one configuring only luci and my model, the build is successful. I'd like to retain the options in my config if possible. Major differences:

  • Tried to use wolfssl without openssl
  • upstream ath10k driver and firmware
  • luci-app-sqm
  • several modules compiled in (kmod-fs-f2fs, kmod-usb-storage, block-mount)
  • wpad for WPA3
  • several utils compiled in (htop, irqbalance, ethtool, rsync, sqm-scripts)

is it a fresh clone? make distclean?

errors are pretty frequent... maybe some sort of glib thing... definately saw something about irqbalance makefile 580ish...

I have been using the same toolchain for while running make clean between compilations. I just ran make distclean and am rebuilding now and will report back.

doubtful whether the toolchain needed to be gashed, a dirclean or
rm -rf bin tmp build_dir
probably would suffice, when things don't seem right.

1 Like

@darksky Once you delete that gist your post will be useless to anyone with a similar problem. Instead of dumping your output wholesale, you could try filtering it yourself.

Just searching it for 'error' turned up this, and there might be more:

Applying ./patches/100-kernel-compat.patch using plaintext: 
patching file sch_cake.c
Hunk #1 FAILED at 609.
Hunk #2 FAILED at 1624.
2 out of 2 hunks FAILED -- saving rejects to file sch_cake.c.rej
Patch failed!  Please fix ./patches/100-kernel-compat.patch!
make[3]: *** [Makefile:60: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/sched-cake-oot-2020-07-24-48979385/.prepared_257f779263837c3267a0a18fe7894509_6664517399ebbbc92a37c5bb081b5c53] Error 1
make[3]: Leaving directory '/scratch/union/package/kernel/kmod-sched-cake-oot'
time: package/kernel/kmod-sched-cake-oot/compile#0.47#0.18#1.04
make[2]: *** [package/Makefile:113: package/kernel/kmod-sched-cake-oot/compile] Error 2
2 Likes

@Borromini - Good idea. So I manually rebuilt my config and my toolchain but found that the build is still ending in errors.

Here is the complete build log.

Here is grepping for errors and failed:

% grep -i 'error [1,2]\|FAILED' build.log
Hunk #1 FAILED at 609.
Hunk #2 FAILED at 1624.
2 out of 2 hunks FAILED -- saving rejects to file sch_cake.c.rej
Patch failed!  Please fix ./patches/100-kernel-compat.patch!
make[3]: *** [Makefile:60: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/sched-cake-oot-2020-07-24-48979385/.prepared_257f779263837c3267a0a18fe7894509_6664517399ebbbc92a37c5bb081b5c53] Error 1
make[2]: *** [package/Makefile:113: package/kernel/kmod-sched-cake-oot/compile] Error 2
make[6]: *** [Makefile:560: irqbalance] Error 1
make[5]: *** [Makefile:647: all-recursive] Error 1
make[4]: *** [Makefile:456: all] Error 2
make[3]: *** [Makefile:83: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/irqbalance-1.6.0/.built] Error 2
make[2]: *** [package/Makefile:113: package/feeds/packages/irqbalance/compile] Error 2
xshared.c:413:13: warning: inlining failed in call to 'xs_has_arg': call is unlikely and code size would grow [-Winline]
xshared.c:413:13: warning: inlining failed in call to 'xs_has_arg': call is unlikely and code size would grow [-Winline]
make[1]: *** [package/Makefile:107: /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make: *** [/scratch/union/include/toplevel.mk:235: world] Error 2

So it seems I have multiple problems :smiley:

So you solve them one by one. Also, do a grep -C 5 so you can see the text leading up to the error. That's the actual stuff you need. You might need to increase that numer to see more useful output.

Just the 'Error X' output doesn't say anything.

2 Likes

@Borromini - Thanks for the suggestion. In an attempt to minimize the multiple errors, I began building with a simplifed .config and then added in options a few a time. I am building the latest commit which at the time I type this is 9950bc9.

Thus far I can successfully build with these options added:

luci core
kmod-fs-f2fs
kmod-usb-storage
kmod-ath10k
ath10k-firmware-qca9984
wpad-wolfssl
htop
rsync
rsyncd

I experience the first error when I add in irqbalance to list of things.

% grep -i 'error [1,2]\|FAILED' -C 10 build.log
echo "htop" >> /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/htop.default.install
make[3]: Leaving directory '/scratch/union/feeds/packages/admin/htop'
time: package/feeds/packages/htop/compile#0.13#0.04#0.30
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o ldblib.o ldblib.c
make[3]: Entering directory '/scratch/union/package/utils/mtd-utils'

../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/meson.build:1:0: ERROR: Compiler gcc can not compile programs.

A full log can be found at /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-build/meson-logs/meson-log.txt
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o liolib.o liolib.c
make[3]: *** [Makefile:143: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/.configured_a17fb5ef857664f03cd0ce37cc5ea591] Error 1
make[3]: Leaving directory '/scratch/union/feeds/packages/libs/glib2'
time: package/feeds/packages/glib2/compile#0.52#0.06#0.74
make[2]: *** [package/Makefile:113: package/feeds/packages/glib2/compile] Error 2
make[2]: *** Waiting for unfinished jobs....
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o lmathlib.o lmathlib.c
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o loslib.o loslib.c
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o ltablib.o ltablib.c
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o lstrlib.o lstrlib.c
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o loadlib.o loadlib.c
make[3]: Leaving directory '/scratch/union/package/system/opkg'
time: package/system/opkg/host-compile#0.41#0.12#0.96
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o linit.o linit.c
arm-openwrt-linux-muslgnueabi-gcc -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lua-5.1.5=lua-5.1.5 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DLUA_USE_LINUX -fpic -std=gnu99   -c -o lua.o lua.c
--
install -m0644 /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/ath10k/QCA9984/hw1.0/board-2.bin /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/.pkgdir/ath10k-firmware-qca9984/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
install -m0644 /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/ath10k/QCA9984/hw1.0/firmware-5.bin /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/.pkgdir/ath10k-firmware-qca9984/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
touch /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/.pkgdir/ath10k-firmware-qca9984.installed
mkdir -p /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/stamp
SHELL= flock /scratch/union/tmp/.root-copy.flock -c 'cp -fpR /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-firmware-20200619/.pkgdir/ath10k-firmware-qca9984/. /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/'
touch /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/root-ipq806x/stamp/.ath10k-firmware-qca9984_installed
echo "ath10k-firmware-qca9984" >> /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pkginfo/linux-firmware.default.install
make[3]: Leaving directory '/scratch/union/package/firmware/linux-firmware'
time: package/firmware/linux-firmware/compile#5.54#0.93#6.01
make[2]: Leaving directory '/scratch/union'
make[1]: *** [package/Makefile:107: /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:235: world] Error 2

Complete build log.

It seems my compiler is unfit?

../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/meson.build:1:0: ERROR: Compiler gcc can not compile programs.

Here is meson-log.txt to which it referred:

% cat /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-build/meson-logs/meson-log.txt
Build started at 2020-08-01T12:32:46.013100
Main binary: /scratch/union/staging_dir/host/bin/python
Build Options: -Diconv=external -Dselinux=disabled -Dlibmount=disabled -Dinternal_pcre=true -Dman=false -Ddtrace=false -Dsystemtap=false -Dgtk_doc=false -Dbsymbolic_functions=true -Dforce_posix_threads=true -Dfam=false -Dinstalled_tests=false -Dnls=disabled -Doss_fuzz=disabled -Dglib_assert=false -Dglib_checks=false -Dxattr=true -Db_lto=true -Dbuildtype=plain '--cross-file /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-cross.txt' '--native-file /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-native.txt'
Python system: Linux
The Meson build system
Version: 0.55.0
Source dir: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0
Build dir: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-build
Build type: cross build
None of 'PKG_CONFIG_PATH_FOR_BUILD' are defined in the environment, not changing global flags.
Using 'PKG_CONFIG_PATH' from environment with value: '/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig'
Project name: glib
Project version: 2.65.0
None of 'CFLAGS_FOR_BUILD' are defined in the environment, not changing global flags.
None of 'LDFLAGS_FOR_BUILD' are defined in the environment, not changing global flags.
None of 'CPPFLAGS_FOR_BUILD' are defined in the environment, not changing global flags.
None of 'CC_LD_FOR_BUILD' are defined in the environment, not changing global flags.
Sanity testing C compiler: gcc
Is cross compiler: False.
None of 'CC_LD_FOR_BUILD' are defined in the environment, not changing global flags.
Sanity check compiler command line: gcc /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-build/meson-private/sanitycheckc.c -o /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/openwrt-build/meson-private/sanitycheckc.exe -O2 -I/scratch/union/staging_dir/host/include -I/scratch/union/staging_dir/hostpkg/include -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/host/include -I/scratch/union/staging_dir/host/include -I/scratch/union/staging_dir/hostpkg/include -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/host/include -pipe -D_FILE_OFFSET_BITS=64 -L/scratch/union/staging_dir/host/lib -L/scratch/union/staging_dir/hostpkg/lib -L/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/host/lib -liconv -Wl,-rpath,/scratch/union/staging_dir/hostpkg/lib
Sanity check compile stdout:

-----
Sanity check compile stderr:
/usr/bin/ld: cannot find -liconv
collect2: error: ld returned 1 exit status

-----

../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/meson.build:1:0: ERROR: Compiler gcc can not compile programs.

You shouldn't be adding stuff, start with just a default OpenWrt .config. See if that works, if it does, scale up. That's the most sane way to approach this.

That being said, you've run into an issue which I hit myself, which is an iconv issue. There's another thread here on the forum which seems to be related as well:

Ping @hnyman @neheb - I have been bitten by something similar in the past few days and have found the following on the OpenWrt github (was an iconv/glib2 issue as well). This was a clean master, fully up to date with a few lingering patches on top (r14001+9-9950bc92e3).

And:

I have worked around this by removing -liconv from the HOST_LDFLAGS as done here:

@darksky Remove that single line from that Makefile, do a make package/glib2/clean and run another build.

1 Like

Thanks. That fixed the build.

@castiel652 Did you have a similar thread open for this? I flagged some of the people involved, let's hope this can get fixed.

No I didn't.
But someone opened an issue on github.

1 Like

What you described is precisely the approach I took. Perhaps I wasn't clear enough when I posted. Thank you for the detailed reply and all the research you invested to type it, by the way.

So based on https://github.com/openwrt/packages/pull/11887, I sought to remove that offending line from feeds/packages/libs/glib2/Makefile (version 2.65.0-3 is what is current in master) which seems to be:

HOST_LDFLAGS += -liconv -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib

Rather than zapping the entire line, I removed the -liconv token leaving the rest intact:

HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOSTPKG)/lib

I previously ran a make clean so I was unable to run make package/glib2/clean but compiling with that particular modification with the identical .config completed without error. So this first part is solved!

Now I need to see if I can use this modification to get the cake stuff to build. I am currently trying with the last .config that just built after enabling the option for luci-app-sqm). I will post back either way. Thanks again for your help!

So adding the option to build luci-app-sqm as the only change to my .config (retaining the modified HOST_LDFLAGS mentioned above) also failed but for different reasons.

% grep -i 'error [1,2]\|FAILED' -C 10 log 
make[4]: Leaving directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3=ubus-2020-02-05-171469e3 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -flto  -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3=ubus-2020-02-05-171469e3 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -flto  -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include " LDFLAGS="-L/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -L/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/lib -L/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/lib -L/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/lib -fpic -specs=/scratch/union/include/hardened-ld-pie.specs -znow -zrelro -flto " make -C /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3/. AR="arm-openwrt-linux-muslgnueabi-gcc-ar" AS="arm-openwrt-linux-muslgnueabi-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3=ubus-2020-02-05-171469e3 -Wformat -Werror=format-security -fpic -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -flto" LD=arm-openwrt-linux-muslgnueabi-ld NM="arm-openwrt-linux-muslgnueabi-gcc-nm" CC="arm-openwrt-linux-muslgnueabi-gcc" GCC="arm-openwrt-linux-muslgnueabi-gcc" CXX="arm-openwrt-linux-muslgnueabi-g++" RANLIB="arm-openwrt-linux-muslgnueabi-gcc-ranlib" STRIP=arm-openwrt-linux-muslgnueabi-strip OBJCOPY=arm-openwrt-linux-muslgnueabi-objcopy OBJDUMP=arm-openwrt-linux-muslgnueabi-objdump SIZE=arm-openwrt-linux-muslgnueabi-size CROSS="arm-openwrt-linux-muslgnueabi-" ARCH="arm" CMAKE_COMMAND='/scratch/union/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 DESTDIR="/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3/ipkg-install"  install;

Applying ./patches/100-kernel-compat.patch using plaintext: 
make[4]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
depbase=`echo SwapMeter.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
arm-openwrt-linux-muslgnueabi-gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include  -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/etc\" -I"./linux" -rdynamic -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/htop-2.2.0=htop-2.2.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -MT SwapMeter.o -MD -MP -MF $depbase.Tpo -c -o SwapMeter.o SwapMeter.c &&\
mv -f $depbase.Tpo $depbase.Po
make[5]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
patching file sch_cake.c
Hunk #1 FAILED at 609.
Hunk #2 FAILED at 1624.
2 out of 2 hunks FAILED -- saving rejects to file sch_cake.c.rej
Patch failed!  Please fix ./patches/100-kernel-compat.patch!
make[3]: *** [Makefile:60: /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/sched-cake-oot-2020-07-24-48979385/.prepared_257f779263837c3267a0a18fe7894509_6664517399ebbbc92a37c5bb081b5c53] Error 1
make[3]: Leaving directory '/scratch/union/package/kernel/kmod-sched-cake-oot'
make[6]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
time: package/kernel/kmod-sched-cake-oot/compile#0.47#0.20#1.64
make[2]: *** [package/Makefile:113: package/kernel/kmod-sched-cake-oot/compile] Error 2
make[2]: *** Waiting for unfinished jobs....
depbase=`echo TasksMeter.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
arm-openwrt-linux-muslgnueabi-gcc -DHAVE_CONFIG_H -I.  -DNDEBUG -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include  -pedantic -Wall -Wextra -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"/etc\" -I"./linux" -rdynamic -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/htop-2.2.0=htop-2.2.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -MT TasksMeter.o -MD -MP -MF $depbase.Tpo -c -o TasksMeter.o TasksMeter.c &&\
mv -f $depbase.Tpo $depbase.Po
make[6]: Leaving directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
rm pppol2tp.o openl2tp.o
make[6]: Leaving directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/ppp-default/ppp-2.4.8.git-2020-05-25/pppd/plugins/pppol2tp'
[ 25%] Built target ubus
make[6]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/ppp-default/ppp-2.4.8.git-2020-05-25/pppd/plugins/pptp'
make[6]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
--
arm-openwrt-linux-muslgnueabi-gcc -DHAVE_CONFIG_H -I. -I..  -D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 -D_REENTRANT 	-DXTABLES_LIBDIR=\"/usr/lib/iptables\" -DXTABLES_INTERNAL -I../include -I../include -I.. -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include/uapi -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include/uapi -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include    -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/iptables-1.8.4/include -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include -I/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/usr/include -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include/fortify -I/scratch/union/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-8.4.0_musl_eabi/include  -Wall -Waggregate-return -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes 	-Wlogical-op 	-Winline -pipe -DALL_INCLUSIVE -DENABLE_IPV4 -DENABLE_IPV6 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -mfloat-abi=hard -ffile-prefix-map=/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/iptables-1.8.4=iptables-1.8.4 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/iptables-1.8.4/include -I/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/linux-5.4.52/user_headers/include -ffunction-sections -fdata-sections -DNO_LEGACY  -MT xtables_legacy_multi-iptables-save.o -MD -MP -MF .deps/xtables_legacy_multi-iptables-save.Tpo -c -o xtables_legacy_multi-iptables-save.o `test -f 'iptables-save.c' || echo './'`iptables-save.c
@
checking for arm-openwrt-linux-strip... (cached) arm-openwrt-linux-muslgnueabi-strip
checking for arm-openwrt-linux-ranlib... arm-openwrt-linux-muslgnueabi-gcc-ranlib
checking command to parse arm-openwrt-linux-muslgnueabi-gcc-nm output from arm-openwrt-linux-muslgnueabi-gcc object... mv -f .deps/xtables_legacy_multi-iptables-save.Tpo .deps/xtables_legacy_multi-iptables-save.Po
sed \
	-e '/@MATCH@/ r ../extensions/matches.man' \
	-e '/@TARGET@/ r ../extensions/targets.man' iptables-extensions.8.tmpl >iptables-extensions.8;
mv -f .deps/xtables_legacy_multi-iptables-restore.Tpo .deps/xtables_legacy_multi-iptables-restore.Po
xshared.c: In function 'parse_wait_time':
xshared.c:413:13: warning: inlining failed in call to 'xs_has_arg': call is unlikely and code size would grow [-Winline]
 inline bool xs_has_arg(int argc, char *argv[])
             ^~~~~~~~~~
xshared.c:327:13: note: called from here
  } else if (xs_has_arg(argc, argv))
             ^~~~~~~~~~~~~~~~~~~~~~
xshared.c: In function 'parse_wait_interval':
xshared.c:413:13: warning: inlining failed in call to 'xs_has_arg': call is unlikely and code size would grow [-Winline]
 inline bool xs_has_arg(int argc, char *argv[])
             ^~~~~~~~~~
xshared.c:343:11: note: called from here
  else if (xs_has_arg(argc, argv))
           ^~~~~~~~~~~~~~~~~~~~~~
mv -f .deps/xtables_legacy_multi-iptables-xml.Tpo .deps/xtables_legacy_multi-iptables-xml.Po
ok
mv -f .deps/xtables_legacy_multi-xshared.Tpo .deps/xtables_legacy_multi-xshared.Po
checking for sysroot... no
checking for arm-openwrt-linux-mt... no
--
install -d -m0755 /scratch/union/tmp/stage-glib2/usr/share/glib-2.0
cp -fpR /scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/glib-2.65.0/ipkg-install/usr/share/glib-2.0/codegen /scratch/union/tmp/stage-glib2/usr/share/glib-2.0/
find /scratch/union/tmp/stage-glib2 -name '*.la' | xargs -r rm -f;   	find /scratch/union/tmp/stage-glib2 -name '*.la' | xargs -r rm -f; 
if [ -f /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/packages/glib2.list ]; then /scratch/union/scripts/clean-package.sh "/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/packages/glib2.list" "/scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi"; fi
if [ -d /scratch/union/tmp/stage-glib2 ]; then (cd /scratch/union/tmp/stage-glib2; find ./ > /scratch/union/tmp/stage-glib2.files); 	SHELL= flock /scratch/union/tmp/.staging-dir.flock -c ' mv /scratch/union/tmp/stage-glib2.files /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/packages/glib2.list && cp -fpR /scratch/union/tmp/stage-glib2/* /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/; '; fi
rm -rf /scratch/union/tmp/stage-glib2
touch /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.glib2_installed
make[3]: Leaving directory '/scratch/union/feeds/packages/libs/glib2'
time: package/feeds/packages/glib2/compile#301.16#28.04#117.71
make[2]: Leaving directory '/scratch/union'
make[1]: *** [package/Makefile:107: /scratch/union/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:235: world] Error 2

Complete build log.

I guess the first thing to attack is that offending patch:

make[5]: Entering directory '/scratch/union/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/ubus-2020-02-05-171469e3'
patching file sch_cake.c
Hunk #1 FAILED at 609.
Hunk #2 FAILED at 1624.
2 out of 2 hunks FAILED -- saving rejects to file sch_cake.c.rej
Patch failed!  Please fix ./patches/100-kernel-compat.patch!

It seems that the following lead to a successful build:

  1. The change I outlined above to glib2
  2. Deleting that offending patch (100-kernel-compat.patch)

I am going to mark this as solved since that line above in that particular Makefile fixed a piece of it. I am unsure if deleting 100-kernel-compat.patch was the right thing to do.

EDIT: Grrr... when I compare my tree to a freshly pulled tree, there is no package/kernel/kmod-sched-cake-oot/patches/100-kernel-compat.patch at all. I am not understanding how my copy got out of sync.

To summarize, I only needed to do a fresh pull, then modify a single file has I posted about above to get the build to work:

git status

in the questionable tree indicate extra file. Has that last push by neheb not resolved the iconv issue for you, fixed things up on ubuntu for me.

I just fetched the latest commit against openwrt/master but I did not see anything relevant/that file is still intact.

You need to update your packages feed. That's where you had to edit the Makefile as well.

I did. I have a script called prebuild.sh which:

#!/bin/bash
  
PREFIX=$(pwd)
git fetch upstream || exit 1
git checkout master || exit 1
git rebase upstream/master || exit 1
"$PREFIX"/scripts/feeds update -a || exit 1
"$PREFIX"/scripts/feeds install -a || exit 1

Just for completeness, here is my .git/config:

[core]
  repositoryformatversion = 0
  filemode = true
  bare = false
  logallrefupdates = true
[remote "origin"]
  url = git@github.com:graysky2/openwrt.git
  fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
  remote = origin
  merge = refs/heads/master
[remote "upstream"]
  url = https://github.com/openwrt/openwrt.git
  fetch = +refs/heads/*:refs/remotes/upstream/*

As I typed this reply, I see it pulled down an update to feeds/packages/libs/glib2/Makefile which is now version 2.65.0-3 and it contains the modified HOST_LDFLAGS ... I cannot explain why the lag vs. yesterday.

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