Skip to content
Snippets Groups Projects
Commit f2891b76 authored by Timo Teräs's avatar Timo Teräs
Browse files

main/musl: new bootstrap

parent 21c6848d
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,8 @@ license="MIT"
depends=""
depends_dev="!uclibc-dev"
makedepends="$depends_dev"
subpackages="$pkgname-dev $pkgname-utils $pkgname-dbg libc6-compat:compat"
subpackages="$pkgname-dev $pkgname-dbg libc6-compat:compat"
[ "$BOOTSTRAP" != "nolibc" ] && subpackages="$subpackages $pkgname-utils"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
ldconfig
......@@ -20,15 +21,13 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
iconv.c
"
_builddir="$srcdir"/musl-$pkgver
builddir="$srcdir"/musl-$pkgver
install_sysroot_headers() {
cd "$_builddir"
if [ -z "${CBUILDROOT}" ]; then
echo "CBUILDROOT not must be set!"
return 1
fi
cd "$builddir"
[ -z "${CBUILDROOT}" ] && die "CBUILDROOT not set"
case "$CARCH" in
aarch64*) ARCH="aarch64" ;;
arm*) ARCH="arm" ;;
x86) ARCH="i386" ;;
x86_64) ARCH="x86_64" ;;
......@@ -38,13 +37,13 @@ install_sysroot_headers() {
}
build() {
cd "$_builddir"
cd "$builddir"
# provide minimal libssp_nonshared.a so we don't need libssp from gcc
${CROSS_COMPILE}gcc $CPPFLAGS $CFLAGS -c "$srcdir"/__stack_chk_fail_local.c -o __stack_chk_fail_local.o || return 1
${CROSS_COMPILE}ar r libssp_nonshared.a __stack_chk_fail_local.o || return 1
if [ "$BOOTSTRAP" != "noutils" ]; then
if [ "$BOOTSTRAP" != "nolibc" ]; then
# getconf/getent/iconv
local i
for i in getconf getent iconv ; do
......@@ -67,7 +66,7 @@ build() {
}
package() {
cd "$_builddir"
cd "$builddir"
make DESTDIR="$pkgdir" install || return 1
cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1
......@@ -77,8 +76,6 @@ package() {
mv -f "$pkgdir"/usr/lib/libc.so "$pkgdir"/lib/"$LDSO" || return 1
ln -sf "$LDSO" "$pkgdir"/lib/libc.musl-${CARCH}.so.1 || return 1
ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/lib/libc.so || return 1
mkdir -p "$pkgdir"/usr/bin
ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/bin/ldd || return 1
# remove libintl.h, currently we don't want by default any NLS
# and use GNU gettext where needed. the plan is to migrate to
......@@ -92,16 +89,13 @@ utils() {
license="MIT BSD GPL2+"
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin
mv "$pkgdir"/usr/bin/ldd "$subpkgdir"/usr/bin
find "$pkgdir" -type d -delete 2>/dev/null
if [ "$BOOTSTRAP" != "noutils" ]; then
install -D \
"$_builddir"/getent \
"$_builddir"/getconf \
"$_builddir"/iconv \
"$subpkgdir"/usr/bin
fi
ln -sf ../../lib/"$LDSO" "$subpkgdir"/usr/bin/ldd || return 1
install -D \
"$builddir"/getent \
"$builddir"/getconf \
"$builddir"/iconv \
"$subpkgdir"/usr/bin
install -D -m755 "$srcdir"/ldconfig "$subpkgdir"/sbin
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment