# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/musl/musl.conf # Copyright (C) 2018 - 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- if atstage toolchain; then var_append confopt ' ' '--prefix=$sysroot --includedir=$sysroot$includedir' var_remove_regex confopt ' ' '--host=.*' # overrides --target=, ..! makeopt= var_remove makeinstopt ' ' 'install' var_append makeinstopt ' ' 'install-headers' fi [ "$SDECFG_X8664_X32" = 1 ] && var_append patchfiles ' ' "$confdir/*.patch.x32" musl_postinstall() { # Musl's dynamic linker comes with ldd functionality built in # so just create a symlink from ld-musl-... # TODO: fix linker to use $libdir (lib64) local cpu=`echo $arch | arch2uname` [ "$SDECFG_X8664_X32" = 1 ] && cpu=x32 ln -sfv ../../lib/ld-musl-$cpu.so.1 $root$bindir/ldd # Install ld.so.conf # local slibdir="${libdir##*/}" if [ $slibdir != lib ]; then cat > ld-musl.path <<-EOT /$slibdir /lib /usr/$slibdir /usr/lib /usr/X11/$slibdir /usr/X11/lib /opt/*/$slibdir /opt/*/lib /usr/local/$slibdir /usr/local/lib EOT else cat > ld-musl.path <<-EOT /lib /usr/lib /usr/X11/lib /opt/*/lib /usr/local/lib EOT fi mv -vf ld-musl.path $root/etc/ld-musl-$cpu.path # for binutils to find the non /usr paths, TODO: patch binutils! ln -svf ld-musl-$cpu.path $root/etc/ld.so.conf } hook_add premake 5 'touch include/{*/,}* arch/*/bits/*.h' hook_add postinstall 5 'musl_postinstall'