od-contrib / buildroot-rg350-old-kernel

Buildroot for RG350 with modern userland but using the old 3.12 Linux kernel
Other
11 stars 4 forks source link

Image compilation fails during step: "host-squashfs 4.4" #8

Closed shagu closed 4 years ago

shagu commented 4 years ago

Host: OS: Archlinux (amd64) GCC: gcc version 10.2.0 (GCC)

$ board/opendingux/gcw0/make_initial_image.sh rg350
#
# configuration written to /home/user/downloads/buildroot-rg350-old-kernel/.config
#
/usr/bin/make -j1 O=/home/user/downloads/buildroot-rg350-old-kernel/output HOSTCC="/usr/bin/gcc" HOSTCXX="/usr/bin/g++" syncconfig
make[1]: Entering directory '/home/user/downloads/buildroot-rg350-old-kernel'
make[1]: Leaving directory '/home/user/downloads/buildroot-rg350-old-kernel'
>>> host-squashfs 4.4 Building
PATH="/home/user/downloads/buildroot-rg350-old-kernel/output/host/bin:/home/user/downloads/buildroot-rg350-old-kernel/output/host/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/bin:/sbin:/usr/sbin:/home/eric/Applications/scripts" PKG_CONFIG="/home/user/downloads/buildroot-rg350-old-kernel/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/user/downloads/buildroot-rg350-old-kernel/output/host/lib/pkgconfig:/home/user/downloads/buildroot-rg350-old-kernel/output/host/share/pkgconfig" /usr/bin/make -j17 CC="/usr/bin/gcc" EXTRA_CFLAGS="-O2 -I/home/user/downloads/buildroot-rg350-old-kernel/output/host/include" EXTRA_LDFLAGS="-L/home/user/downloads/buildroot-rg350-old-kernel/output/host/lib -Wl,-rpath,/home/user/downloads/buildroot-rg350-old-kernel/output/host/lib" XATTR_SUPPORT=1 XZ_SUPPORT=1 GZIP_SUPPORT=1 LZ4_SUPPORT=1 LZO_SUPPORT=1 LZMA_XZ_SUPPORT=1 ZSTD_SUPPORT=1 -C /home/user/downloads/buildroot-rg350-old-kernel/output/build/host-squashfs-4.4/squashfs-tools/
make[1]: Entering directory '/home/user/downloads/buildroot-rg350-old-kernel/output/build/host-squashfs-4.4/squashfs-tools'
/usr/bin/gcc  -L/home/user/downloads/buildroot-rg350-old-kernel/output/host/lib -Wl,-rpath,/home/user/downloads/buildroot-rg350-old-kernel/output/host/lib mksquashfs.o read_fs.o action.o swap.o pseudo.o compressor.o sort.o progressbar.o read_file.o info.o restore.o process_fragments.o caches-queues-lists.o gzip_wrapper.o lzma_xz_wrapper.o xz_wrapper.o lzo_wrapper.o lz4_wrapper.o zstd_wrapper.o xattr.o read_xattrs.o -lpthread -lm -lz -llzma -llzma  -llzo2 -llz4 -lzstd -o mksquashfs
/usr/bin/ld: read_fs.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: read_fs.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: action.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: action.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: sort.o:(.bss+0x100000): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: sort.o:(.bss+0x100008): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: info.o:(.bss+0x10): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: info.o:(.bss+0x8): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: restore.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: restore.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: process_fragments.o:(.bss+0x0): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: process_fragments.o:(.bss+0x8): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
/usr/bin/ld: xattr.o:(.bss+0x8): multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
/usr/bin/ld: xattr.o:(.bss+0x10): multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:284: mksquashfs] Error 1
make[1]: Leaving directory '/home/user/downloads/buildroot-rg350-old-kernel/output/build/host-squashfs-4.4/squashfs-tools'
make: *** [package/pkg-generic.mk:269: /home/user/downloads/buildroot-rg350-old-kernel/output/build/host-squashfs-4.4/.stamp_built] Error 2
shagu commented 4 years ago

I got it solved by this patch:

diff --git a/package/squashfs/squashfs-001-fno-common.patch b/package/squashfs/squashfs-001-fno-common.patch
new file mode 100644
index 0000000000..e7a1b54f8c
--- /dev/null
+++ b/package/squashfs/squashfs-001-fno-common.patch
@@ -0,0 +1,11 @@
+--- a/squashfs-tools/mksquashfs.h
++++ b/squashfs-tools/mksquashfs.h
+@@ -143,7 +143,7 @@ struct append_file {
+ #endif
+
+ extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
+-struct cache *bwriter_buffer, *fwriter_buffer;
++extern struct cache *bwriter_buffer, *fwriter_buffer;
+ extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
+       *to_frag, *locked_fragment, *to_process_frag;
+ extern struct append_file **file_mapping;

Taken from Gentoo.

It's probably only an issue to more recent host-environments since this worked fine on my debian chroot.

shagu commented 4 years ago

Fixed by: https://github.com/od-contrib/buildroot-rg350-old-kernel/commit/8d7b714027b451df6b202cee5d85ff6bbf3fe624 (https://github.com/od-contrib/buildroot-rg350-old-kernel/issues/10)