The previous approach appended TERMUX_PREFIX to the empty default sysroot, which would
render those paths useless if the --sysroot command-line flag was ever set. With this
approach, clang reuses much more of the existing sysroot logic and makes it more
likely that a passed-in sysroot will work.
Also, remove the rpath for alternate architectures, as it wasn't working.
This new variable is extremely useful when iterating on creating a large package,
as otherwise you have to wipe the source and rebuild each time you make a mistake
with the patches or build.sh script.
Simply set TERMUX_PKG_QUICK_REBUILD=true in build.sh if a build fails and then the
TERMUX_PKG_SRCDIR and TERMUX_PKG_BUILDDIR will not be touched when you rebuild,
including that the patches will not be applied again. When you're done iterating,
diff for any new patches, save them, and remove this variable before rebuilding
from scratch, hopefully for the last time. ;)
An example is shown for the giant libllvm package, where other modifications are
also excluded if this variable is set.
Variables
TERMUX_PKG_PLATFORM_INDEPENDENT
TERMUX_DEBUG
TERMUX_PKG_HAS_DEBUG
TERMUX_PKG_ESSENTIAL
TERMUX_SUBPKG_ESSENTIAL
TERMUX_PKG_NO_STATICSPLIT
TERMUX_PKG_BUILD_IN_SRC
TERMUX_PKG_FORCE_CMAKE
TERMUX_PKG_HOSTBUILD
should not accept arbitrary values for marking them "enabled". Instead
they should accept boolean values which makes them easier to handle and
also makes their meaning clear.
build-package.sh should make decision based on variable's value but not on
whether it is set or empty.
%ci:no-build
Without this patch, libm will be linked before libgcc (which is a linker script that links to both libunwind and libgcc_real); as libm.so in our system exports unwind symbols, it prevents the built objects from being linked to the unwinders properly.
Since libm is a part of bionic, we can't ship it like we do for libc++_shared or zlib. Therefore, patching clang++ is probably the only way.