I'm trying to compile a simple helloworld kernel module I took from this link with the openwrt SDK for Openwrt 23.0.5.
I'm using:
- Ubuntu 23.10 virtual machine
- gcc 13.3.0
- openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64 which i took from here
I've put the khelloworld kernel module folder inside the -/sdk/package/ folder, afterwards I'm trying to compile it with
make package/khelloworld/compile V=s
which opens a menuconfig while running. I leave the menuconfig unchanged (exit -> save changes) and? after a few moments I get this error:
Summary
#
# No change to .config
#
make[1]: Entering directory '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64'
make[2]: Entering directory '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/package/khelloworld'
touch /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/.prepared_ea4cfd227b712359156b15720f4347d2_18f1e190c5d53547fed41a3eaa76e9e9_check
# Copy sources
mkdir -p /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0
cp -R ./src/* /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/
touch /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/.prepared_ea4cfd227b712359156b15720f4347d2_18f1e190c5d53547fed41a3eaa76e9e9
rm -f /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/.configured_*
rm -f /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/target-x86_64_musl/stamp/.khelloworld_installed
(cd /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/./; if [ -x ./configure ]; then find /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/ -name config.guess | xargs -r chmod u+w; find /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/ -name config.guess | xargs -r -n1 cp --remove-destination /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/scripts/config.guess; find /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/ -name config.sub | xargs -r chmod u+w; find /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/ -name config.sub | xargs -r -n1 cp --remove-destination /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/scripts/config.sub; AR="x86_64-openwrt-linux-musl-gcc-ar" AS="x86_64-openwrt-linux-musl-gcc -c -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0=khelloworld-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD="x86_64-openwrt-linux-musl-ld.bfd" NM="x86_64-openwrt-linux-musl-gcc-nm" CC="x86_64-openwrt-linux-musl-gcc" GCC="x86_64-openwrt-linux-musl-gcc" CXX="x86_64-openwrt-linux-musl-g++" RANLIB="x86_64-openwrt-linux-musl-gcc-ranlib" STRIP=x86_64-openwrt-linux-musl-strip OBJCOPY=x86_64-openwrt-linux-musl-objcopy OBJDUMP=x86_64-openwrt-linux-musl-objdump SIZE=x86_64-openwrt-linux-musl-size CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0=khelloworld-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DCONFIG_HELLO_MOD=1 " CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0=khelloworld-1.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -DCONFIG_HELLO_MOD=1 " CPPFLAGS="-I/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/usr/include -I/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/include -I/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/include/fortify " LDFLAGS="-L/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/usr/lib -L/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/staging_dir/toolchain-x86_64_gcc-13.3.0_musl/lib -fuse-ld=bfd -znow -zrelro " ./configure --target=x86_64-openwrt-linux --host=x86_64-openwrt-linux --build=x86_64-pc-linux-gnu --disable-dependency-tracking --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls ; fi; )
touch /home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/.configured_68b329da9893e34099c7d8ad5cb9c940
make[2]: *** No rule to make target '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/linux-6.6.60/.config', needed by '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/build_dir/target-x86_64_musl/linux-x86_64/khelloworld-1.0/.built'. Stop.
make[2]: Leaving directory '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/package/khelloworld'
time: package/khelloworld/compile#0.19#0.11#0.26
ERROR: package/khelloworld failed to build.
make[1]: *** [package/Makefile:184: package/khelloworld/compile] Error 1
make[1]: Leaving directory '/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64'
make: *** [/home/ubuntu/openwrt-sdk-x86-64_gcc-13.3.0_musl.Linux-x86_64/include/toplevel.mk:241: package/khelloworld/compile] Error 2
If anyone could navigate me to the actual problem I've stumbled upon I would've been extremely thankful.