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 8F4595C5EBB for ; Sat, 5 May 2018 10:53:21 +0000 (GMT) Received: from mail.ovgu.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id 1256B40066 for ; Sat, 5 May 2018 12:53:21 +0200 (CEST) Received: from faultier2go.fritz.box (i5E8617F5.versanet.de [94.134.23.245]) (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 75E3840067; Sat, 5 May 2018 12:53:20 +0200 (CEST) From: Marian Buschsieweke To: alpine-aports@lists.alpinelinux.org Cc: Marian Buschsieweke Subject: [alpine-aports] [PATCH 3/3] testing/newlib-arm-none-eabi: New aport Date: Sat, 5 May 2018 12:53:11 +0200 Message-Id: <20180505105311.13720-3-marian.buschsieweke@ovgu.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180505105311.13720-1-marian.buschsieweke@ovgu.de> References: <20180505105311.13720-1-marian.buschsieweke@ovgu.de> X-PMX-Version: 6.4.3.2751440, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2018.5.5.104817, AntiVirus-Engine: 5.49.1, AntiVirus-Data: 2018.5.4.5491002 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_5000_5999 0, BODY_SIZE_7000_LESS 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_SPECIFIC 0, REFERENCES 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, __INVOICE_MULTILINGUAL 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MULTIPLE_URI_TEXT 0, __NO_HTML_TAG_RAW 0, __RDNS_POOLED_3 0, __REFERENCES 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 ARM http://www.sourceware.org/newlib/ Heavily based on Ubuntu's libnewlib-arm-none-abi for the current LTS --- testing/newlib-arm-none-eabi/APKBUILD | 117 ++++++++++++++++++ .../fix-include-paths-nano-specs.patch | 13 ++ 2 files changed, 130 insertions(+) create mode 100644 testing/newlib-arm-none-eabi/APKBUILD create mode 100644 testing/newlib-arm-none-eabi/fix-include-paths-nano-specs.patch diff --git a/testing/newlib-arm-none-eabi/APKBUILD b/testing/newlib-arm-none-eabi/APKBUILD new file mode 100644 index 0000000000..d437ffe613 --- /dev/null +++ b/testing/newlib-arm-none-eabi/APKBUILD @@ -0,0 +1,117 @@ +# Maintainer: Marian Buschsieweke + +_realname=newlib +_target="arm-none-eabi" +pkgname="$_realname-$_target" +pkgver=2.4.0.20160527 +pkgrel=0 +pkgdesc="A C standard library implementation intended for use on embedded ARM" +url="http://www.sourceware.org/newlib/" +makedepends="texinfo" +depends="gcc-$_target binutils-$_target" +arch="all" +license="BSD" +source=" + http://archive.ubuntu.com/ubuntu/pool/universe/${_realname:0:1}/${_realname}/${_realname}_${pkgver}.orig.tar.xz + fix-include-paths-nano-specs.patch + " +#source="ftp://sourceware.org/pub/${_realname}/${_realname}-${pkgver}.tar.gz" +options="!check" + +builddir="$srcdir/$_realname-$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() { + mkdir "${builddir}/build" "${builddir}/build-nano" + # nano version + cd "${builddir}/build-nano" + "$builddir"/configure \ + --host=$CHOST \ + --build=$CBUILD \ + --target=$_target \ + --prefix=/usr/lib \ + --libdir=/usr/lib \ + --infodir=/deleteme/info \ + --mandir=/deleteme/man \ + --htmldir=/deleteme/html \ + --pdfdir=/deleteme/pdf \ + --disable-newlib-supplied-syscalls \ + --disable-nls \ + --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 \ + CC_FOR_TARGET="$_target"-gcc \ + GCC_FOR_TARGET="$_target"-gcc \ + AR_FOR_TARGET="$_target"-ar \ + AS_FOR_TARGET="$_target"-as \ + LD_FOR_TARGET="$_target"-ld \ + NM_FOR_TARGET="$_target"-nm \ + OBJDUMP_FOR_TARGET="$_target"-objdump \ + RANLIB_FOR_TARGET="$_target"-ranlib \ + READELF_FOR_TARGET="$_target"-readelf \ + STRIP_FOR_TARGET="$_target"-strip \ + CFLAGS="-Os -ffunction-sections -fdata-sections -fshort-wchar" + make + + # regular version + cd "${builddir}/build" + "$builddir"/configure \ + --host=$CHOST \ + --target=$_target \ + --prefix=/usr/lib \ + --libdir=/usr/lib \ + --infodir=/deleteme/info \ + --mandir=/deleteme/man \ + --htmldir=/deleteme/html \ + --pdfdir=/deleteme/pdf \ + --disable-newlib-supplied-syscalls \ + --disable-nls \ + --enable-newlib-io-long-long \ + --enable-newlib-register-fini \ + CC_FOR_TARGET="$_target"-gcc \ + GCC_FOR_TARGET="$_target"-gcc \ + AR_FOR_TARGET="$_target"-ar \ + AS_FOR_TARGET="$_target"-as \ + LD_FOR_TARGET="$_target"-ld \ + NM_FOR_TARGET="$_target"-nm \ + OBJDUMP_FOR_TARGET="$_target"-objdump \ + RANLIB_FOR_TARGET="$_target"-ranlib \ + READELF_FOR_TARGET="$_target"-readelf \ + STRIP_FOR_TARGET="$_target"-strip \ + CFLAGS="-O2 -ffunction-sections -fdata-sections -pipe" + make +} + +package() { + # install nano version + cd "${builddir}/build-nano" + make -j1 DESTDIR="$pkgdir" install + # rename nano version libs + cd "${pkgdir}/usr/lib/$_target/lib" + for file in $(find . -regex ".*\(c\|g\|rdimon\)\.a"); do + mv "$file" "${file%.a}_nano.a" + done + mkdir -p "${pkgdir}/usr/lib/$_target/include/nano" + mv "${pkgdir}/usr/lib/$_target/include/newlib.h" \ + "${pkgdir}/usr/lib/$_target/include/nano/" + + # install regular version + cd "${builddir}/build" + make -j1 DESTDIR="$pkgdir" install + rm -rf "${pkgdir}/deleteme" +} + +sha512sums="91d07a67a4f0b4ce7774352c50c8906c0051ebe588ed30c2abfdf4105b3bbeb98433c8b61126e5e6c1891b0f5a5462f762383b6fc419ba993a02b2484f46a9cc newlib_2.4.0.20160527.orig.tar.xz +6a7daa621088f7a9c75787c73de34ea6e503ba8051e208b2b6dd03498384bda46a81c0572be7846a7a270e4c390aa8d418b55a73587dd9d212fc2f5d123782f3 fix-include-paths-nano-specs.patch" diff --git a/testing/newlib-arm-none-eabi/fix-include-paths-nano-specs.patch b/testing/newlib-arm-none-eabi/fix-include-paths-nano-specs.patch new file mode 100644 index 0000000000..f4ea97708f --- /dev/null +++ b/testing/newlib-arm-none-eabi/fix-include-paths-nano-specs.patch @@ -0,0 +1,13 @@ +Index: newlib-2.4.0.20160527/libgloss/arm/elf-nano.specs +=================================================================== +--- newlib-2.4.0.20160527.orig/libgloss/arm/elf-nano.specs ++++ newlib-2.4.0.20160527/libgloss/arm/elf-nano.specs +@@ -3,7 +3,7 @@ + %rename cpp nano_cpp + + *cpp: +--isystem =/include/newlib-nano %(nano_cpp) ++-isystem /usr/include/newlib/nano %(nano_cpp) + + *nano_libc: + -lc_nano -- 2.17.0 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---