diff options
author | Timo Teräs <timo.teras@iki.fi> | 2017-02-17 07:44:24 +0000 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2017-02-17 08:22:03 +0000 |
commit | a95a079d7a562e73276448362141171bef668cab (patch) | |
tree | 810dd65e7772b76de91734556092be72843be003 /main/musl | |
parent | 7b268e6114d17b132956ea45ae63976f184e5bc8 (diff) | |
download | aports-a95a079d7a562e73276448362141171bef668cab.tar.bz2 aports-a95a079d7a562e73276448362141171bef668cab.tar.xz |
scripts/bootstrap.sh, binutils, gcc, musl: improve bootstrap
- requires new abuild (from git until 2.30 is tagged)
- properly build initial musl-dev before c-compiler is available
- mark core aports with options=toolchain, and fix all makedepends
- bootstrap.sh: reorganize and use set -e there
- bootstrap.sh: use new EXTRADEPENDS_* to pull in implicit dependencies
during bootstrap to simplify the script
Diffstat (limited to 'main/musl')
-rw-r--r-- | main/musl/APKBUILD | 59 |
1 files changed, 33 insertions, 26 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index d44e05ef2c..81d951ba12 100644 --- a/main/musl/APKBUILD +++ b/main/musl/APKBUILD @@ -9,9 +9,14 @@ arch="all" license="MIT" depends="" depends_dev="!uclibc-dev" +options="toolchain" makedepends="$depends_dev" subpackages="$pkgname-dev $pkgname-dbg libc6-compat:compat:noarch" -[ "$BOOTSTRAP" != "nolibc" ] && subpackages="$subpackages $pkgname-utils" +case "$BOOTSTRAP" in +nocc) pkgname="musl-dev"; subpackages="";; +nolibc) ;; +*) subpackages="$subpackages $pkgname-utils";; +esac source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz 0001-fix-strftime-y-for-negative-years.patch 0002-make-globfree-safe-after-failed-glob-from-over-lengt.patch @@ -33,24 +38,11 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz builddir="$srcdir"/musl-$pkgver -install_sysroot_headers() { - 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" ;; - ppc) ARCH="powerpc" ;; - ppc64*) ARCH="powerpc64" ;; - mips*) ARCH="mips" ;; - esac - make ARCH="$ARCH" prefix=/usr DESTDIR="${CBUILDROOT}" install-headers || return 1 -} - build() { cd "$builddir" + [ "$BOOTSTRAP" == "nocc" ] && return 0 + # 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 @@ -79,17 +71,32 @@ build() { package() { cd "$builddir" - make DESTDIR="$pkgdir" install || return 1 - cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1 - - # make LDSO the be the real file, and libc the symlink - local LDSO=$(make -f Makefile --eval "$(echo -e 'print-ldso:\n\t@echo $$(basename $(LDSO_PATHNAME))')" print-ldso) - 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 || return 1 - ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/bin/ldd || return 1 + if [ "$BOOTSTRAP" == "nocc" ]; then + case "$CARCH" in + aarch64*) ARCH="aarch64" ;; + arm*) ARCH="arm" ;; + x86) ARCH="i386" ;; + x86_64) ARCH="x86_64" ;; + ppc) ARCH="powerpc" ;; + ppc64*) ARCH="powerpc64" ;; + mips*) ARCH="mips" ;; + esac + + make ARCH="$ARCH" prefix=/usr DESTDIR="$pkgdir" install-headers || return 1 + else + make DESTDIR="$pkgdir" install || return 1 + + cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1 + + # make LDSO the be the real file, and libc the symlink + local LDSO=$(make -f Makefile --eval "$(echo -e 'print-ldso:\n\t@echo $$(basename $(LDSO_PATHNAME))')" print-ldso) + 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 || return 1 + ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/bin/ldd || return 1 + fi # remove libintl.h, currently we don't want by default any NLS # and use GNU gettext where needed. the plan is to migrate to |