cp (and potentially mkdir -p) are not atomic, and we have seen situations where two packages
concurrently copying the same file (eg. the udev rule for xf86-video-nvidia and
xf86-video-nvidia-legacy) will succeed for one package but the other package fails with
a "file exists" error (as the file didn't exist when it checked, but does exist when it
actually copies the file). Not even cp -f will avoid this issue.
There are several workarounds, but the most practical (and general) solution is to ensure
sequential updates of the image and shared sysroot directories.
Instead of cluttering $BUILD we now have
- $BUILD/build sources and builds of packages
- $BUILD/install_pkg installed packages
- $BUILD/install_init installed packages for initramfs
- follow symlinks (as used by RPi/Slice)
- don't include hidden files like vi swap files (lol)
- remove duplicates (like $LINUX_DEPENDS for linux itself)
- sort by filename, not by hash
- don't use one sha256sum process per file, use xargs to pass all files to
one process.
llvm-config is a compiled host binary used to get infos about the
target installation (sic). It currently lives in the target sysroot,
which may not be usable because now we're mixing build host and
target libraries:
toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/bin/llvm-config-host:
relocation error: /lib/x86_64-linux-gnu/libpthread.so.0: symbol
__libc_vfork version GLIBC_PRIVATE not defined in file
libc.so.6 with link time reference
Move it to $TOOLCHAIN/bin where host binaries belong. But llvm-config
doesn't support spitting out a library path from a different prefix than
its own (which explains the placement in sysroot). Patch that in to
prevail sanity.
Then disable the z3 solver so the target doesn't use build host libraries.
But that's broken too, use debian's patch to fix it up (with the
addition to default to "OFF" instead on "ON").
Finally, disable new options and use the build type "MinSizeRel" for the
host as well, courtesy if @MilhouseVH.
- meson needs a host environment for cross-compile
- allow setup_toolchain to setup toolchain based on used build-system
- adjust creation of meson.conf