add patches for 0.33

Package-Manager: portage-2.2.7
RepoMan-Options: --force
This commit is contained in:
Mario Fetka 2014-01-21 18:38:09 +01:00
parent c7353e04aa
commit a070934f82
8 changed files with 1095 additions and 155 deletions

View File

@ -1,7 +1,13 @@
# ChangeLog for dev-libs/dietlibc # ChangeLog for dev-libs/dietlibc
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
# $Header: $ # $Header: $
21 Jan 2014; Mario Fetka <mario.fetka@gmail.com>
+files/0020-fixes-for-ARMv7.diff, +files/0027-fix-arm-mmap.diff,
+files/0036-fix-jmp_buf-size-on-armhf.diff, -dietlibc-0.33_pre20120325.ebuild,
-dietlibc-0.33_pre20130103.ebuild, dietlibc-0.33.ebuild:
add patches for 0.33
*dietlibc-9999 (28 Dec 2013) *dietlibc-9999 (28 Dec 2013)
28 Dec 2013; Mario Fetka <mario.fetka@gmail.com> +dietlibc-9999.ebuild: 28 Dec 2013; Mario Fetka <mario.fetka@gmail.com> +dietlibc-9999.ebuild:

View File

@ -1,10 +1,8 @@
AUX 0020-fixes-for-ARMv7.diff 22848 SHA256 b50724cdbcccc37ce1cba9534c5e5cddd043422bbfbcf0a08b5d8e7f809ab472 SHA512 decc129b7e2522c0eddf1341fa3359ee876eb1727ec45a44f521c460490e02876c913878a3047ecf16ee6e1c18f27ed38e58803a6a5dd5a34014ba6594c70ca5 WHIRLPOOL ff6e63de7c74a720e899c4deb0619ae15ece0eaadd0ced8a63c50e0f4081cdc373648573798c7464c6d9d4b08b6debe637e4e90660cffc2784b730c11f45e92d
AUX 0027-fix-arm-mmap.diff 1851 SHA256 ba32b37f96ff41277e50054c24e3e6457b7493926f75c44aa3ed6d693f5e25d7 SHA512 a337794ecd3d7fe925a189c6c487c07998581b07c4ba10915ee12d6fa9fa837e886f115aca1d1c905e4b6514f336ee469700bac18e4329bfdcafa93cb5f87550 WHIRLPOOL 02d7082c683c7f233d0fb39fbf75ab2d12297bc96fe1c09079fd50dd6f41af356311a6e79a29a148309b76750a8af8bd9d0546f869d240ab83f907ca645d151c
AUX 0036-fix-jmp_buf-size-on-armhf.diff 638 SHA256 8b408b8548946571390d0b8bed3068bcbd203ade0b2f8d94b3a190d4be114109 SHA512 ed088a407eac9defa11320103db2c6ac51d46de9d5e4b1d047cabfacff7b2fce530b1bc5993dab348394b8d0c1285a07dc84ca9fcf3f1ee760993031c429c69e WHIRLPOOL d6b01172a2a06266d24ca02d4dfa34473a2b31c51e21dbb92996566e901b4daa76dd9d8e3e14ac6ba4b5cb1ff82127d4f122e2c3d3921a0ecf181c1e5bbc94e9
DIST dietlibc-0.33.tar.bz2 626885 SHA256 68838893790ddd7a42bc1a06e5435054e1dc1914e4b53d2d6c92f603d3b315f5 SHA512 3e4cc8d9987a497adb2f777cbd578aa46a44f786a6ed86b0e2489d1f72ffd915920828b3dfb46d62d25f4b6a1cc2cbf7cc806ca0fe56ebc1af49152f5d4950a3 WHIRLPOOL d6f11ce9a5d2624db6be028505a0c9c3d50ca1fa1d556dc76c9f2e52a0223bd7316e7e9234b01a4e67cb256bd5ee466770fd32c0569f09661e2960201378ab8e DIST dietlibc-0.33.tar.bz2 626885 SHA256 68838893790ddd7a42bc1a06e5435054e1dc1914e4b53d2d6c92f603d3b315f5 SHA512 3e4cc8d9987a497adb2f777cbd578aa46a44f786a6ed86b0e2489d1f72ffd915920828b3dfb46d62d25f4b6a1cc2cbf7cc806ca0fe56ebc1af49152f5d4950a3 WHIRLPOOL d6f11ce9a5d2624db6be028505a0c9c3d50ca1fa1d556dc76c9f2e52a0223bd7316e7e9234b01a4e67cb256bd5ee466770fd32c0569f09661e2960201378ab8e
DIST dietlibc-0.33_pre20130103.tar.xz 555624 SHA256 2dff9b339d63320539eb733aff73d04d25d83146ab2eee99cec82f7fcd78e61a SHA512 89fe2f5d46ffc233c839f15f5a20040cdaa5ac31d3488ef64fce8cf3d4f1e48243039a47a60322617de494734ff3258e98d72f50455d824658fee2853adbb81e WHIRLPOOL c0377bc35cb825dce15f9e4156bd51ca2be44c6d2b4c86b9afe3b03ee77e163e76a89151df246493983a21c8945f27f057a1aa4dcb5573045b16721333d0a001 EBUILD dietlibc-0.33.ebuild 1853 SHA256 7e35f909eb4e6c059e84e9d1104f967538f6e10fa5b45666ec29bcd573cbe7f0 SHA512 80c1ae2e8d19b3cced1fd1ed8328ddb53eb48fbfa3dd4dd2009d5d1bc5360773aded62585c07815fe629f91609d4176325f32e6e693603cbb1892a0b8f767961 WHIRLPOOL cb2523959d88dabe7811a34e78386e4599f7b5984739542fde7cc663c001f6e6b5af715ce9146d81b1b1c2e0d0642402f0582f9e68636726f464b628fb7c408d
DIST dietlibc_0.33~cvs20120325-4.debian.tar.gz 37028 SHA256 43f86feb35ee727d85ef89abf61d28eb2948a0f15b7d767f4c971f2964ec0eb0 SHA512 f3e40dbc2b663b86949a832b5c60543b5d0727ea5854b4b58d209863806488c66dd9d05a8eed6792fb22137232d95cd5fa187187bbaff355344d9f34a7dec676 WHIRLPOOL 64cfd031c8fe28d7ff8fe8092910506db74413951046af97c0040d6366ab48a4dc918626845b400400740bcc5c7310ed9a05706f6d96c3b7bfd25fd1eeb62855
DIST dietlibc_0.33~cvs20120325.orig.tar.gz 726798 SHA256 6366f152587ba167e36ceec78cea505330c84750497aa6c8d853784abedae20a SHA512 618687d37300ecebfd3c1e315939ab05bd81372484a4f14d582a7e033a27ca498ddcd9472b41977a1830aa25aa03716f5c277e58bfa2cb2021758551a00e9f00 WHIRLPOOL 6fbdcd9b094a1137389a5380a25605f082349355f410d48b76117fc2b60ca2b790c717fe307c25df62e417b126de2abecdcb7b278e452ba9694d1fa16f291a2d
EBUILD dietlibc-0.33.ebuild 1623 SHA256 a5097a6f17d80cedf038bf7f0cbef7b8de0b03bd61a3425e7331a08b3309c5c3 SHA512 94727f80c1b287a134af219cc8abb08d53aeb0afb5a8c68fab8d62ffc20dc473af52ecafcc50921109b2b521909fa36a14be8c8d68f42ac6ecf5e5e663dbbf55 WHIRLPOOL b8e5d0a4a53ceca9cb2d12c84d49275ffd4d2a6f0b96067daf97dd8d19d2804bf33c89ffbc807b697f3f3cbbafa15814eb3cd2fd36df0df94bd8390fbe472297
EBUILD dietlibc-0.33_pre20120325.ebuild 2001 SHA256 ada8b9b162f4f96c1ae8913152aec7f32f5f983f9e2107012b13eb868f1e648e SHA512 1416565356b2c1efd9dece8613f6144793e4c07494082a36e5110b02e55278d50ab0d3a07ce89ebf1865aca98a4497c2938fbef581cd7d3b3190e7dc072cc27f WHIRLPOOL 20d29099f7959b5ca4264d1c9d8fefb1876296ea90759adf5701cc2ed227b7f89040c6da0fab01baca8525f195935c6c218f51b6314e22d5ce447a09eb937998
EBUILD dietlibc-0.33_pre20130103.ebuild 1652 SHA256 ae8728b5c1b7fb839e03dad7cf0b8584c5889cdd2e23e3d55c24c92c4f64742f SHA512 c59e690f73849f9cbc328b0b53c05ca1d3974914298c6aa48c33ec2dacffd539beb1cdb9f07d4aa06ea72a7a9976eed75fe126c1c0db2df2399f65561d32018b WHIRLPOOL 2fa6474dbab3ea6f3bd741cf4d95d65238624af9cb1c8e07d8b4b15509cf6ea3cb23a2ac8bb53f9d3d11e3c9ff57d216f24ad50c047c2b30a5e3eaca38f14207
EBUILD dietlibc-9999.ebuild 2091 SHA256 d0e57785bc9232cbc0d797560385baab26df8276ad6962bc93d8bd0543f59b34 SHA512 540ee93eb0afa0e94e8c1c877c5cc2c00a3a944fdad3d504fdf800878e4e85e5cf109af42e12d6a5659d67cfb9a25eb8860d779b9101c9684a05735f91186cda WHIRLPOOL 1f70e5f6ee90304287ab82af06dbc28a67cb50381bec70171b6876c52bde20e07f6f044d3c9b948953092d56f2513a3cf6087e9d166fceede12b4356ece37d15 EBUILD dietlibc-9999.ebuild 2091 SHA256 d0e57785bc9232cbc0d797560385baab26df8276ad6962bc93d8bd0543f59b34 SHA512 540ee93eb0afa0e94e8c1c877c5cc2c00a3a944fdad3d504fdf800878e4e85e5cf109af42e12d6a5659d67cfb9a25eb8860d779b9101c9684a05735f91186cda WHIRLPOOL 1f70e5f6ee90304287ab82af06dbc28a67cb50381bec70171b6876c52bde20e07f6f044d3c9b948953092d56f2513a3cf6087e9d166fceede12b4356ece37d15
MISC ChangeLog 1334 SHA256 bad333cccdfcfc151a25d5c2691e2fd0b1d451458e052136da0e40ce988c94f8 SHA512 a320d731d1bdce58ca4ec1879322f27a99b5d30266dbef90cd9e0ea53d626991c1a30f20dbd8ec4fbaedf8643a8f642a36bd66595477ab57e0c8101536e5b106 WHIRLPOOL 77a17962ed8f5b918f7542523ef29746f246e30e59c6cf1740a48739f0371e34a0943a24ec35319e02823b572fc1da0be148f47a35a8b70d5728116dfd327f51 MISC ChangeLog 1616 SHA256 2849c8c784f18d851c4031cdf86e422a6b8d2ac4f75f9f3748379cd82779fe80 SHA512 490d6ebd4134b40a9a0f56515236b77f8e2c6e0dbe3c9239737dfeed44e5f4752cac647831c7c43650b686c9f8270189bed100168054ada642db105bb5b5f870 WHIRLPOOL 1717bedb099ace39f4de0d64428847eee4255003f09991c99b3f84b143e18390b003735bd96ecdae9e66701cd356186def0277d5bba15e380cc6b550af8905c3
MISC metadata.xml 410 SHA256 3fc38345f9430d71c6369f84fc1b6248bc8aa0ec74cb4ae5b2797fe01cf48721 SHA512 d0819fcafbbc30e86adb68974c4bf0a09dc049a46a264647e05aa7b2f41543ac7c6fd0e206e73720404f0392cbd55b2736cbb54d63486882d439b8801a3b7547 WHIRLPOOL 1e559e60d0e43f84d18bac49ef2f338257d723fc4531d767c5f3d13511a790bbe94a93f0c60436aa86375cdb1df897e8e2fa58fc2cf8575b6a2da335721b6090 MISC metadata.xml 410 SHA256 3fc38345f9430d71c6369f84fc1b6248bc8aa0ec74cb4ae5b2797fe01cf48721 SHA512 d0819fcafbbc30e86adb68974c4bf0a09dc049a46a264647e05aa7b2f41543ac7c6fd0e206e73720404f0392cbd55b2736cbb54d63486882d439b8801a3b7547 WHIRLPOOL 1e559e60d0e43f84d18bac49ef2f338257d723fc4531d767c5f3d13511a790bbe94a93f0c60436aa86375cdb1df897e8e2fa58fc2cf8575b6a2da335721b6090

View File

@ -1,4 +1,4 @@
# Copyright 1999-2013 Gentoo Foundation # Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.33.ebuild,v 1.1 2013/10/13 15:15:44 polynomial-c Exp $ # $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.33.ebuild,v 1.1 2013/10/13 15:15:44 polynomial-c Exp $
@ -11,7 +11,7 @@ SRC_URI="http://www.fefe.de/dietlibc/${P}.tar.bz2"
LICENSE="GPL-2" LICENSE="GPL-2"
SLOT="0" SLOT="0"
KEYWORDS="~arm" KEYWORDS="~arm amd64"
IUSE="" IUSE=""
DEPEND="" DEPEND=""
@ -36,13 +36,17 @@ src_prepare() {
sed -i -e 's:strip::' Makefile || die sed -i -e 's:strip::' Makefile || die
append-flags -Wa,--noexecstack append-flags -Wa,--noexecstack
}
src_prepare() { # add armv7 support
sed -i 's/3-6/3-7/' Makefile
perl -pi -e 's/\r\n/\n/g' arm/md5asm.S
epatch "${FILESDIR}"/0020-fixes-for-ARMv7.diff
epatch "${FILESDIR}"/0027-fix-arm-mmap.diff
epatch "${FILESDIR}"/0036-fix-jmp_buf-size-on-armhf.diff
ln -sf bin-${ARCH} bin-${CHOST/-*/} ln -sf bin-${ARCH} bin-${CHOST/-*/}
} }
src_compile() { src_compile() {
emake prefix="${EPREFIX}"${DIETHOME} \ emake prefix="${EPREFIX}"${DIETHOME} \
CC="$(tc-getCC)" \ CC="$(tc-getCC)" \

View File

@ -1,76 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.33_pre20110403.ebuild,v 1.7 2012/08/21 03:29:23 ottxor Exp $
EAPI="3"
inherit eutils flag-o-matic toolchain-funcs
MY_PV=${PV/_pre/~cvs}
DEB_PV="4"
DESCRIPTION="A libc optimized for small size"
HOMEPAGE="http://www.fefe.de/dietlibc/"
SRC_URI="https://launchpad.net/ubuntu/+archive/primary/+files/dietlibc_${MY_PV}.orig.tar.gz
https://launchpad.net/ubuntu/+archive/primary/+files/dietlibc_${MY_PV}-${DEB_PV}.debian.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~arm"
IUSE="debug"
DEPEND=""
RDEPEND=""
S="${WORKDIR}"/dietlibc-${MY_PV}
DIETHOME=/usr/diet
pkg_setup() {
# Replace sparc64 related C[XX]FLAGS (see bug #45716)
use sparc && replace-sparc64-flags
# gcc-hppa suffers support for SSP, compilation will fail
use hppa && strip-unsupported-flags
# debug flags
use debug && append-flags -g
# Makefile does not append CFLAGS
append-flags -nostdinc -W -Wall -Wextra -Wchar-subscripts \
-Wmissing-prototypes -Wmissing-declarations -Wno-switch \
-Wno-unused -Wredundant-decls -fno-strict-aliasing
# only use -nopie on archs that support it
gcc-specs-pie && append-flags -nopie
}
src_prepare() {
EPATCH_SOURCE="${WORKDIR}/debian/patches" EPATCH_SUFFIX="diff" \
EPATCH_FORCE="yes" epatch
ln -sf bin-${ARCH} bin-${CHOST/-*/}
}
src_compile() {
emake prefix="${EPREFIX}"${DIETHOME} \
CC="$(tc-getCC)" \
CFLAGS="${CFLAGS}" \
STRIP=":" \
|| die "make failed"
}
src_install() {
emake prefix="${EPREFIX}"${DIETHOME} \
DESTDIR="${D}" \
install-bin \
install-headers \
|| die "make install failed"
# broken so add a workaround
ln -sf lib-${ARCH} "${D}"/${DIETHOME}/lib-${CHOST/-*/}
dobin "${ED}"${DIETHOME}/bin/* || die "dobin failed"
doman "${ED}"${DIETHOME}/man/*/* || die "doman failed"
rm -r "${ED}"${DIETHOME}/{man,bin}
dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING
}

View File

@ -1,66 +0,0 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/dietlibc/dietlibc-0.33_pre20130103.ebuild,v 1.1 2013/01/03 20:15:02 pacho Exp $
EAPI=5
inherit eutils flag-o-matic toolchain-funcs
DESCRIPTION="A libc optimized for small size"
HOMEPAGE="http://www.fefe.de/dietlibc/"
SRC_URI="http://dev.gentoo.org/~pacho/maintainer-needed/${P}.tar.xz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~arm"
IUSE=""
DEPEND=""
RDEPEND=""
DIETHOME=/usr/diet
src_prepare() {
# Replace sparc64 related C[XX]FLAGS (see bug #45716)
use sparc && replace-sparc64-flags
# gcc-hppa suffers support for SSP, compilation will fail
use hppa && strip-unsupported-flags
# Makefile does not append CFLAGS
append-flags -nostdinc -W -Wall -Wextra -Wchar-subscripts \
-Wmissing-prototypes -Wmissing-declarations -Wno-switch \
-Wno-unused -Wredundant-decls -fno-strict-aliasing
# only use -nopie on archs that support it
gcc-specs-pie && append-flags -nopie
sed -i -e 's:strip::' Makefile || die
append-flags -Wa,--noexecstack
}
src_prepare() {
ln -sf bin-${ARCH} bin-${CHOST/-*/}
}
src_compile() {
emake prefix="${EPREFIX}"${DIETHOME} \
CC="$(tc-getCC)" \
CFLAGS="${CFLAGS}" \
STRIP=":"
}
src_install() {
emake prefix="${EPREFIX}"${DIETHOME} \
DESTDIR="${D}" \
install-bin \
install-headers
# broken so add a workaround
ln -sf lib-${ARCH} "${D}"/${DIETHOME}/lib-${CHOST/-*/}
dobin "${ED}"${DIETHOME}/bin/*
doman "${ED}"${DIETHOME}/man/*/*
rm -r "${ED}"${DIETHOME}/{man,bin} || die
dodoc AUTHOR BUGS CAVEAT CHANGES README THANKS TODO PORTING
}

View File

@ -0,0 +1,978 @@
Description: Upstream changes introduced in version 0.33~cvs20110710-1
This patch has been created by dpkg-source during the package build.
Here's the last changelog entry, hopefully it gives details on why
those changes were made:
.
dietlibc (0.33~cvs20110710-1) experimental; urgency=low
.
* New upstream pre-release
* Bump Standards-Version
* Use DEP5 as copyright format
* Don't build arm* with DEBUG flag
* Use debian source format 3.0 (quilt)
* Move tc523086.c into debian/test directory
* Add local-options file
* Refresh debian patchset
* parisc/strstr.S: remove local removal
* strip elftrunc and dnsd resulting binaries
.
The person named in the Author field signed this changelog entry.
Author: Hector Oron <zumbi@debian.org>
---
Index: pkg-dietlibc/syscalls.s/fadvise64.S
===================================================================
--- pkg-dietlibc.orig/syscalls.s/fadvise64.S 2012-03-25 15:11:10.000000000 +0000
+++ pkg-dietlibc/syscalls.s/fadvise64.S 2012-03-25 15:12:55.000000000 +0000
@@ -3,15 +3,14 @@
#include "syscalls.h"
+#ifdef __NR_fadvise64
+syscall(fadvise64,fadvise64)
+
#ifndef __NR_fadvise64_64
+.set posix_fadvise, fadvise64
.globl posix_fadvise
-.type posix_fadvise,@function
-posix_fadvise:
#endif
-#ifdef __NR_fadvise64
-syscall(fadvise64,fadvise64)
-
#endif
#endif
Index: pkg-dietlibc/arm/__aeabi_unwind_cpp.S
===================================================================
--- pkg-dietlibc.orig/arm/__aeabi_unwind_cpp.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/__aeabi_unwind_cpp.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,21 +1,14 @@
-.text
-.global __aeabi_unwind_cpp_pr0
-.hidden __aeabi_unwind_cpp_pr0
-.type __aeabi_unwind_cpp_pr0, %function
+#include "arm-features.h"
-.global __aeabi_unwind_cpp_pr1
+FUNC_START __aeabi_unwind_cpp_pr0
+FUNC_START __aeabi_unwind_cpp_pr1
+FUNC_START __aeabi_unwind_cpp_pr2
+.hidden __aeabi_unwind_cpp_pr0
.hidden __aeabi_unwind_cpp_pr1
-.type __aeabi_unwind_cpp_pr1, %function
-
-.global __aeabi_unwind_cpp_pr2
.hidden __aeabi_unwind_cpp_pr2
-.type __aeabi_unwind_cpp_pr2, %function
-__aeabi_unwind_cpp_pr0:
-__aeabi_unwind_cpp_pr1:
-__aeabi_unwind_cpp_pr2:
- mov pc, lr @ return from subroutine
+ RET
-.size __aeabi_unwind_cpp_pr0,.-__aeabi_unwind_cpp_pr0
-.size __aeabi_unwind_cpp_pr1,.-__aeabi_unwind_cpp_pr1
-.size __aeabi_unwind_cpp_pr2,.-__aeabi_unwind_cpp_pr2
+FUNC_END __aeabi_unwind_cpp_pr2
+FUNC_END __aeabi_unwind_cpp_pr1
+FUNC_END __aeabi_unwind_cpp_pr0
Index: pkg-dietlibc/arm/__fadvise.c
===================================================================
--- pkg-dietlibc.orig/arm/__fadvise.c 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/__fadvise.c 2012-03-25 15:12:55.000000000 +0000
@@ -1,7 +1,10 @@
-#include <fcntl.h>
#include "syscalls.h"
#ifndef __NR_fadvise64
+#define _LINUX_SOURCE
+#include <fcntl.h>
+#include <unistd.h>
+
long fadvise64_64(int fd, off64_t offset, off64_t len, int advice)
{
extern long __arm_fadvise64_64(int fd, int advice, off64_t offset, off64_t len);
Index: pkg-dietlibc/arm/__guard.S
===================================================================
--- pkg-dietlibc.orig/arm/__guard.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/__guard.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,4 +1,5 @@
.data
+.align 2
.type __guard,#object
.global __guard
.type __stack_chk_guard,#object
@@ -7,3 +8,5 @@
__stack_chk_guard:
.long 0xaff00
+.size __guard, . - __guard
+.size __stack_chk_guard, . - __stack_chk_guard
Index: pkg-dietlibc/arm/__longjmp.S
===================================================================
--- pkg-dietlibc.orig/arm/__longjmp.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/__longjmp.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,11 +1,24 @@
-.text
-.global __longjmp
-.type __longjmp,function
-__longjmp:
+#include "arm-features.h"
+
+FUNC_START __longjmp
mov ip, r0
movs r0, r1
moveq r0, #1
-#ifndef __SOFTFP__
- lfm f4, 4, [ip], #48
+
+#ifndef __SOFTFP__
+# if __ARM_ARCH__ >= 6
+ vldm ip!, {d0-d15}
+# ifdef __ARM_NEON__
+ vldm ip!, {d16-d31}
+# endif
+# else
+ lfm f4, 4, [ip]!
+# endif
#endif
- ldmia ip, {r4-r11, sp, pc}
+
+#ifdef __IWMMXT__
+# warning "sigjmp will not restore iwmmxt coprocessor registers"
+#endif
+
+ ldmia ip!, {r4-r11, sp, pc}
+FUNC_END __longjmp
Index: pkg-dietlibc/arm/__testandset.S
===================================================================
--- pkg-dietlibc.orig/arm/__testandset.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/__testandset.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,7 +1,15 @@
-.text
-.global __testandset
-__testandset:
+#include "arm-features.h"
+
+FUNC_START __testandset
mov r2, r0
mov r1, #1
+# if __ARM_ARCH__ < 6
swp r0, r1, [r2]
- mov pc, lr
+# else
+1: ldrex r0, [r2]
+ strex r3, r1, [r2]
+ cmp r3, #0
+ bne 1b
+# endif
+ RET
+FUNC_END __testandset
Index: pkg-dietlibc/arm/arm-features.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ pkg-dietlibc/arm/arm-features.h 2012-03-25 15:12:55.000000000 +0000
@@ -0,0 +1,110 @@
+/* --*- asm -*-- */
+
+#ifndef H_DIETLIBC_ARM_FEATURES_H
+#define H_DIETLIBC_ARM_FEATURES_H
+
+/* Stolen from gcc (gcc/config/arm/lib1funcs.asm) */
+#if defined(__ARM_ARCH_2__)
+# define __ARM_ARCH__ 2
+#endif
+
+#if defined(__ARM_ARCH_3__)
+# define __ARM_ARCH__ 3
+#endif
+
+#if defined(__ARM_ARCH_3M__) || defined(__ARM_ARCH_4__) \
+ || defined(__ARM_ARCH_4T__)
+# define __ARM_ARCH__ 4
+#endif
+
+#if defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) \
+ || defined(__ARM_ARCH_5E__) || defined(__ARM_ARCH_5TE__) \
+ || defined(__ARM_ARCH_5TEJ__)
+# define __ARM_ARCH__ 5
+#endif
+
+#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \
+ || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) \
+ || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) \
+ || defined(__ARM_ARCH_6M__)
+# define __ARM_ARCH__ 6
+#endif
+
+#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \
+ || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__)
+# define __ARM_ARCH__ 7
+#endif
+
+#ifndef __ARM_ARCH__
+#error Unable to determine architecture.
+#endif
+
+#define DIET_JMPBUFSZ_REGS_REGULAR 10*32/8 /* r4-r11, sp, pc */
+#define DIET_JMPBUFSZ_REGS_FPv4 16*64/8 /* d0-d15 */
+
+#if !defined(__SOFTFP__) || defined(__IWMMXT__)
+# define DIET_HAVE_COPROC_REGS 1
+#else
+# undef DIET_HAVE_COPROC_REGS
+#endif
+
+#ifdef __ASSEMBLER__
+
+.macro FUNC_START name
+ .text
+ .align 0
+ .global \name
+ .type \name, %function
+\name:
+.endm
+
+.macro FUNC_START_WEAK name
+ .text
+ .align 0
+ .weak \name
+ .type \name, %function
+\name:
+.endm
+
+.macro FUNC_END name
+ .size \name, . - \name
+.endm
+
+.macro RET
+#if (__ARM_ARCH__ > 4) || defined(__ARM_ARCH_4T__)
+ bx lr
+#else
+ mov pc, lr
+#endif
+.endm
+
+.macro SWI_UNIFIED name
+#ifdef __ARM_EABI__
+ b __unified_syscall_swi
+#else
+ swi \name
+ b __unified_syscall
+#endif
+.endm
+
+.macro SWI_UNIFIED4
+#ifdef __ARM_EABI__
+ b __unified_syscall_swi
+#else
+ swi \name
+ b __unified_syscall4
+#endif
+.endm
+
+.macro LOAD_ARG4_5
+#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(__ARM_ARCH_5T__)
+ ldr r4, [sp,#16]
+ ldr r5, [sp,#20]
+#else
+ ldrd r4, [sp,#16]
+#endif
+.endm
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* H_DIETLIBC_ARM_FEATURES_H */
Index: pkg-dietlibc/arm/clone.S
===================================================================
--- pkg-dietlibc.orig/arm/clone.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/clone.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,11 +1,8 @@
#include <errno.h>
#include "syscalls.h"
+#include "arm-features.h"
- .text
- .weak clone
- .global __clone
-
@
@ Some slightly tricky stuff here... edit with care :-)
@
@@ -19,9 +16,8 @@
@ ; don't do this yet
@#define RESET_PID
-
-clone:
-__clone:
+FUNC_START_WEAK clone
+FUNC_START __clone
@ ; start with a sanity check
cmp r0, #0
cmpne r1, #0
@@ -51,7 +47,8 @@
beq 1f
ldmfd sp!, {r4, r7}
blt __unified_syscall @ (return code < 0): handle as an error
- bx lr
+ RET
+
1:
#ifdef RESET_PID
tst ip, #CLONE_THREAD
@@ -76,12 +73,13 @@
@ ; and we're done, passing return value through r0
b _exit @ branch to _exit (PIC safe)
+FUNC_END __clone
+FUNC_END clone
-
#else
-clone:
-__clone:
+FUNC_START_WEAK clone
+FUNC_START __clone
movs r12, r0 @ check function pointer
cmpne r1, #0 @ if function check for stack pointer
moveq r0, #-EINVAL @ if one is not available set errno value
@@ -101,5 +99,7 @@
ldmia sp!, { r0, pc } @ load function param and jump to thread function
1: b _exit @ branch to _exit (PIC safe)
+FUNC_END __clone
+FUNC_END clone
#endif
Index: pkg-dietlibc/arm/dyn_syscalls.S
===================================================================
--- pkg-dietlibc.orig/arm/dyn_syscalls.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/dyn_syscalls.S 2012-03-25 15:12:55.000000000 +0000
@@ -8,11 +8,15 @@
#include <dietfeatures.h>
#include "syscalls.h"
+#include "arm-features.h"
-.text
-__unified_syscall4:
+#ifdef __ARM_EABI__
+# error "dyn_syscall.S not ported for EABI yet"
+#endif
+
+FUNC_START __unified_syscall4
ldmfd sp!, {r4, r5, r6}
-__unified_syscall:
+FUNC_START __unified_syscall
cmn r0, #4096
movcc pc, lr
rsb r1, r0, #0
@@ -25,7 +29,9 @@
mvn r0, #0
#include "dietuglyweaks.h"
- mov pc, lr
+ RET
+FUNC_END __unified_syscall
+FUNC_END __unified_syscall4
/* ok now include all syscalls.s (*.S) and sysdep *.S */
#include "mmap.S"
@@ -104,7 +110,6 @@
#include "../syscalls.s/n_sigprocmask.S"
#include "../syscalls.s/n_sigsuspend.S"
#include "../syscalls.s/nanosleep.S"
-#include "../syscalls.s/nice.S"
#include "../syscalls.s/open.S"
#include "../syscalls.s/pause.S"
#include "../syscalls.s/personality.S"
@@ -280,9 +285,11 @@
#include "../syscalls.s/fgetxattr.S"
/* other asm-files w.o. changes ... */
-__exit:
+FUNC_START __exit
swi $__NR_exit
eor pc,lr,lr
+FUNC_END __exit
+
#define _exit __exit
#include "clone.S"
#undef _exit
Index: pkg-dietlibc/arm/mcount.S
===================================================================
--- pkg-dietlibc.orig/arm/mcount.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/mcount.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,4 +1,4 @@
-
+#include "arm-features.h"
@
@ mcount.S: ARM assembler implementation of mcount
@
@@ -27,11 +27,7 @@
@
@
-.text
-
-.global mcount
-
-mcount:
+FUNC_START mcount
mov ip, sp
stmdb sp!, { r0 - r3, fp, ip, lr, pc } @ build stack frame
sub fp, ip, #4 @ setup new fp
@@ -43,4 +39,4 @@
bl __mcount @ call __mcount
ldmdb fp, { r0 - r3, fp, sp, pc } @ restore context from stack frame and return.
-
+FUNC_END mcount
Index: pkg-dietlibc/arm/md5asm.S
===================================================================
--- pkg-dietlibc.orig/arm/md5asm.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/md5asm.S 2012-03-25 15:12:55.000000000 +0000
@@ -50,45 +50,35 @@
*****************************************************************************/
#include <endian.h>
+#include "arm-features.h"
#if (__BYTE_ORDER == __LITTLE_ENDIAN)
- .global MD5Init
- .global MD5Update
-
- .text
-#ifdef __ARM_EABI__
- .align 4
-#else
- .align 2
-#endif
-
@ --
@ void MD5Init (MD5_CTX* context);
@ --
-MD5Init:
-
+FUNC_START MD5Init
adr r1, 1f @ r1 = base address of MD5InitData array
ldmia r1, { r1 - r3, r12 } @ load 4 elements from MD5InitData array
stmia r0, { r1 - r3, r12 } @ store into MD5 context->state[0..3]
mov r1, #0
str r1, [r0, #0x10] @ initial count[0] = 0
str r1, [r0, #0x14] @ initial count[1] = 0
- mov pc, lr @ return
+ RET
+ .align 3
1: .word 0x67452301 @ initial MD5 context->state[0]
.word 0xefcdab89 @ initial MD5 context->state[1]
.word 0x98badcfe @ initial MD5 context->state[2]
.word 0x10325476 @ initial MD5 context->state[3]
-
+FUNC_END MD5Init
@ --
@ void MD5Update (MD5_CTX* context, const uint8_t* buf, signed int len);
@ --
-MD5Update:
-
+FUNC_START MD5Update
stmdb sp!, { r4 - r8, lr }
add r4, r0, #(6 * 4) @ r4 = &context->buffer[0]
ldmdb r4, { r0, r3 } @ r0 = count[0], r3 = count[1]
@@ -122,12 +112,13 @@
sub r2, r8, r2
2: ldmia sp!, { r4 - r8, lr }
b memcpy @ classic tail-call optimisation...
-
+FUNC_END MD5Update
@ --
@ static void __MD5Transform (uint32_t *buf, const uint32_t *in, int repeat);
@ --
+ .align 3
MD5MagicData:
1: .word 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee
@@ -148,6 +139,7 @@
.word 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391, (17f-19f-4)
.word 0x6e4120A9, 0x20657264, 0x7543634d, 0x00796472, (19f-19f-4)
+ .align 2
__MD5Transform:
cmp r2, #0
Index: pkg-dietlibc/arm/setjmp.S
===================================================================
--- pkg-dietlibc.orig/arm/setjmp.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/setjmp.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,17 +1,40 @@
-.text
-.weak setjmp
-setjmp:
-.global __setjmp
-__setjmp:
+#include "arm-features.h"
+
+FUNC_START_WEAK setjmp
+FUNC_START __setjmp
mov r1, #0
-.global __sigsetjmp
-__sigsetjmp:
-.weak sigsetjmp
-sigsetjmp:
-#ifndef __SOFTFP__
- sfm f4, 4, [r0], #48
+FUNC_END __setjmp
+FUNC_END setjmp
+
+FUNC_START_WEAK sigsetjmp
+FUNC_START __sigsetjmp
+
+#ifdef DIET_HAVE_COPROC_REGS
+ /* we have to work on a copy of 'r0' (jmpbuf *) */
+ mov ip, r0
#endif
+
+#ifndef __SOFTFP__
+# if __ARM_ARCH__ >= 6
+ vstmia ip!, {d0-d15}
+# ifdef __ARM_NEON__
+ vstmia ip!, {d16-d31}
+# endif
+# else
+ sfm f4, 4, [ip]!
+# endif
+#endif
+
+#ifdef __IWMMXT__
+# warning "setjmp will not save iwmmxt coprocessor registers"
+#endif
+
+#ifndef DIET_HAVE_COPROC_REGS
stmia r0, {r4-r11, sp, lr}
- sub r0, r0, #48
- b __sigjmp_save
+#else
+ stmia ip!, {r4-r11, sp, lr}
+#endif
+ b __sigjmp_save
+FUNC_END __sigsetjmp
+FUNC_END sigsetjmp
Index: pkg-dietlibc/arm/start.S
===================================================================
--- pkg-dietlibc.orig/arm/start.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/start.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,23 +1,11 @@
#include "dietfeatures.h"
#include "syscalls.h"
+#include "arm-features.h"
- .text
#ifdef __ARM_EABI__
- .align 4
-#else
- .align 2
-#endif
-
- .global _start
- .weak exit
- .global _exit
-
-
-#ifdef __ARM_EABI__
-
-_start:
+FUNC_START _start
mov fp, #0 @ clear the frame pointer
ldr a1, [sp] @ argc
add a2, sp, #4 @ argv
@@ -25,6 +13,17 @@
add a3, a2, a1, lsl #2 @ &argv[argc]
add a3, a3, #4 @ envp
str a3, [ip, #0] @ environ = envp
+
+#ifdef WANT_ELFINFO
+ mov r6, a3 @ work on a copy of a3 so that common
+ @ 'main(argc, argv, envp)' function
+ @ stays valid
+1: ldr r5, [r6], #4 @ load *envp and increment it
+ cmp r5, #0 @ read value==0?
+ bne 1b
+ str r6, [ip, #4] @ __elfinfo = envp
+#endif
+
bl main
@
@@ -32,21 +31,22 @@
@ We need to branch to 'exit' in case we have linked with 'atexit'.
@
bl exit
+FUNC_END _start
-exit:
-_exit:
-
+FUNC_START _exit
+FUNC_START_WEAK exit
mov r7, #__NR_exit
swi 0 @ never returns.
+ .align 2
.L3: .word environ
-
+FUNC_END exit
+FUNC_END _exit
#else
-_start:
-
+FUNC_START _start
#ifdef WANT_DYNAMIC
mov a4, a1 @ save dynamic ld.so _fini
#endif
@@ -59,11 +59,25 @@
#ifdef __DYN_LIB
ldr sl, .L4
1: add sl, pc, sl
- str a3, [sl, ip] @ environ = envp
+ str a3, [ip, sl]! @ environ = envp; ip = GOT(environ)
#else
str a3, [ip, #0] @ environ = envp
#endif
+#ifdef WANT_ELFINFO
+ mov r6, a3 @ work on a copy of a3 so that common
+ @ 'main(argc, argv, envp)' function
+ @ stays valid
+1: ldr r5, [r6], #4 @ load *envp and increment it
+ cmp r5, #0 @ read value==0?
+ bne 1b
+#ifdef __DYN_LIB
+ str r6, [ip, sl] @ __elfinfo = envp
+#else
+ str r6, [ip, #4] @ __elfinfo = envp
+#endif
+#endif
+
#ifdef PROFILING
stmdb sp!, { r0 - r3 }
ldr r0, .L5
@@ -83,18 +97,21 @@
@ We need to branch to 'exit' in case we have linked with 'atexit'.
@
bl exit
+FUNC_END _start
-exit:
-_exit:
-
+FUNC_START _exit
+FUNC_START_WEAK exit
#ifdef PROFILING
mov r4, r0 @ save a copy of exit status
bl _stop_monitor
mov r0, r4
#endif
swi $__NR_exit @ never returns.
+FUNC_END exit
+FUNC_END _exit
+ .align 2
#ifdef __DYN_LIB
.L3: .word environ(GOT)
.L4: .word _GLOBAL_OFFSET_TABLE_-(1b+8)
Index: pkg-dietlibc/arm/strcpy.S
===================================================================
--- pkg-dietlibc.orig/arm/strcpy.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/strcpy.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,10 +1,7 @@
#include "dietfeatures.h"
+#include "arm-features.h"
-.text
- .align 2
- .global strcpy
-
-strcpy:
+FUNC_START strcpy
#ifndef WANT_SMALL_STRING_ROUTINES
mov ip, r0
ands r2, r1, #3
@@ -61,6 +58,5 @@
ldrneb r2, [r1], #1
#endif
bne .Lloop
- mov pc, lr
-.Lfe1:
- .size strcpy,.Lfe1-strcpy
+ RET
+FUNC_END strcpy
Index: pkg-dietlibc/arm/strlen.S
===================================================================
--- pkg-dietlibc.orig/arm/strlen.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/strlen.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,12 +1,7 @@
#include "dietfeatures.h"
+#include "arm-features.h"
- .text
- .align 2
-
- .global strlen
-
-strlen:
-
+FUNC_START strlen
#if 0
teq a1, #0 @ is string pointer NULL ??
moveq pc, lr @ if so, return 0
@@ -61,12 +56,10 @@
sub a1, a1, a2
#endif
- mov pc, lr
+ RET
#ifndef WANT_SMALL_STRING_ROUTINES
.Lmagic:
.word 0x01010101
#endif
-
-.Lstrlen:
- .size strlen,.Lstrlen-strlen
+FUNC_END strlen
Index: pkg-dietlibc/arm/syscalls.h
===================================================================
--- pkg-dietlibc.orig/arm/syscalls.h 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/syscalls.h 2012-03-25 15:12:55.000000000 +0000
@@ -700,9 +700,9 @@
#define __ARGS_getpeername 0
#define __ARGS_socketpair 0
#define __ARGS_send 0
-#define __ARGS_sendto 0
+#define __ARGS_sendto 6
#define __ARGS_recv 0
-#define __ARGS_recvfrom 0
+#define __ARGS_recvfrom 6
#define __ARGS_shutdown 0
#define __ARGS_setsockopt 0
#define __ARGS_getsockopt 0
@@ -771,70 +771,30 @@
#ifdef __ASSEMBLER__
-#ifdef __ARM_EABI__
+#include "arm-features.h"
#define syscall_weak(name,wsym,sym) __syscall_weak __NR_##name, wsym, sym, __ARGS_##name
.macro __syscall_weak name wsym sym typ
-.text
-.type \wsym,function
-.weak \wsym
-\wsym:
-.type \sym,function
-.global \sym
-\sym:
- stmfd sp!,{r4,r5,r7,lr}
- ldr r4, [sp,#16]
- ldr r5, [sp,#20]
- ldr r7, =\name
- swi 0
- b __unified_syscall
+FUNC_START_WEAK \wsym
+__syscall \name, \sym, \typ
+FUNC_END \wsym
.endm
+#ifdef __ARM_EABI__
#define syscall(name,sym) __syscall __NR_##name, sym, __ARGS_##name
.macro __syscall name sym typ
-.text
-.type \sym,function
-.global \sym
-\sym:
- stmfd sp!,{r4,r5,r7,lr}
- ldr r4, [sp,#16]
- ldr r5, [sp,#20]
- ldr r7, =\name
- swi 0
- b __unified_syscall
+FUNC_START \sym
+ ldr ip, =\name
+ b __unified_syscall_swi
+FUNC_END \sym
.endm
#else
-#define syscall_weak(name,wsym,sym) __syscall_weak $__NR_##name, wsym, sym, __ARGS_##name
-.macro __syscall_weak name wsym sym typ
-.text
-.type \wsym,function
-.weak \wsym
-\wsym:
-.type \sym,function
-.global \sym
-\sym:
-.ifgt \typ
- mov ip, sp
- stmfd sp!,{r4, r5, r6}
- ldmia ip, {r4, r5, r6}
-.endif
- swi \name
-.ifgt \typ
- b __unified_syscall4
-.else
- b __unified_syscall
-.endif
-.endm
-
#define syscall(name,sym) __syscall $__NR_##name, sym, __ARGS_##name
.macro __syscall name sym typ
-.text
-.type \sym,function
-.global \sym
-\sym:
+FUNC_START \sym
.ifgt \typ
mov ip, sp
stmfd sp!,{r4, r5, r6}
@@ -846,6 +806,7 @@
.else
b __unified_syscall
.endif
+FUNC_END \sym
.endm
#endif
Index: pkg-dietlibc/arm/unified.S
===================================================================
--- pkg-dietlibc.orig/arm/unified.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/unified.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,21 +1,28 @@
#include <dietfeatures.h>
-
- .text
-#ifdef __ARM_EABI__
- .align 4
-#else
- .align 2
-#endif
- .global __unified_syscall
- .global __unified_syscall4
-
+#include "arm-features.h"
#ifdef __ARM_EABI__
-__unified_syscall4:
-__unified_syscall:
-
+/* expects:
+ * r0-r3 ... syscall arguments 0-3
+ * ip ... syscall number
+ */
+FUNC_START __unified_syscall_swi
+ .hidden __unified_syscall_swi
+ stmfd sp!,{r4,r5,r7,lr}
+ mov r7, ip
+ LOAD_ARG4_5
+ swi 0
+ /* fallthrough to __unified4_syscall */
+FUNC_END __unified_syscall_swi
+
+/* expects:
+ * r0 ... syscall return value
+ * original r4-r7 + lr on stack
+ */
+FUNC_START __unified_syscall
+ .hidden __unified_syscall
cmn r0, #4096
rsbcs r2, r0, #0
ldrcs r3, 1f
@@ -25,17 +32,18 @@
.balign 4
1:
.word errno
+FUNC_END __unified_syscall
-/* here we go and "reuse" the return for weak-void functions */
#include "dietuglyweaks.h"
- mov pc, lr @ return
+ RET
#else
-__unified_syscall4:
+FUNC_START __unified_syscall4
ldmia sp!, {r4, r5, r6}
-__unified_syscall:
+
+FUNC_START __unified_syscall
cmn r0, #4096
movcc pc, lr @ return value comes direct from kernel.
@@ -53,10 +61,13 @@
/* here we go and "reuse" the return for weak-void functions */
#include "dietuglyweaks.h"
- mov pc, lr @ return
+ RET
#ifndef WANT_THREAD_SAFE
+ .align 2
.L0: .long errno
#endif
+FUNC_END __unified_syscall
+FUNC_END __unified_syscall4
#endif
Index: pkg-dietlibc/arm/waitpid.S
===================================================================
--- pkg-dietlibc.orig/arm/waitpid.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/waitpid.S 2012-03-25 15:12:55.000000000 +0000
@@ -1,15 +1,8 @@
-.text
-#ifdef __ARM_EABI__
-.align 4
-#else
-.align 2
-#endif
-.weak waitpid
-.type waitpid, %function
-waitpid:
-.global __libc_waitpid
-.type __libc_waitpid, %function
-__libc_waitpid:
+#include "arm-features.h"
+
+FUNC_START_WEAK waitpid
+FUNC_START __libc_waitpid
mov r3, #0
b wait4
- .size waitpid, .-waitpid
+FUNC_END __libc_waitpid
+FUNC_END waitpid

View File

@ -0,0 +1,71 @@
From: Thorsten Glaser <tg@mirbsd.org>
Date: Tue, 8 Nov 2011 22:33:12 +0000
Subject: [PATCH] fix mmap syscall on ARM
several issues found while debugging on the Debian armhf porterbox
on #debian-arm with pbrook (Paul Brook) and lindi- (Timo Juhani Lindfors)
- the comment only applies to the non-EABI part of the function
- "This is ARM code. But you've not maked mmap as a function symbol."
=> use the arm-features.h macros
Index: pkg-dietlibc/arm/mmap.S
===================================================================
--- pkg-dietlibc.orig/arm/mmap.S 2012-03-25 15:07:28.000000000 +0000
+++ pkg-dietlibc/arm/mmap.S 2012-03-25 15:14:00.000000000 +0000
@@ -1,22 +1,13 @@
#include <errno.h>
#include "syscalls.h"
+#include "dietfeatures.h"
+#include "arm-features.h"
.text
-@
-@ mmap takes 6 parameters - ie more than can be passed in registers via the
-@ regular syscall interface. Instead, parameters are passed on the stack.
-@
-@ On entry, the compiler will have already placed the fifth and sixth
-@ parameters on the stack - all we need do here is push the first four and
-@ call the syscall.
-@
-
-.global mmap
+FUNC_START mmap
#ifdef __ARM_EABI__
-
-mmap:
str r5, [sp, #-4]!
ldr r5, [sp, #8]
str r4, [sp, #-4]!
@@ -28,11 +19,19 @@
ldr r4, [sp], #4
ldr r5, [sp], #4
cmn r0, #4096
- mov pc, lr @ return
+ RET
+
+#else
+
+@
+@ mmap takes 6 parameters - ie more than can be passed in registers via the
+@ regular syscall interface. Instead, parameters are passed on the stack.
+@
+@ On entry, the compiler will have already placed the fifth and sixth
+@ parameters on the stack - all we need do here is push the first four and
+@ call the syscall.
+@
-#else
-
-mmap:
stmdb sp!, {r0, r1, r2, r3}
mov r0, sp
swi __NR_mmap
@@ -40,3 +39,5 @@
b __unified_syscall
#endif
+
+FUNC_END mmap

View File

@ -0,0 +1,25 @@
From: Thorsten Glaser <tg@debian.org>
Date: Sun, 30 Sep 2012 13:56:52 +0000
Subject: fix jmp_buf size on armhf
On armhf (!__SOFTFP__) with __ARM_ARCH__ >= 6 and __ARM_NEON__,
sigsetjmp() can store as much as 42 registers:
* d0 - d15 (armhf) => 16
* d16 - d31 (NEON) => 16
* r4 - r11, sp, lr => 10
Make appropriate space for that in jmp_buf and remove an unused
define at the same time.
--- a/include/setjmp.h
+++ b/include/setjmp.h
@@ -164,9 +164,8 @@ typedef int __jmp_buf[3];
#endif
#ifdef __arm__
-#define __JMP_BUF_SP 8
#ifndef __ASSEMBLER__
-typedef int __jmp_buf[24];
+typedef int __jmp_buf[42];
#endif
#endif