X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail.ovgu.de (mail.ovgu.de [141.44.1.66]) by lists.alpinelinux.org (Postfix) with ESMTP id 115465C05A8 for ; Tue, 19 Sep 2017 20:44:51 +0000 (GMT) Received: from mail.ovgu.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 98E8340060 for ; Tue, 19 Sep 2017 22:44:50 +0200 (CEST) Received: from notebook-marian.fritz.box (p5B15F679.dip0.t-ipconnect.de [91.21.246.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.ovgu.de (Postfix) with ESMTPSA id 04E614005F; Tue, 19 Sep 2017 22:44:49 +0200 (CEST) From: Marian Buschsieweke To: alpine-aports@lists.alpinelinux.org Cc: Marian Buschsieweke Subject: [alpine-aports] [PATCH] testing/newlib-cross-bare-metal: New aport Date: Tue, 19 Sep 2017 22:44:29 +0200 Message-Id: <20170919204429.29386-1-marian.buschsieweke@ovgu.de> X-Mailer: git-send-email 2.14.1 X-PMX-Version: 6.3.3.2656215, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.9.19.203616, AntiVirus-Engine: 5.40.0, AntiVirus-Data: 2017.9.19.5400000 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, LEGITIMATE_SIGNS 0, MULTIPLE_REAL_RCPTS 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_SPECIFIC 0, URI_WITH_PATH_ONLY 0, __ANY_URI 0, __C230066_P5 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_URI_IN_BODY 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __FROM_DOMAIN_IN_ANY_CC1 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HTTPS_URI 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MULTIPLE_URI_TEXT 0, __NO_HTML_TAG_RAW 0, __RDNS_POOLED_10 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NOT_IMG 0, __URI_NS , __URI_WITH_PATH 0' X-Spam-Score: Gauge=IIIIIIII X-PMX-consideredAsSpam: no X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: A C standard library implementation intended for use on embedded systems http://www.sourceware.org/newlib/ Provides: newlib-arm-none-eabi --- testing/newlib-cross-bare-metal/APKBUILD | 107 +++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 testing/newlib-cross-bare-metal/APKBUILD diff --git a/testing/newlib-cross-bare-metal/APKBUILD b/testing/newlib-cross-bare-metal/APKBUILD new file mode 100644 index 0000000000..26633fab2d --- /dev/null +++ b/testing/newlib-cross-bare-metal/APKBUILD @@ -0,0 +1,107 @@ +# Contributor: Marian Buschsieweke +# Maintainer: Marian Buschsieweke + +_pkgbase=newlib +_targets="arm-none-eabi" +pkgname="${_pkgbase}-cross-bare-metal" +pkgver=2.5.0.20170818 +pkgrel=0 +pkgdesc="A C standard library implementation intended for use on embedded systems" +url="http://www.sourceware.org/newlib/" +makedepends="texinfo" +for target in $_targets; do + targetnorm="${target//-/_}" + makedepends="${makedepends} binutils-${target} gcc-${target}" + subpackages="${subpackages} ${_pkgbase}-${target}:${targetnorm}" +done +arch="all" +license="BSD" +source="ftp://sourceware.org/pub/$_pkgbase/$_pkgbase-$pkgver.tar.gz" +options="!check" + +builddir="$srcdir/$_pkgbase-$pkgver" + +# This package installes two version of the newlib library to remain compatible +# with projects expecting the GNU ARM Embedded Toolchain [1]. The nano version +# appends the postix "_nano" to the libaries. The is not an arbitrary choice, +# it matches the specs in "/usr/arm-none-eabi/lib/nano.specs", which is +# part of the default newlib installation. +# [1]: https://launchpad.net/gcc-arm-embedded/ + +build() { + for target in $_targets; do + mkdir "${builddir}/build-${target}" "${builddir}/build-${target}-nano" + + # nano version + cd "${builddir}/build-${target}-nano" + CFLAGS_NANO="-Os -ffunction-sections -fdata-sections -D=__OPTIMIZE_SIZE__ -DPREFER_SIZE_OVER_SPEED" + env CFLAGS_FOR_TARGET="$CFLAGS_NANO" "$builddir"/configure \ + --prefix=/usr/ \ + --target=$target \ + --disable-newlib-supplied-syscalls \ + --enable-newlib-reent-small \ + --disable-newlib-fvwrite-in-streamio \ + --disable-newlib-fseek-optimization \ + --disable-newlib-wide-orient \ + --enable-newlib-nano-malloc \ + --disable-newlib-unbuf-stream-opt \ + --enable-lite-exit \ + --enable-newlib-global-atexit \ + --enable-newlib-nano-formatted-io \ + --disable-nls \ + --disable-newlib-io-float \ + --disable-libssp + make + + # regular version + cd "${builddir}/build-${target}" + "$builddir"/configure \ + --prefix=/usr/ \ + --target=$target \ + --enable-newlib-io-long-long \ + --enable-newlib-register-fini \ + --disable-newlib-supplied-syscalls \ + --disable-nls + make + done +} + +package() { + mkdir -p "${pkgdir}" +} + +install_subpkg() { + for dir in include lib/thumb lib/fpu lib/cpu-init; do + mkdir -p "${subpkgdir}/usr/${target}/${dir}" + done + + # install nano version + cd "${builddir}/build-${target}-nano" + make DESTDIR="$subpkgdir" install + # rename nano version libs + cd "${subpkgdir}/usr/${target}/lib" + for file in $(find . -regex ".*\(c\|g\|rdimon\)\.a"); do + mv "$file" "${file%.a}_nano.a" + done + + # install regular version + cd "${builddir}/build-${target}" + make DESTDIR="$subpkgdir" install + rm -rf "${subpkgdir}/usr/share/man" "${subpkgdir}/usr/share/info" +} + +arm_none_eabi() { + target="${subpkgname#${_pkgbase}-}" + depends="binutils-${target} gcc-${target}" + pkgdesc="A newlib C std lib for platform ${target}" + install_subpkg +} + +avr() { + target="${subpkgname#${_pkgbase}-}" + depends="binutils-${target} gcc-${target}" + pkgdesc="A newlib C std lib for platform ${target}" + install_subpkg +} + +sha512sums="41382f722232593a9a2bf7de09dc51a26ad51bf8ad06259b0fd38a13cfcd577688e836446d7e88b7741eeec316cfa137ff9b4e16cca846b11bb70948ff1b8c16 newlib-2.5.0.20170818.tar.gz" -- 2.14.1 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---