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" ...@@ -10,7 +10,8 @@ license="MIT"
depends="" depends=""
depends_dev="!uclibc-dev" depends_dev="!uclibc-dev"
makedepends="$depends_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 source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
ldconfig ldconfig
...@@ -20,15 +21,13 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz ...@@ -20,15 +21,13 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
iconv.c iconv.c
" "
_builddir="$srcdir"/musl-$pkgver builddir="$srcdir"/musl-$pkgver
install_sysroot_headers() { install_sysroot_headers() {
cd "$_builddir" cd "$builddir"
if [ -z "${CBUILDROOT}" ]; then [ -z "${CBUILDROOT}" ] && die "CBUILDROOT not set"
echo "CBUILDROOT not must be set!"
return 1
fi
case "$CARCH" in case "$CARCH" in
aarch64*) ARCH="aarch64" ;;
arm*) ARCH="arm" ;; arm*) ARCH="arm" ;;
x86) ARCH="i386" ;; x86) ARCH="i386" ;;
x86_64) ARCH="x86_64" ;; x86_64) ARCH="x86_64" ;;
...@@ -38,13 +37,13 @@ install_sysroot_headers() { ...@@ -38,13 +37,13 @@ install_sysroot_headers() {
} }
build() { build() {
cd "$_builddir" cd "$builddir"
# provide minimal libssp_nonshared.a so we don't need libssp from gcc # 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}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 ${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 # getconf/getent/iconv
local i local i
for i in getconf getent iconv ; do for i in getconf getent iconv ; do
...@@ -67,7 +66,7 @@ build() { ...@@ -67,7 +66,7 @@ build() {
} }
package() { package() {
cd "$_builddir" cd "$builddir"
make DESTDIR="$pkgdir" install || return 1 make DESTDIR="$pkgdir" install || return 1
cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1 cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1
...@@ -77,8 +76,6 @@ package() { ...@@ -77,8 +76,6 @@ package() {
mv -f "$pkgdir"/usr/lib/libc.so "$pkgdir"/lib/"$LDSO" || return 1 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 "$LDSO" "$pkgdir"/lib/libc.musl-${CARCH}.so.1 || return 1
ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/lib/libc.so || 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 # remove libintl.h, currently we don't want by default any NLS
# and use GNU gettext where needed. the plan is to migrate to # and use GNU gettext where needed. the plan is to migrate to
...@@ -92,16 +89,13 @@ utils() { ...@@ -92,16 +89,13 @@ utils() {
license="MIT BSD GPL2+" license="MIT BSD GPL2+"
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin
mv "$pkgdir"/usr/bin/ldd "$subpkgdir"/usr/bin ln -sf ../../lib/"$LDSO" "$subpkgdir"/usr/bin/ldd || return 1
find "$pkgdir" -type d -delete 2>/dev/null
install -D \
if [ "$BOOTSTRAP" != "noutils" ]; then "$builddir"/getent \
install -D \ "$builddir"/getconf \
"$_builddir"/getent \ "$builddir"/iconv \
"$_builddir"/getconf \ "$subpkgdir"/usr/bin
"$_builddir"/iconv \
"$subpkgdir"/usr/bin
fi
install -D -m755 "$srcdir"/ldconfig "$subpkgdir"/sbin 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