Build failures with self-build rootfs
Hey,
I currently experience some issues when I built the rootfs myself.
It looks like there are issues with GLIBC on the rootfs.
Reproduce with:
debos --scratchsize=4G rootfs.yaml
And then enter the rootfs via docker with:
mkdir ../example_rootfs
sudo tar -xf gst-build-sdk-rootfs-arm64.tar.gz --directory ../example_rootfs
export SYSROOT=`pwd`/../example_rootfs
# from my merge request basically just clones gstreamer and generates cross-file
./prepare_gstreamer_crossbuild.sh
./docker.sh run
Within the container I build with (for the record this works fine on the board directly):
meson build --cross-file cross-file.txt -Dauto_features=disabled -Dbad=enabled -Dbase=enabled -Dgood=enabled -Dgst-plugins-bad:debugutils=enabled -Dgst-plugins-bad:ivfparse=enabled -Dgst-plugins-bad:v4l2codecs=enabled -Dgst-plugins-bad:videoparsers=enabled -Dgst-plugins-base:app=enabled -Dgst-plugins-base:playback=enabled -Dgst-plugins-base:tools=enabled -Dgst-plugins-base:typefind=enabled -Dgst-plugins-base:videoconvert=enabled -Dgst-plugins-good:matroska=enabled -Dgstreamer:tools=enabled -Dwrap_mode=nofallback -Dgst-plugins-good:v4l2=enabled -Dgst-plugins-base:videotestsrc=enabled -Dgst-plugins-base:rawparse=enabled -Dbackend=ninja
The used cross-file looks like this:
[host_machine]
system = 'linux'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'
[properties]
sys_root = '/home/basti/Projects/example_rootfs'
pkg_config_libdir = '/home/basti/Projects/example_rootfs/usr/lib/pkgconfig:/home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/pkgconfig:/home/basti/Projects/example_rootfs/usr/share/pkgconfig'
[built-in options]
c_args = ['--sysroot=/home/basti/Projects/example_rootfs']
cpp_args = ['--sysroot=/home/basti/Projects/example_rootfs', '-I/home/basti/Projects/example_rootfs/usr/include/c++/10']
c_link_args = ['--sysroot=/home/basti/Projects/example_rootfs']
cpp_link_args = ['--sysroot=/home/basti/Projects/example_rootfs']
[binaries]
c = 'aarch64-linux-gnu-gcc'
cpp = 'aarch64-linux-gnu-g++'
ar = 'aarch64-linux-gnu-ar'
strip = 'aarch64-linux-gnu-strip'
pkgconfig = 'pkg-config'
Error
The build fails during ninja -C build
uid-1000@basti-XPS-13-9310:/home/basti/Projects/example_rootfs/home/user/gstreamer$ ninja -C build
ninja: Entering directory `build'
[154/589] Linking target subprojects/gstreamer/libs/gst/helpers/gst-ptp-helper
FAILED: subprojects/gstreamer/libs/gst/helpers/gst-ptp-helper
aarch64-linux-gnu-gcc -o subprojects/gstreamer/libs/gst/helpers/gst-ptp-helper subprojects/gstreamer/libs/gst/helpers/gst-ptp-helper.p/gst-ptp-helper.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions --sysroot=/home/basti/Projects/example_rootfs '-Wl,-rpath,$ORIGIN/../../../gst' -Wl,-rpath-link,/home/basti/Projects/example_rootfs/home/user/gstreamer/build/subprojects/gstreamer/gst -Wl,--start-group subprojects/gstreamer/gst/libgstreamer-1.0.so.0.2100.0 /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgio-2.0.so /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgobject-2.0.so /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libglib-2.0.so -lm -Wl,--export-dynamic /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgmodule-2.0.so -pthread /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libcap.so -Wl,--end-group
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libmount.so.1: undefined reference to `fstat@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgio-2.0.so: undefined reference to `fstat64@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libmount.so.1: undefined reference to `lstat@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libmount.so.1: undefined reference to `stat@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgio-2.0.so: undefined reference to `lstat64@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libdl.so.2: undefined reference to `_dl_catch_error_ptr@GLIBC_PRIVATE'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libmount.so.1: undefined reference to `fstatat@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgio-2.0.so: undefined reference to `stat64@GLIBC_2.33'
collect2: error: ld returned 1 exit status
[156/589] Linking target subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner
FAILED: subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner
aarch64-linux-gnu-gcc -o subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner.p/gst-plugin-scanner.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,-Bsymbolic-functions --sysroot=/home/basti/Projects/example_rootfs '-Wl,-rpath,$ORIGIN/../../../gst' -Wl,-rpath-link,/home/basti/Projects/example_rootfs/home/user/gstreamer/build/subprojects/gstreamer/gst -Wl,--start-group subprojects/gstreamer/gst/libgstreamer-1.0.so.0.2100.0 /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgobject-2.0.so /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libglib-2.0.so -Wl,--export-dynamic /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libgmodule-2.0.so -pthread -lm -Wl,--end-group
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libglib-2.0.so: undefined reerence to `fstat64@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libglib-2.0.so: undefined reference to `lstat64@GLIBC_2.33'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/lib/aarch64-linux-gnu/libdl.so.2: undefined reference to `_dl_catch_error_ptr@GLIBC_PRIVATE'
/usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: /home/basti/Projects/example_rootfs/usr/lib/aarch64-linux-gnu/libglib-2.0.so: undefined reference to `stat64@GLIBC_2.33'
collect2: error: ld returned 1 exit status
[163/589] Compiling C object subprojects/gstreamer/plugins/elements/libgstcoreelements.so.p/gstmultiqueue.c.o
ninja: build stopped: subcommand failed.f