From 0affa672e38eda6a7295e1f54eb6958b01689831 Mon Sep 17 00:00:00 2001 From: Sune Kloppenborg Jeppesen Date: Wed, 26 Sep 2012 10:23:56 +0200 Subject: [PATCH] Add old uclibc ebuilds used for GNAP. --- sys-libs/uclibc/ChangeLog | 478 ++++++++++++++++++ sys-libs/uclibc/Manifest | 18 + sys-libs/uclibc/files/gen_wc8bit.patch | 47 ++ sys-libs/uclibc/files/gen_wctype.patch | 183 +++++++ sys-libs/uclibc/files/locales.txt | 22 + sys-libs/uclibc/files/uClibc-ppoll.patch | 25 + sys-libs/uclibc/files/uClibc-ppoll.patch.full | 25 + .../uclibc-0.9.33_pre20110617-clean.patch | 8 + .../uclibc-0.9.33_pre20110913-clean.patch | 8 + sys-libs/uclibc/metadata.xml | 32 ++ sys-libs/uclibc/patch | 27 + sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild | 380 ++++++++++++++ .../uclibc/uclibc-0.9.30.1-r1.ebuild.orig | 380 ++++++++++++++ sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.rej | 42 ++ sys-libs/uclibc/uclibc-0.9.30.1-r2.ebuild | 382 ++++++++++++++ .../uclibc/uclibc-0.9.33_pre20110913.ebuild | 393 ++++++++++++++ 16 files changed, 2450 insertions(+) create mode 100644 sys-libs/uclibc/ChangeLog create mode 100644 sys-libs/uclibc/Manifest create mode 100644 sys-libs/uclibc/files/gen_wc8bit.patch create mode 100644 sys-libs/uclibc/files/gen_wctype.patch create mode 100644 sys-libs/uclibc/files/locales.txt create mode 100644 sys-libs/uclibc/files/uClibc-ppoll.patch create mode 100644 sys-libs/uclibc/files/uClibc-ppoll.patch.full create mode 100644 sys-libs/uclibc/files/uclibc-0.9.33_pre20110617-clean.patch create mode 100644 sys-libs/uclibc/files/uclibc-0.9.33_pre20110913-clean.patch create mode 100644 sys-libs/uclibc/metadata.xml create mode 100644 sys-libs/uclibc/patch create mode 100644 sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild create mode 100644 sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.orig create mode 100644 sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.rej create mode 100644 sys-libs/uclibc/uclibc-0.9.30.1-r2.ebuild create mode 100644 sys-libs/uclibc/uclibc-0.9.33_pre20110913.ebuild diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog new file mode 100644 index 0000000..36acc22 --- /dev/null +++ b/sys-libs/uclibc/ChangeLog @@ -0,0 +1,478 @@ +# ChangeLog for sys-libs/uclibc +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.59 2011/04/20 18:10:38 ulm Exp $ + + 20 Apr 2011; Ulrich Mueller uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, uclibc-0.9.28.3-r7.ebuild, + uclibc-0.9.28.3-r8.ebuild, uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild, + uclibc-0.9.30.1-r1.ebuild: + Don't PROVIDE virtual/libc, bug 359001. + + 06 Feb 2011; Mart Raudsepp uclibc-0.9.27-r1.ebuild: + Drop to ~mips + + 18 Jan 2010; uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r7.ebuild, uclibc-0.9.28.3-r8.ebuild, + uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild: + - update headers + + 18 Jan 2010; uclibc-0.9.30.1-r1.ebuild: + - Add avr32 target. Bug 267449 + + 04 Nov 2009; Mike Frysinger uclibc-0.9.30.1-r1.ebuild: + Dont try installing ldd/ldconfig utils when shared library support is + disabled #291787 by Petric Frank. + + 17 Oct 2009; Mike Frysinger uclibc-0.9.28.3-r8.ebuild: + Stabilize for all #289522 by Ryan Hill. + + 23 Sep 2009; Patrick Lauer uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r7.ebuild, uclibc-0.9.28.3-r8.ebuild, + uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild, uclibc-0.9.30.1-r1.ebuild: + Re-add virtual/libc PROVIDE as it is still needed + + 23 Sep 2009; Patrick Lauer uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r7.ebuild, uclibc-0.9.28.3-r8.ebuild, + uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild, uclibc-0.9.30.1-r1.ebuild: + Remove virtual/libc + + 25 Aug 2009; Mike Frysinger uclibc-0.9.28.3-r8.ebuild: + Install a simple fenv.h for newer gcc versions #266298 by Antonio Pezo. + +*uclibc-0.9.28.3-r8 (25 Aug 2009) + + 25 Aug 2009; Mike Frysinger + +uclibc-0.9.28.3-r8.ebuild: + Backport some fixes to get latest stable utils building (like + iproute2/udev). + + 25 Aug 2009; Mike Frysinger uclibc-0.9.28.3-r7.ebuild: + Mark arm/m68k/ppc/sh/x86 stable. + + 26 Jul 2009; Mike Frysinger uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r7.ebuild, uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild, + uclibc-0.9.30.1-r1.ebuild: + Dont bother installing ldd/ldconfig man pages as common man pages work + fine for the most part #254650 by Anthony Giorgio. + + 22 Jul 2009; Zac Medico uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r7.ebuild, uclibc-0.9.30.ebuild, uclibc-0.9.30.1.ebuild, + uclibc-0.9.30.1-r1.ebuild: + Bug #270496 - Fix PROVIDE conditionals to use elibc_uclibc. + + 20 Jul 2009; Mike Frysinger uclibc-0.9.30.1.ebuild, + uclibc-0.9.30.1-r1.ebuild: + Fix getline() conflict with glibc-2.10 #277186 by Diego E. Pettenò. + +*uclibc-0.9.30.1-r1 (12 Mar 2009) + + 12 Mar 2009; +uclibc-0.9.30.1-r1.ebuild: + - import a few svn patches from upstream. fixes bug 262181 + +*uclibc-0.9.30.1 (03 Mar 2009) + + 03 Mar 2009; +uclibc-0.9.30.1.ebuild: + - version bump + + 10 Jan 2009; Stuart Longland uclibc-0.9.30.ebuild: + Added ~mips keyword. uClibc appears to work fine on both mips and mipsel + with one caveat: it doesn't work on 16KB page size kernels (i.e. Loongson) + see http://bugs.busybox.net/show_bug.cgi?id=9 for info here. + + It *does* however, work fine on my Cobalt Qube2 and SGI O2, where I am + building stages. + + 02 Jan 2009; metadata.xml, uclibc-0.9.30.ebuild: + work around gcc-4 lack of ssp by default support while +hardened is enabled + +*uclibc-0.9.30 (28 Nov 2008) + + 28 Nov 2008; -uclibc-0.9.28.3-r6.ebuild, + -uclibc-0.9.30_rc1.ebuild, -uclibc-0.9.30_rc3.ebuild, + +uclibc-0.9.30.ebuild: + - version bump and some cleanup + + 09 Nov 2008; uclibc-0.9.30_rc3.ebuild: + - psm reports headers need -j1 flag + + 01 Nov 2008; Mike Frysinger uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.3.ebuild, uclibc-0.9.28.3-r3.ebuild, + uclibc-0.9.28.3-r6.ebuild, uclibc-0.9.28.3-r7.ebuild, + uclibc-0.9.30_rc1.ebuild, uclibc-0.9.30_rc3.ebuild: + Unify some ebuild differences and fix header-only install with newer + versions #234748 by Nathan Brink. + +*uclibc-0.9.30_rc3 (29 Oct 2008) + + 29 Oct 2008; +uclibc-0.9.30_rc3.ebuild: + - version bump. rc3 drops all gentoo patches. merged upstream + +*uclibc-0.9.30_rc1 (23 Sep 2008) + + 23 Sep 2008; +uclibc-0.9.30_rc1.ebuild: + - Initial import of 0.9.30_rc1 branch for gentoo testing/QA before final the + release. (many thanks to torindel for helping out with this) + + 23 Aug 2008; Doug Goldstein metadata.xml: + add GLEP 56 USE flag desc from use.local.desc + +*uclibc-0.9.28.3-r7 (08 Jun 2008) + + 08 Jun 2008; +uclibc-0.9.28.3-r7.ebuild: + - fix up a few cross compile problems for arm + +*uclibc-0.9.28.3-r6 (05 May 2008) + + 05 May 2008; -uclibc-0.9.28.ebuild, + -uclibc-0.9.28-r1.ebuild, -uclibc-0.9.28-r2.ebuild, + -uclibc-0.9.28.1.ebuild, -uclibc-0.9.28.3-r1.ebuild, + -uclibc-0.9.28.3-r2.ebuild, -uclibc-0.9.28.3-r4.ebuild, + -uclibc-0.9.28.3-r5.ebuild, +uclibc-0.9.28.3-r6.ebuild: + - little cleanup and add the realpath patch from bug 125701 to address the + sandbox problem with coreutils + +*uclibc-0.9.28.3-r5 (04 May 2008) + + 04 May 2008; +uclibc-0.9.28.3-r5.ebuild: + [Bug 219598] [PATCH] sys-libs/uclibc-0.9.28.3 - backport of splice(2), + tee(2) and vmsplice(2) syscalls + + 23 Apr 2008; uclibc-0.9.28.3-r3.ebuild: + - stable on arm/ppc/x86 + + 16 Apr 2008; Christian Heim uclibc-0.9.28.3-r4.ebuild: + Remove the extra distmirror (my devspace from SRC_URI). + + 16 Apr 2008; Christian Heim uclibc-0.9.28.3-r4.ebuild: + Silent revision bump (ie just incrementing the patch version) to grab the + libm stuff, which was missing from CVS. + +*uclibc-0.9.28.3-r4 (16 Apr 2008) + + 16 Apr 2008; Christian Heim + +uclibc-0.9.28.3-r4.ebuild: + Revision bump, pulling in svn r16022 to fix readdir_r return value (uClibc + #1022; #217612 by Natanael Copa). + + 27 Mar 2008; Christian Heim uclibc-0.9.28.3-r2.ebuild: + Marking uclibc-0.9.28.3-r2 stable on ppc too. + +*uclibc-0.9.28.3-r3 (24 Mar 2008) + + 24 Mar 2008; +uclibc-0.9.28.3-r3.ebuild: + - sync queue.h up from svn HEAD + + 15 Mar 2008; Christian Heim uclibc-0.9.28.3-r2.ebuild: + Stabilizing uclibc-0.9.28.3-r2 on x86, as per solar's acknowledgement. + +*uclibc-0.9.28.3-r2 (01 Jan 2008) + + 01 Jan 2008; +uclibc-0.9.28.3-r2.ebuild: + * 0.9.28.3 - 1.2 - Backport a few header defines + +*uclibc-0.9.28.3-r1 (21 Sep 2007) + + 21 Sep 2007; +uclibc-0.9.28.3-r1.ebuild: + backport posix_memalign() function + + 02 Jul 2007; Piotr Jaroszyński + uclibc-0.9.27-r1.ebuild, uclibc-0.9.28.ebuild, uclibc-0.9.28-r1.ebuild, + uclibc-0.9.28-r2.ebuild, uclibc-0.9.28.1.ebuild, uclibc-0.9.28.3.ebuild: + (QA) RESTRICT clean up. + + 30 Jun 2007; Mike Frysinger uclibc-0.9.27-r1.ebuild, + uclibc-0.9.28.ebuild, uclibc-0.9.28-r1.ebuild, uclibc-0.9.28-r2.ebuild, + uclibc-0.9.28.1.ebuild, uclibc-0.9.28.3.ebuild: + Use `as` and `file` to determine the toolchain endianness #171849. + + 07 Apr 2007; Mike Frysinger uclibc-0.9.28.3.ebuild: + Install hostutils (ldd/ldconfig) for cross-compilers #172207. + +*uclibc-0.9.28.3 (25 Mar 2007) + + 25 Mar 2007; Mike Frysinger +uclibc-0.9.28.3.ebuild: + Version bump #168747 by Josh G. + + 16 Feb 2007; Diego Pettenò + uclibc-0.9.27-r1.ebuild, uclibc-0.9.28.ebuild, uclibc-0.9.28-r1.ebuild, + uclibc-0.9.28-r2.ebuild, uclibc-0.9.28.1.ebuild: + Fix tc-is-softfloat logic, as reported on gentoo-embedded by Scott L. Price. + +*uclibc-0.9.28.1 (28 Jan 2007) + + 28 Jan 2007; Mike Frysinger +uclibc-0.9.28.1.ebuild: + Version bump. + +*uclibc-0.9.28-r2 (15 Jan 2007) + + 15 Jan 2007; +uclibc-0.9.28-r2.ebuild: + - import readahead() symbol and import from Joakim Tjernlund - + uClibc-svn-r17162 (Support SecurePLTs for PowerPC) + +*uclibc-0.9.28-r1 (14 Oct 2006) + + 14 Oct 2006; Mike Frysinger +uclibc-0.9.28-r1.ebuild: + Push out accumulated fixes. + + 27 Jan 2006; Mike Frysinger uclibc-0.9.28.ebuild: + Stabilize, add a few minor bugfixes, and add support for USE=savedconfig. + + 25 Nov 2005; uclibc-0.9.28.ebuild: + - the __uClibc_start_main is becoming a problem for users thus we need to + check the bins before allowing them to have uclibc-compat disabled + + 13 Nov 2005; uclibc-0.9.28.ebuild: + - moredefs.. + + 07 Nov 2005; uclibc-0.9.28.ebuild: + Enabled DL_FINI_CRT_COMPAT by default + + 05 Sep 2005; Mike Frysinger uclibc-0.9.27.ebuild, + uclibc-0.9.27-r1.ebuild: + Fix optimized strn functions so nano stops crashing #95395. + +*uclibc-0.9.28 (18 Aug 2005) + + 18 Aug 2005; Mike Frysinger +uclibc-0.9.28.ebuild: + Version bump. + + 05 Aug 2005; Mike Frysinger uclibc-0.9.27.ebuild, + uclibc-0.9.27-r1.ebuild: + Add patch by Yuri Vasilevski to fix FPU endian on arm #75585. + + 29 Jul 2005; Mike Frysinger uclibc-0.9.27.ebuild, + uclibc-0.9.27-r1.ebuild: + Update patchset to include armeb stat and getent fixes. + +*uclibc-0.9.27-r1 (18 Jun 2005) + + 18 Jun 2005; Mike Frysinger +uclibc-0.9.27-r1.ebuild: + New testing version by psm with partial locale support. + + 18 Jun 2005; Mike Frysinger uclibc-0.9.27.ebuild: + Add patches from upstream to fix arm/TEXTRELs and remove the duplicated + pthread_atfork() prototype from unistd.h. + + 21 Apr 2005; files/getent, uclibc-0.9.27.ebuild: + - update getent script in FILESDIR + + 17 Jan 2005; Mike Frysinger uclibc-0.9.26-r8.ebuild, + uclibc-0.9.27.ebuild: + Make sure uclibc doesnt destroy glibc hosts (sorry solar!) and fix + src_test() so it actually works. + +*uclibc-0.9.27 (14 Jan 2005) + + 14 Jan 2005; Mike Frysinger +uclibc-0.9.27.ebuild: + Version bump. + + 11 Jan 2005; Mike Frysinger uclibc-0.9.26-r8.ebuild: + Merge psm & my cross compile work together and BAM we have a sweet ebuild. + + 14 Dec 2004; uclibc-0.9.26-r8.ebuild: + - Improved hardened handling bug 73699. Initial support for xattr. + + 10 Nov 2004; uclibc-0.9.26-r8.ebuild: + uclibc updates + +*uclibc-0.9.26-r8 (06 Nov 2004) + + 06 Nov 2004; Mike Frysinger +uclibc-0.9.26-r8.ebuild: + Add the ability to select CPU/endian type #69871. + + 28 Oct 2004; uclibc-0.9.26-r7.ebuild: + uclibc-0.9.26-r7 marked stable for x86/arm/ppc/mips. 30 days in ~arch, + security changes only which mark unsecvars stable + + 13 Oct 2004; files/0.9.26/ssp.c: + more updates to ssp.c + + 12 Oct 2004; files/0.9.26/ssp.c: + reverting to old ssp behavior + +*uclibc-0.9.26-r7 (28 Sep 2004) + + 28 Sep 2004; + +files/0.9.26/uClibc-20040921-ldso-unsecvars.patch, + +files/0.9.26/unsecvars.h, +uclibc-0.9.26-r7.ebuild: + added unsecvars handling to uclibc. testing ground here and going mainline + afterwords + + 06 Sep 2004; Ciaran McCreesh uclibc-0.9.26-r3.ebuild, + uclibc-0.9.26-r4.ebuild, uclibc-0.9.26-r5.ebuild, uclibc-9999.ebuild: + Switch to use epause and ebeep, bug #62950 + +*uclibc-9999 (25 Aug 2004) + + 25 Aug 2004; Mike Frysinger + +uclibc-9999.ebuild: + CVS ebuild to make our (well mine at least) lives easier. + + 19 Aug 2004; uclibc-0.9.26-r1.ebuild, + uclibc-0.9.26-r2.ebuild, uclibc-0.9.26-r3.ebuild, uclibc-0.9.26-r4.ebuild, + uclibc-0.9.26-r5.ebuild: + update RDEPEND. bug 60911 + + 09 Aug 2004; Mike Frysinger + +files/0.9.26/uclibc-0.9.26-ldso-cache.patch, uclibc-0.9.26-r5.ebuild: + Add a small patch to allow loading of ELF_LIBC0 libraries. + + 09 Aug 2004; Mike Frysinger + +files/0.9.26/uclibc-0.9.26-resolve-segfault.patch, uclibc-0.9.26-r5.ebuild: + Add a homebrewed patch to fix the bug with gethostname() which didnt setup the + h_aliases data. + +*uclibc-0.9.26-r5 (09 Aug 2004) + + 09 Aug 2004; uclibc-0.9.26-r5.ebuild: + version bump requested by spanky + + 06 Aug 2004; Mike Frysinger + +files/0.9.26/arm-ucontext.patch, uclibc-0.9.26-r4.ebuild: + Make sure arm/ucontext.h includes the right context files and fix the ld utils + to properly read/write /etc/ld.so.* files. + +*uclibc-0.9.26-r4 (30 Jul 2004) + + 30 Jul 2004; uclibc-0.9.26-r4.ebuild: + updated the cvs snapshot so we can get some header updates + + 13 Jul 2004; uclibc-0.9.26-r3.ebuild: + paying respect to mjn3 and his DEDICATION to his wife in the docs + +*uclibc-0.9.26-r3 (12 Jul 2004) + + 12 Jul 2004; uclibc-0.9.26-r3.ebuild, + files/0.9.26/uclibc-0.9.26-noexecstack.patch: + more uclibc updates from Peter S. Mazinger + + 05 Jul 2004; uclibc-0.9.21.ebuild, + uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild, files/getent: + added getent which is a shell replacement (uclibc does not have it, but + ebuild.sh uses it. So we need it! + + 01 Jul 2004; Jeremy Huddleston uclibc-0.9.21.ebuild, + uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild: + virtual/glibc -> virtual/libc + + 27 Jun 2004; uclibc-0.9.21.ebuild, + uclibc-0.9.26-r1.ebuild, uclibc-0.9.26-r2.ebuild: + updated PROVIDES for virtual/libc + +*uclibc-0.9.26-r2 (23 Jun 2004) + + 23 Jun 2004; uclibc-0.9.26-r2.ebuild, + files/0.9.26/uclibc-0.9.26-arm-dl-sysdep.patch: + Added patch for ARCH=arm to prevent a static inlines from being included more + than one time. sent patch upstream + + 22 Jun 2004; files/0.9.26/ssp.c, + files/0.9.26/uClibc-20040613-do_rem.patch, + files/0.9.26/uclibc-0.9.26-ssp-gcc34-after-frandom.patch: + major uclibc cleanups. New IUSE= flags and functionality + + 26 May 2004; Mike Frysinger + +files/0.9.26/arm-fix-missing-syscalls.patch, uclibc-0.9.26-r1.ebuild: + Add patch to allow arm building + + 01 Feb 2004; uclibc-0.9.23.ebuild, + uclibc-0.9.26-r1.ebuild, uclibc-0.9.26.ebuild: + The etdyn local use flag has been renamed to pie (Position Independent + Executable) Removed old ebuilds.. Keeping 0.9.21 as stable till Gentoo has a + working uClibc toolchain in place + +*uclibc-0.9.26-r1 (08 Jan 2004) + + 08 Jan 2004; uclibc-0.9.26-r1.ebuild, + files/0.9.26/uClibc-0.9.26-Makefile.patch, + files/0.9.26/uClibc-0.9.26-pie-option.patch: + Attached is one patch needed to really enable FORCE_SHAREABLE_SEGMENTS + option, the other is to build uclibc against the installed kernel-headers + (not kernel-source) - Peter S. Mazinger gentoo-embedded mailing list. + +*uclibc-0.9.26 (04 Jan 2004) + + 04 Jan 2004; uclibc-0.9.25-r1.ebuild, + uclibc-0.9.25.ebuild, uclibc-0.9.26.ebuild: + version bump.. there was a pthread bug that slipped though uclibc.org testing + +*uclibc-0.9.25-r1 (04 Jan 2004) + + 04 Jan 2004; uclibc-0.9.21.ebuild, uclibc-0.9.23.ebuild, + uclibc-0.9.25-r1.ebuild, uclibc-0.9.25.ebuild: + added back etdyn/pie support for x86. If -fstack-protector is in the users + CFLAGS then let uclibc provide __guard symbols + +*uclibc-0.9.25 (03 Jan 2004) + + 03 Jan 2004; Mike Frysinger : + Version bumpage #36235. Patches no longer needed since they've all been + integrated upstream. + +*uclibc-0.9.23 (15 Nov 2003) + + 21 Nov 2003; metadata.xml: + update metadata.xml + + 21 Nov 2003; uclibc-0.9.22.ebuild, + files/uClibc-0.9.22-etdyn.patch, files/uClibc-0.9.22-pax.patch, + files/0.9.23/uClibc-0.9.23-etdyn.patch, + files/0.9.23/uClibc-0.9.23-flipturn.patch: + updated etdyn patches. no major functional changes to revision bump, removed + buggy 0.9.22 code from portage + + 15 Nov 2003; uclibc-0.9.23.ebuild, + files/0.9.23/uClibc-0.9.23-etdyn.patch, + files/0.9.23/uClibc-0.9.23-flipturn.patch, + files/0.9.23/uClibc-0.9.23-pax.patch: + version bump, 0.9.22 was braindead.. In this release we continue support for + PaX etdyn executabes thanks to the PaX Team and Peter S. Mazinger as well as + add a small patch that was submited to the uClibc by Rob McMullen + +*uclibc-0.9.22 (11 Nov 2003) + + 11 Nov 2003; uclibc-0.9.22.ebuild, + files/uClibc-0.9.22-etdyn.patch, files/uClibc-0.9.22-pax.patch: + version bump, this ebuild includes experimental pax-etdyn support for uclibc + when local use flag etdyn is used + + 04 Oct 2003; uclibc-0.9.21.ebuild: + marking stable on x86, and added a metadata.xml + +*uclibc-0.9.21 (10 Sep 2003) + + 30 Sep 2003; Joshua Kinard uclibc-0.9.21.ebuild: + Added ~sparc & ~mips to KEYWORDS + Useful for building our netboot images with + + 10 Sep 2003; uclibc-0.9.21.ebuild: + andersee is pleased to announce the immediate availability of uClibc 0.9.21. + This release has been brewing for several months now, and provides quite a lot + of additional functionality as well as quite a few bug fixes. The biggest + thing in this release (and I do mean that literally) is that uClibc now has + full ANSI/ISO C99 locale support. The most interesting thing for uClinux are + the additional config options that will let you tune the library to be even + smaller, for example, by disabling all the strerror() messages. + +*uclibc-0.9.20 (09 Jul 2003) + + 09 Jul 2003; Mike Frysinger : + Version bumpage. + +*uclibc-0.9.19 (19 Jun 2003) + + 19 Jun 2003; Mike Frysinger : + Version bump #15579 thanks to David Bryson . + +*uclibc-0.9.16 (11 Nov 2002) + + 25 May 2003; Martin Holzer uclibc-0.9.16.ebuild: + now uses mirror://kernel + + 11 Nov 2002; Mike Frysinger : + Initial import. Ebuild submitted by me. diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest new file mode 100644 index 0000000..72ca4ab --- /dev/null +++ b/sys-libs/uclibc/Manifest @@ -0,0 +1,18 @@ +AUX gen_wc8bit.patch 1192 RMD160 7791d82c012415f3a727bdcde3db21ec0a2232c9 SHA1 b6b6288b2db2eb2cafe142daecd5f259f21bc7af SHA256 a50caaf7dabd7025257946e1c795d987c14ca1120c6040034694fbfb87cc87e9 +AUX gen_wctype.patch 6681 RMD160 db084dab2d1e99dce9e9873853228a7c316683d4 SHA1 821409ef977f8bf8aba028fcdf84b62c4bd3142f SHA256 08836c362e5e69aeca18aa8ab61914384c92a0bcec3a62a5043c7dccfebb0c5b +AUX locales.txt 711 RMD160 06b9a28ca510b47f16b5b9e865d45cc52ac4907d SHA1 5a3ba6dfc1799251f74d5cbf4434a8d4b2254389 SHA256 408b2a8b5beaa8d141a6b2448b835d2323414bc6d3e114efc9ec1527aad023fa +AUX uClibc-ppoll.patch 762 RMD160 998a29be94b6030ee847a66e5b12d2b9c5f2ae90 SHA1 c8405822db87895cab7b9b2eb8bcbc36cf1fcab8 SHA256 403240cfdba58cff5cd1ce3ac3750bc920cf79e5b78899e9e345291926acc89f +AUX uClibc-ppoll.patch.full 787 RMD160 80e892d76b5892e44adb158c98f9144b05eed8d8 SHA1 cfdec245b77b7ea5c0ee4b87ad5c518b3920f34e SHA256 d81fdaf11720f1bcb37d1cc856acb5ba1d436c15adbc5e8a27032bc5dcb765bd +AUX uclibc-0.9.33_pre20110617-clean.patch 347 RMD160 4ae7015d2213e69464d6d6afd688e8d80b9719c3 SHA1 7d27e29e6374615033753530175325b4f476899f SHA256 65cd8b6b060aeffd1daa626b8ab05c8dc26b0b5f602bfad5bf0693b78fdc36df +AUX uclibc-0.9.33_pre20110913-clean.patch 347 RMD160 4ae7015d2213e69464d6d6afd688e8d80b9719c3 SHA1 7d27e29e6374615033753530175325b4f476899f SHA256 65cd8b6b060aeffd1daa626b8ab05c8dc26b0b5f602bfad5bf0693b78fdc36df +DIST uClibc-0.9.30.1-patches-1.0.tar.bz2 5501 RMD160 d2c48023fb25af45512c65ce3c5e936b5b24efe1 SHA1 bd34516c1bc71c45c5f1d078b91f323469760228 SHA256 022637d107fedd52bdd8187566e6e6378813a19f4ef8bf723a713e8d9cd8cd05 +DIST uClibc-0.9.30.1.tar.bz2 2285137 RMD160 bff9a232b1f1c73efd71247e7b91aa31d41af0ee SHA1 4b36fec9a0dacbd6fe0fd2cdb7836aaf8b7f4992 SHA256 2d9769a02c46cff73f56a076268192da1ce91c913e2e4e31c120be098f704c8c +DIST uClibc-20110913.tar.bz2 2808854 RMD160 abebcbc5ee8f5dc1d327cc5f39c271b171de2ed7 SHA1 aa023308e0ac2406c33abcae9106a70cb90a80b4 SHA256 09dfc4e6e7e02a9dafd7e5827b236191133a08244135484cbb08622787e947a6 +EBUILD uclibc-0.9.30.1-r1.ebuild 11596 RMD160 b6e69c3b4a1fef66415be334b611a305eb9eac1c SHA1 59f3ec6e39293ef0d8e24dc7d67ae5dcc66394dc SHA256 c04c4b19db017f072ac6a4351794b0758f696dd5251a607fbce1cab3764e25b3 +EBUILD uclibc-0.9.30.1-r2.ebuild 11651 RMD160 9ff11ed3248e4f62686dc8809b7474a400a6d346 SHA1 f51d430d2dc5b7b0728574b01655d114eef2ff4d SHA256 4b77eda61e370dbd67f3b61c03f3869a755fb167710093a558b2a95513285b65 +EBUILD uclibc-0.9.33_pre20110913.ebuild 12149 RMD160 ed093da3f833eafbf9ab1251b958493704e09b89 SHA1 3d00389df374848be699f7615fd6a7903ff95cbf SHA256 05d9cfbb1fa83a04d859e5e590b51f11af3cb69dd7afb2a67ff1efb48389f264 +MISC ChangeLog 18586 RMD160 027ccb19c2b0c8676625e66513112599b72d8907 SHA1 562f77f5b16345eaca9f4ae8e4d600c2ffd75e8c SHA256 f45dc12f07dc17e91f353d548a8b8d36a38a4494f3e56336c7565f24264f2b10 +MISC metadata.xml 1469 RMD160 0c3640cb24a93c003e59cd0f9fd99587881ac63e SHA1 6be5e573878f88438a0121ff49841d52f07dedcd SHA256 e2f9e4727e826e87f735157c170a4e1f5f3ff572a2a2875f6a8889dfa5c648a3 +MISC patch 1058 RMD160 569b04a5ac0b12f79272d2ceec5c4679c9a654fb SHA1 b8d580e13ec638cf72356c894f248f7213769bdc SHA256 a53392a3c39c1c0189e7aa75a4190515c96e486fa8741d6bc6e1ed8a1218ff41 +MISC uclibc-0.9.30.1-r1.ebuild.orig 11596 RMD160 b6e69c3b4a1fef66415be334b611a305eb9eac1c SHA1 59f3ec6e39293ef0d8e24dc7d67ae5dcc66394dc SHA256 c04c4b19db017f072ac6a4351794b0758f696dd5251a607fbce1cab3764e25b3 +MISC uclibc-0.9.30.1-r1.ebuild.rej 1216 RMD160 760065fb405ccba550d268baee10809d2bfadc67 SHA1 30f64a0cd825dff407349a9fdc2a84ccf7c84d84 SHA256 b1ee4f0b0f81afb46825f39e0be0b8c7729d2b505e716c7c3eb2ea97614e3abd diff --git a/sys-libs/uclibc/files/gen_wc8bit.patch b/sys-libs/uclibc/files/gen_wc8bit.patch new file mode 100644 index 0000000..1d1ff5b --- /dev/null +++ b/sys-libs/uclibc/files/gen_wc8bit.patch @@ -0,0 +1,47 @@ +--- a/extra/locale/gen_wc8bit.c ++++ b/extra/locale/gen_wc8bit.c +@@ -99,31 +99,29 @@ + int total_size = 0; + + if (!setlocale(LC_CTYPE, "en_US.UTF-8")) { +- /* Silly foreigners disabling en_US locales */ +- FILE *fp = popen("locale -a", "r"); +- if (!fp) +- goto locale_failure; +- +- while (!feof(fp)) { ++ /* setlocale might be just a stub */ ++ fp = popen("locale -a", "r"); ++ if (!fp) { ++ printf("#error could not execute 'locale -a'\n"); ++ return EXIT_FAILURE; ++ } ++ ++ /* while (!feof(fp)) { + char buf[256]; + size_t len; + +- if (fgets(buf, sizeof(buf) - 10, fp) == NULL) +- goto locale_failure; ++ if (fgets(buf, sizeof(buf) - 10, fp) == NULL) { ++ printf("#error could not read 'locale -a' output buffer\n"); ++ return EXIT_FAILURE; ++ } + + len = strlen(buf); + if (len > 0 && buf[len - 1] == '\n') + buf[--len] = '\0'; + if (len < 5 || strcasecmp(&buf[len-5], ".UTF8") != 0) + strcat(buf, ".UTF8"); +- if (setlocale(LC_CTYPE, buf)) +- goto locale_success; + } +- +- locale_failure: +- printf("could not find a UTF8 locale ... please enable en_US.UTF-8\n"); +- return EXIT_FAILURE; +- locale_success: ++ */ + pclose(fp); + } + diff --git a/sys-libs/uclibc/files/gen_wctype.patch b/sys-libs/uclibc/files/gen_wctype.patch new file mode 100644 index 0000000..b3db8cf --- /dev/null +++ b/sys-libs/uclibc/files/gen_wctype.patch @@ -0,0 +1,183 @@ +--- a/extra/locale/gen_wctype.c ++++ b/extra/locale/gen_wctype.c +@@ -227,11 +227,12 @@ + ++verbose; + continue; + } +- if (!setlocale(LC_CTYPE, *argv)) { ++ /* setlocale might be just a stub */ ++ /* if (!setlocale(LC_CTYPE, *argv)) { + verbose_msg("setlocale(LC_CTYPE,%s) failed! Skipping this locale...\n", *argv); + continue; + } +- ++ */ + if (!(totitle = wctrans("totitle"))) { + verbose_msg("no totitle transformation.\n"); + } +@@ -306,43 +307,43 @@ + #endif + #if 0 + if (c < 256) { +- unsigned int glibc; ++ unsigned int curr_stdclib; + +- glibc = 0; +- if (isalnum(c)) ++glibc; glibc <<= 1; +- if (isalpha(c)) ++glibc; glibc <<= 1; +- if (isblank(c)) ++glibc; glibc <<= 1; +- if (iscntrl(c)) ++glibc; glibc <<= 1; +- if (isdigit(c)) ++glibc; glibc <<= 1; +- if (isgraph(c)) ++glibc; glibc <<= 1; +- if (islower(c)) ++glibc; glibc <<= 1; +- if (isprint(c)) ++glibc; glibc <<= 1; +- if (ispunct(c)) ++glibc; glibc <<= 1; +- if (isspace(c)) ++glibc; glibc <<= 1; +- if (isupper(c)) ++glibc; glibc <<= 1; +- if (isxdigit(c)) ++glibc; +- verbose_msg("%#8x : ctype %#4x\n", c, glibc); ++ curr_stdclib = 0; ++ if (isalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isblank(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iscntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (islower(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isprint(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (ispunct(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isspace(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isupper(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (isxdigit(c)) ++curr_stdclib; ++ verbose_msg("%#8x : ctype %#4x\n", c, curr_stdclib); + } + #endif + #if 1 + /* Paranoid checking... */ + { +- unsigned int glibc; ++ unsigned int curr_stdclib; + unsigned int mine; + +- glibc = 0; +- if (iswalnum(c)) ++glibc; glibc <<= 1; +- if (iswalpha(c)) ++glibc; glibc <<= 1; +- if (iswblank(c)) ++glibc; glibc <<= 1; +- if (iswcntrl(c)) ++glibc; glibc <<= 1; +- if (iswdigit(c)) ++glibc; glibc <<= 1; +- if (iswgraph(c)) ++glibc; glibc <<= 1; +- if (iswlower(c)) ++glibc; glibc <<= 1; +- if (iswprint(c)) ++glibc; glibc <<= 1; +- if (iswpunct(c)) ++glibc; glibc <<= 1; +- if (iswspace(c)) ++glibc; glibc <<= 1; +- if (iswupper(c)) ++glibc; glibc <<= 1; +- if (iswxdigit(c)) ++glibc; ++ curr_stdclib = 0; ++ if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswxdigit(c)) ++curr_stdclib; + + mine = 0; + if (mywalnum(d,c)) ++mine; mine <<= 1; +@@ -358,15 +359,15 @@ + if (mywupper(d,c)) ++mine; mine <<= 1; + if (mywxdigit(d,c)) ++mine; + +- if (glibc != mine) { +- verbose_msg("%#8x : glibc %#4x != %#4x mine %u\n", c, glibc, mine, d); ++ if (curr_stdclib != mine) { ++ verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %u\n", c, curr_stdclib, mine, d); + return EXIT_FAILURE; + } + #if 0 + if (iswctype(c,is_comb) || iswctype(c,is_comb3)) { + /* if (!iswpunct(c)) { */ + verbose_msg("%#8x : %d %d %#4x\n", +- c, iswctype(c,is_comb),iswctype(c,is_comb3), glibc); ++ c, iswctype(c,is_comb),iswctype(c,is_comb3), curr_stdclib); + /* } */ + } + #endif +@@ -553,7 +554,7 @@ + for (c = 0; c <= 0x10ffffUL; c++) + #endif + { +- unsigned int glibc; ++ unsigned int curr_stdclib; + unsigned int mine; + unsigned int upper, lower; + +@@ -568,19 +569,19 @@ + } + #endif + #endif +- glibc = 0; +- if (iswalnum(c)) ++glibc; glibc <<= 1; +- if (iswalpha(c)) ++glibc; glibc <<= 1; +- if (iswblank(c)) ++glibc; glibc <<= 1; +- if (iswcntrl(c)) ++glibc; glibc <<= 1; +- if (iswdigit(c)) ++glibc; glibc <<= 1; +- if (iswgraph(c)) ++glibc; glibc <<= 1; +- if (iswlower(c)) ++glibc; glibc <<= 1; +- if (iswprint(c)) ++glibc; glibc <<= 1; +- if (iswpunct(c)) ++glibc; glibc <<= 1; +- if (iswspace(c)) ++glibc; glibc <<= 1; +- if (iswupper(c)) ++glibc; glibc <<= 1; +- if (iswxdigit(c)) ++glibc; ++ curr_stdclib = 0; ++ if (iswalnum(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswalpha(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswblank(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswcntrl(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswdigit(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswgraph(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswlower(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswprint(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswpunct(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswspace(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswupper(c)) ++curr_stdclib; curr_stdclib <<= 1; ++ if (iswxdigit(c)) ++curr_stdclib; + + { + unsigned int u; +@@ -630,8 +631,8 @@ + if (mywupper(d,c)) ++mine; mine <<= 1; + if (mywxdigit(d,c)) ++mine; + +- if (glibc != mine) { +- verbose_msg("%#8x : glibc %#4x != %#4x mine %d\n", c, glibc, mine, d); ++ if (curr_stdclib != mine) { ++ verbose_msg("%#8x : curr_stdclib %#4x != %#4x mine %d\n", c, curr_stdclib, mine, d); + if (c < 0x30000UL) { + verbose_msg("sc=%#x u=%#x n=%#x i0=%#x i1=%#x\n", sc, u, n, i0, i1); + } +@@ -655,17 +656,17 @@ + } + + if (towupper(c) != upper) { +- verbose_msg("%#8x : towupper glibc %#4x != %#4x mine\n", ++ verbose_msg("%#8x : towupper curr_stdclib %#4x != %#4x mine\n", + c, towupper(c), upper); + } + + if (towlower(c) != lower) { +- verbose_msg("%#8x : towlower glibc %#4x != %#4x mine i0 = %d\n", ++ verbose_msg("%#8x : towlower curr_stdclib %#4x != %#4x mine i0 = %d\n", + c, towlower(c), lower, i0); + } + + if (totitle && ((tt = towctrans(c, totitle)) != upper)) { +- verbose_msg("%#8x : totitle glibc %#4lx != %#4x mine i0 = %d\n", ++ verbose_msg("%#8x : totitle curr_stdclib %#4lx != %#4x mine i0 = %d\n", + c, tt, upper, i0); + } + } diff --git a/sys-libs/uclibc/files/locales.txt b/sys-libs/uclibc/files/locales.txt new file mode 100644 index 0000000..04117bc --- /dev/null +++ b/sys-libs/uclibc/files/locales.txt @@ -0,0 +1,22 @@ +# First some @modifier mappings. Internally, the modifier is signaled by +# replacing '_' in the locale name with a unique identifying character. +# For example, internally we map "ca_ES@euro" to "caeES". This allows for +# smaller code and easier processing of locale names. + +@euro e +@cyrillic c + +#--------------------------------------------------------------------------- +# Next, set to {y}es to enable and {n}o to disable the UTF-8 and the 8-bit +# codeset locales. Of course, you must have built the c8tables.h and +# the wctables.h files appropriately. + + +UTF-8 yes +8-BIT yes + +#--------------------------------------------------------------------------- +# Now the locales + +en_GB ISO-8859-1 +en_GB.UTF-8 UTF-8 diff --git a/sys-libs/uclibc/files/uClibc-ppoll.patch b/sys-libs/uclibc/files/uClibc-ppoll.patch new file mode 100644 index 0000000..8d2343a --- /dev/null +++ b/sys-libs/uclibc/files/uClibc-ppoll.patch @@ -0,0 +1,25 @@ +--- libc/sysdeps/linux/common/ppoll.c.orig 2011-11-03 19:22:18.000000000 +0100 ++++ libc/sysdeps/linux/common/ppoll.c 2011-11-03 19:24:40.000000000 +0100 +@@ -18,4 +18,5 @@ + 02111-1307 USA. */ + ++#include + #include + #include +@@ -27,7 +28,7 @@ + # define __NR___libc_ppoll __NR_ppoll + static __always_inline +-_syscall4(int, __libc_ppoll, struct pollfd *, fds, ++_syscall5(int, __libc_ppoll, struct pollfd *, fds, + nfds_t, nfds, const struct timespec *, timeout, +- const __sigset_t *, sigmask) ++ const __sigset_t *, sigmask, size_t, sigsetsize) + + int +@@ -44,5 +45,5 @@ + } + +- return __libc_ppoll(fds, nfds, timeout, sigmask); ++ return __libc_ppoll(fds, nfds, timeout, sigmask, _NSIG / 8); + } + libc_hidden_def(ppoll) diff --git a/sys-libs/uclibc/files/uClibc-ppoll.patch.full b/sys-libs/uclibc/files/uClibc-ppoll.patch.full new file mode 100644 index 0000000..5c41795 --- /dev/null +++ b/sys-libs/uclibc/files/uClibc-ppoll.patch.full @@ -0,0 +1,25 @@ +--- libc/sysdeps/linux/common/ppoll.c.orig 2011-11-03 18:14:00.000000000 +0000 ++++ libc/sysdeps/linux/common/ppoll.c 2011-11-03 18:15:34.000000000 +0000 +@@ -18,4 +18,5 @@ + 02111-1307 USA. */ + ++#include + #include + #include +@@ -27,7 +28,7 @@ + # define __NR___libc_ppoll __NR_ppoll + static __always_inline +-_syscall4(int, __libc_ppoll, struct pollfd *, fds, ++_syscall5(int, __libc_ppoll, struct pollfd *, fds, + nfds_t, nfds, const struct timespec *, timeout, +- const __sigset_t *, sigmask) ++ const __sigset_t *, sigmask, size_t, sigsetsize) + + int +@@ -44,5 +45,5 @@ + } + +- return __libc_ppoll(fds, nfds, timeout, sigmask); ++ return __libc_ppoll(fds, nfds, timeout, sigmask, _NSIG / 8); + } + libc_hidden_def(ppoll) diff --git a/sys-libs/uclibc/files/uclibc-0.9.33_pre20110617-clean.patch b/sys-libs/uclibc/files/uclibc-0.9.33_pre20110617-clean.patch new file mode 100644 index 0000000..9b768ff --- /dev/null +++ b/sys-libs/uclibc/files/uclibc-0.9.33_pre20110617-clean.patch @@ -0,0 +1,8 @@ +--- libubacktrace/Makefile.in.orig 2011-06-22 23:37:18.000000000 +0100 ++++ libubacktrace/Makefile.in 2011-06-22 23:37:37.000000000 +0100 +@@ -72,4 +72,4 @@ + + CLEAN_libubacktrace: + $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a) \ +- $(addprefix $(libubacktrace_ARCH_OUT)/*., o os oS a) ++ $(addprefix $(libubacktrace_OUT)/*., o os oS a) diff --git a/sys-libs/uclibc/files/uclibc-0.9.33_pre20110913-clean.patch b/sys-libs/uclibc/files/uclibc-0.9.33_pre20110913-clean.patch new file mode 100644 index 0000000..9b768ff --- /dev/null +++ b/sys-libs/uclibc/files/uclibc-0.9.33_pre20110913-clean.patch @@ -0,0 +1,8 @@ +--- libubacktrace/Makefile.in.orig 2011-06-22 23:37:18.000000000 +0100 ++++ libubacktrace/Makefile.in 2011-06-22 23:37:37.000000000 +0100 +@@ -72,4 +72,4 @@ + + CLEAN_libubacktrace: + $(do_rm) $(addprefix $(libubacktrace_OUT)/*., o os oS a) \ +- $(addprefix $(libubacktrace_ARCH_OUT)/*., o os oS a) ++ $(addprefix $(libubacktrace_OUT)/*., o os oS a) diff --git a/sys-libs/uclibc/metadata.xml b/sys-libs/uclibc/metadata.xml new file mode 100644 index 0000000..7d7facc --- /dev/null +++ b/sys-libs/uclibc/metadata.xml @@ -0,0 +1,32 @@ + + + + embedded + + vapier@gentoo.org + Primary Maintainer + + + solar@gentoo.org + Secondary Maintainer + + +uClibc pronounced yew-see-lib-see is a C library for developing embedded Linux +systems. It is much smaller than the GNU C Library, but nearly all applications supported +by glibc also work perfectly with uClibc. Porting applications from glibc to uClibc +typically involves just recompiling the source code. uClibc even supports shared libraries +and threading. It currently runs on standard Linux and MMU-less (also known as uClinux) +systems with support for alpha, ARM, cris, i386, i960, h8300, m68k, mips/mipsel, PowerPC, +SH, SPARC, and v850 processors. + + + Force the use of ssp to be built into a hardened uclibc setup + Use pregenerated locales + Adds support for user defined configs + Build uclibc with backwards compatible + options + Build only the locales specified in + /etc/locales.build + Add support for word expansion (wordexp.h) + + diff --git a/sys-libs/uclibc/patch b/sys-libs/uclibc/patch new file mode 100644 index 0000000..b3c6f9c --- /dev/null +++ b/sys-libs/uclibc/patch @@ -0,0 +1,27 @@ +--- /usr/portage/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild 2011-04-20 19:31:26.000000000 +0100 ++++ /usr/local/portage/sys-libs/uclibc/uclibc-0.9.33_pre20110617.ebuild2011-06-23 19:43:24.000000000 +0100 +@@ -170,6 +173,10 @@ + epatch "${WORKDIR}"/patch + fi + ++ epatch "${FILESDIR}"/${PN}-${PV}-clean.patch ++ epatch "${FILESDIR}"/gen_wc8bit.patch ++ epatch "${FILESDIR}"/gen_wctype.patch ++ + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## +@@ -305,6 +312,14 @@ + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" ++ ++ # TODO: These should depend on some useflag, eg iconv ++ # Run after make clean, otherwise files removed ++ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt ++ #cp ./extra/locale/LOCALES ./extra/locale/locales.txt ++ cp "${FILESDIR}"/locales.txt ./extra/locale/locales.txt ++ # TODO: Now edit locales as appropriate... ++ # FIXME: ... + } + diff --git a/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild new file mode 100644 index 0000000..ad1e4d3 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild @@ -0,0 +1,380 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $ + +#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" +#inherit subversion +inherit eutils flag-o-matic toolchain-funcs savedconfig + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +# Handle the case where we want uclibc on glibc ... +if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then + export UCLIBC_AND_GLIBC="sitting in a tree" + export CTARGET=${CHOST%%-*}-pc-linux-uclibc +fi + +MY_P=uClibc-0.9.30.1 +SVN_VER="" +PATCH_VER="1.0" +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2" + +[[ -z ${SVN_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" +[[ -z ${PATCH_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +IUSE="build uclibc-compat debug hardened ssp ipv6 minimal wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +RDEPEND="" +if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then + DEPEND="" + SLOT="${CTARGET}" +else + DEPEND="virtual/os-headers app-misc/pax-utils" + SLOT="0" +fi + +S=${WORKDIR}/${MY_P} + +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ + || [[ -n ${UCLIBC_AND_GLIBC} ]] + then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "big";; + *" LSB "*) echo "little";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + just_headers && return 0 + has_version ${CATEGORY}/uclibc || return 0 + [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 + [[ ${ROOT} != "/" ]] && return 0 + [[ ${CATEGORY} == cross-* ]] && return 0 + +} + +PIE_STABLE="arm mips ppc x86" + +CPU_ALPHA="" +CPU_AMD64="" +CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI" +CPU_PPC="" +CPU_SH="SH{2,3,4,5}" +CPU_SPARC="SPARC_V{7,8,9,9B}" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +set_opt() { + sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config + echo "$1=$2" >> .config +} +get_opt() { + ( + unset $1 + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_unpack() { + [[ -n ${ESVN_REPO_URI} ]] \ + && subversion_src_unpack \ + || unpack ${A} + cd "${S}" + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## PATCHES ########## + + [[ -n ${SVN_VER} ]] && \ + epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch + + if [[ -n ${PATCH_VER} ]] ; then + unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patch + fi + + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32"; config_target="no cpu-specific options";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + ########## CONFIG SETUP ########## + + make ARCH=${target} defconfig >/dev/null || die "could not config" + + for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; do + sed -i -e "s:${def}=y:# ${def} is not set:" .config + done + if use debug ; then + set_opt SUPPORT_LD_DEBUG y + set_opt DODEBUG y + fi + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y + + if [[ $(tc-is-softfloat) != "no" ]] ; then + set_opt UCLIBC_HAS_FPU n + fi + + if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then + set_opt CONFIG_ARM_OABI n + set_opt CONFIG_ARM_EABI y + fi + + local moredefs="COMPAT_ATEXIT" + local compat_sym=atexit + + # We need todo this for a few months. .30 is a major upgrade. + # Don't do it from cross-compiling case though + if ! use uclibc-compat ; then + if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ + ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then + local fnames="" + einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol" + fnames=$(scanelf -pyqs${compat_sym} -F%F#s) + if [[ -z ${fnames} ]] ; then + einfo "This system is clean." + einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" + moredefs="" + else + ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." + ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq" + echo + ewarn "Leaving on ${moredefs}" + fi + else + moredefs="" + fi + fi + for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do + set_opt "${def}" y + done + set_opt UCLIBC_HAS_CTYPE_UNSAFE n + set_opt UCLIBC_HAS_LOCALE n + + use ipv6 && set_opt UCLIBC_HAS_IPV6 y + + use wordexp && set_opt UCLIBC_HAS_WORDEXP y + + # we need to do it independently of hardened to get ssp.c built into libc + set_opt UCLIBC_HAS_SSP y + set_opt UCLIBC_HAS_SSP_COMPAT y + set_opt UCLIBC_HAS_ARC4RANDOM y + set_opt PROPOLICE_BLOCK_ABRT n + set_opt PROPOLICE_BLOCK_SEGV y + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc; then + set_opt UCLIBC_BUILD_NOEXECSTACK y + else + set_opt UCLIBC_BUILD_NOEXECSTACK n + fi + set_opt UCLIBC_BUILD_RELRO y + if use hardened ; then + if has $(tc-arch) ${PIE_STABLE} ; then + set_opt UCLIBC_BUILD_PIE y + else + set_opt UCLIBC_BUILD_PIE n + fi + set_opt UCLIBC_BUILD_NOW y + use ssp && { + set_opt SSP_QUICK_CANARY n + set_opt UCLIBC_BUILD_SSP y + } + else + set_opt UCLIBC_BUILD_PIE n + set_opt SSP_QUICK_CANARY y + set_opt UCLIBC_BUILD_SSP n + set_opt UCLIBC_BUILD_NOW n + fi + + restore_config .config + + # setup build and run paths + local cross=${CTARGET}- + type -p ${cross}ar > /dev/null || cross="" + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" + + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" +} + +src_compile() { + cp myconfig .config + + emake headers || die "make headers failed" + just_headers && return 0 + + emake || die "make failed" + if [[ ${CTARGET} != ${CHOST} ]] ; then + emake -C utils hostutils || die "make hostutils failed" + elif [[ ${CHOST} == *-uclibc* ]] ; then + emake utils || die "make utils failed" + fi +} + +src_test() { + [[ ${CHOST} != ${CTARGET} ]] && return 0 + [[ ${CBUILD} != ${CHOST} ]] && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + make UCLIBC_ONLY=1 check || die "test failed" +} + +src_install() { + local sysroot=${D} + [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die "install failed" + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if [[ ${CTARGET} != ${CHOST} ]] ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + if [[ ${CHOST} == *-uclibc* ]] ; then + emake DESTDIR="${D}" install_utils || die "install-utils failed" + dobin extra/scripts/getent + fi + + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + [[ ${CTARGET} != ${CHOST} ]] && return 0 + [[ ${CHOST} != *-uclibc* ]] && return 0 + + if [[ ! -e ${ROOT}/etc/TZ ]] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [[ ${ROOT} != "/" ]] && return 0 + # update cache before reloading init + /sbin/ldconfig + # reload init ... + [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null +} diff --git a/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.orig b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.orig new file mode 100644 index 0000000..ad1e4d3 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.orig @@ -0,0 +1,380 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $ + +#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" +#inherit subversion +inherit eutils flag-o-matic toolchain-funcs savedconfig + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +# Handle the case where we want uclibc on glibc ... +if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then + export UCLIBC_AND_GLIBC="sitting in a tree" + export CTARGET=${CHOST%%-*}-pc-linux-uclibc +fi + +MY_P=uClibc-0.9.30.1 +SVN_VER="" +PATCH_VER="1.0" +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2" + +[[ -z ${SVN_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" +[[ -z ${PATCH_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +IUSE="build uclibc-compat debug hardened ssp ipv6 minimal wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +RDEPEND="" +if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then + DEPEND="" + SLOT="${CTARGET}" +else + DEPEND="virtual/os-headers app-misc/pax-utils" + SLOT="0" +fi + +S=${WORKDIR}/${MY_P} + +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ + || [[ -n ${UCLIBC_AND_GLIBC} ]] + then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "big";; + *" LSB "*) echo "little";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + just_headers && return 0 + has_version ${CATEGORY}/uclibc || return 0 + [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 + [[ ${ROOT} != "/" ]] && return 0 + [[ ${CATEGORY} == cross-* ]] && return 0 + +} + +PIE_STABLE="arm mips ppc x86" + +CPU_ALPHA="" +CPU_AMD64="" +CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI" +CPU_PPC="" +CPU_SH="SH{2,3,4,5}" +CPU_SPARC="SPARC_V{7,8,9,9B}" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +set_opt() { + sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config + echo "$1=$2" >> .config +} +get_opt() { + ( + unset $1 + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_unpack() { + [[ -n ${ESVN_REPO_URI} ]] \ + && subversion_src_unpack \ + || unpack ${A} + cd "${S}" + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## PATCHES ########## + + [[ -n ${SVN_VER} ]] && \ + epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch + + if [[ -n ${PATCH_VER} ]] ; then + unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patch + fi + + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32"; config_target="no cpu-specific options";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + ########## CONFIG SETUP ########## + + make ARCH=${target} defconfig >/dev/null || die "could not config" + + for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; do + sed -i -e "s:${def}=y:# ${def} is not set:" .config + done + if use debug ; then + set_opt SUPPORT_LD_DEBUG y + set_opt DODEBUG y + fi + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y + + if [[ $(tc-is-softfloat) != "no" ]] ; then + set_opt UCLIBC_HAS_FPU n + fi + + if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then + set_opt CONFIG_ARM_OABI n + set_opt CONFIG_ARM_EABI y + fi + + local moredefs="COMPAT_ATEXIT" + local compat_sym=atexit + + # We need todo this for a few months. .30 is a major upgrade. + # Don't do it from cross-compiling case though + if ! use uclibc-compat ; then + if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ + ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then + local fnames="" + einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol" + fnames=$(scanelf -pyqs${compat_sym} -F%F#s) + if [[ -z ${fnames} ]] ; then + einfo "This system is clean." + einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" + moredefs="" + else + ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." + ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq" + echo + ewarn "Leaving on ${moredefs}" + fi + else + moredefs="" + fi + fi + for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do + set_opt "${def}" y + done + set_opt UCLIBC_HAS_CTYPE_UNSAFE n + set_opt UCLIBC_HAS_LOCALE n + + use ipv6 && set_opt UCLIBC_HAS_IPV6 y + + use wordexp && set_opt UCLIBC_HAS_WORDEXP y + + # we need to do it independently of hardened to get ssp.c built into libc + set_opt UCLIBC_HAS_SSP y + set_opt UCLIBC_HAS_SSP_COMPAT y + set_opt UCLIBC_HAS_ARC4RANDOM y + set_opt PROPOLICE_BLOCK_ABRT n + set_opt PROPOLICE_BLOCK_SEGV y + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc; then + set_opt UCLIBC_BUILD_NOEXECSTACK y + else + set_opt UCLIBC_BUILD_NOEXECSTACK n + fi + set_opt UCLIBC_BUILD_RELRO y + if use hardened ; then + if has $(tc-arch) ${PIE_STABLE} ; then + set_opt UCLIBC_BUILD_PIE y + else + set_opt UCLIBC_BUILD_PIE n + fi + set_opt UCLIBC_BUILD_NOW y + use ssp && { + set_opt SSP_QUICK_CANARY n + set_opt UCLIBC_BUILD_SSP y + } + else + set_opt UCLIBC_BUILD_PIE n + set_opt SSP_QUICK_CANARY y + set_opt UCLIBC_BUILD_SSP n + set_opt UCLIBC_BUILD_NOW n + fi + + restore_config .config + + # setup build and run paths + local cross=${CTARGET}- + type -p ${cross}ar > /dev/null || cross="" + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" + + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" +} + +src_compile() { + cp myconfig .config + + emake headers || die "make headers failed" + just_headers && return 0 + + emake || die "make failed" + if [[ ${CTARGET} != ${CHOST} ]] ; then + emake -C utils hostutils || die "make hostutils failed" + elif [[ ${CHOST} == *-uclibc* ]] ; then + emake utils || die "make utils failed" + fi +} + +src_test() { + [[ ${CHOST} != ${CTARGET} ]] && return 0 + [[ ${CBUILD} != ${CHOST} ]] && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + make UCLIBC_ONLY=1 check || die "test failed" +} + +src_install() { + local sysroot=${D} + [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die "install failed" + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if [[ ${CTARGET} != ${CHOST} ]] ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + if [[ ${CHOST} == *-uclibc* ]] ; then + emake DESTDIR="${D}" install_utils || die "install-utils failed" + dobin extra/scripts/getent + fi + + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + [[ ${CTARGET} != ${CHOST} ]] && return 0 + [[ ${CHOST} != *-uclibc* ]] && return 0 + + if [[ ! -e ${ROOT}/etc/TZ ]] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [[ ${ROOT} != "/" ]] && return 0 + # update cache before reloading init + /sbin/ldconfig + # reload init ... + [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null +} diff --git a/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.rej b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.rej new file mode 100644 index 0000000..1bc2aa9 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild.rej @@ -0,0 +1,42 @@ +*************** +*** 170,175 **** + epatch "${WORKDIR}"/patch + fi + + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## +--- 173,182 ---- + epatch "${WORKDIR}"/patch + fi + ++ epatch "${FILESDIR}"/${PN}-${PV}-clean.patch ++ epatch "${FILESDIR}"/gen_wc8bit.patch ++ epatch "${FILESDIR}"/gen_wctype.patch ++ + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## +*************** +*** 305,310 **** + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" + } + + +--- 312,325 ---- + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" ++ ++ # TODO: These should depend on some useflag, eg iconv ++ # Run after make clean, otherwise files removed ++ find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt ++ #cp ./extra/locale/LOCALES ./extra/locale/locales.txt ++ cp "${FILESDIR}"/locales.txt ./extra/locale/locales.txt ++ # TODO: Now edit locales as appropriate... ++ # FIXME: ... + } + + diff --git a/sys-libs/uclibc/uclibc-0.9.30.1-r2.ebuild b/sys-libs/uclibc/uclibc-0.9.30.1-r2.ebuild new file mode 100644 index 0000000..0e2b0b6 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.30.1-r2.ebuild @@ -0,0 +1,382 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $ + +#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" +#inherit subversion +inherit eutils flag-o-matic toolchain-funcs savedconfig + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +# Handle the case where we want uclibc on glibc ... +if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then + export UCLIBC_AND_GLIBC="sitting in a tree" + export CTARGET=${CHOST%%-*}-pc-linux-uclibc +fi + +MY_P=uClibc-0.9.30.1 +SVN_VER="" +PATCH_VER="1.0" +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2" + +[[ -z ${SVN_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" +[[ -z ${PATCH_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +IUSE="build uclibc-compat debug hardened ssp ipv6 minimal wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +RDEPEND="" +if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then + DEPEND="" + SLOT="${CTARGET}" +else + DEPEND="virtual/os-headers app-misc/pax-utils" + SLOT="0" +fi + +S=${WORKDIR}/${MY_P} + +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ + || [[ -n ${UCLIBC_AND_GLIBC} ]] + then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "big";; + *" LSB "*) echo "little";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + just_headers && return 0 + has_version ${CATEGORY}/uclibc || return 0 + [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 + [[ ${ROOT} != "/" ]] && return 0 + [[ ${CATEGORY} == cross-* ]] && return 0 + +} + +PIE_STABLE="arm mips ppc x86" + +CPU_ALPHA="" +CPU_AMD64="" +CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI" +CPU_PPC="" +CPU_SH="SH{2,3,4,5}" +CPU_SPARC="SPARC_V{7,8,9,9B}" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +set_opt() { + sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config + echo "$1=$2" >> .config +} +get_opt() { + ( + unset $1 + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_unpack() { + [[ -n ${ESVN_REPO_URI} ]] \ + && subversion_src_unpack \ + || unpack ${A} + cd "${S}" + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## PATCHES ########## + + #Ppoll patch + epatch "${FILESDIR}"/uClibc-ppoll.patch + [[ -n ${SVN_VER} ]] && \ + epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch + + if [[ -n ${PATCH_VER} ]] ; then + unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patch + fi + + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32"; config_target="no cpu-specific options";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + ########## CONFIG SETUP ########## + + make ARCH=${target} defconfig >/dev/null || die "could not config" + + for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; do + sed -i -e "s:${def}=y:# ${def} is not set:" .config + done + if use debug ; then + set_opt SUPPORT_LD_DEBUG y + set_opt DODEBUG y + fi + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y + + if [[ $(tc-is-softfloat) != "no" ]] ; then + set_opt UCLIBC_HAS_FPU n + fi + + if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then + set_opt CONFIG_ARM_OABI n + set_opt CONFIG_ARM_EABI y + fi + + local moredefs="COMPAT_ATEXIT" + local compat_sym=atexit + + # We need todo this for a few months. .30 is a major upgrade. + # Don't do it from cross-compiling case though + if ! use uclibc-compat ; then + if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ + ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then + local fnames="" + einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol" + fnames=$(scanelf -pyqs${compat_sym} -F%F#s) + if [[ -z ${fnames} ]] ; then + einfo "This system is clean." + einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" + moredefs="" + else + ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." + ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq" + echo + ewarn "Leaving on ${moredefs}" + fi + else + moredefs="" + fi + fi + for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do + set_opt "${def}" y + done + set_opt UCLIBC_HAS_CTYPE_UNSAFE n + set_opt UCLIBC_HAS_LOCALE n + + use ipv6 && set_opt UCLIBC_HAS_IPV6 y + + use wordexp && set_opt UCLIBC_HAS_WORDEXP y + + # we need to do it independently of hardened to get ssp.c built into libc + set_opt UCLIBC_HAS_SSP y + set_opt UCLIBC_HAS_SSP_COMPAT y + set_opt UCLIBC_HAS_ARC4RANDOM y + set_opt PROPOLICE_BLOCK_ABRT n + set_opt PROPOLICE_BLOCK_SEGV y + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc; then + set_opt UCLIBC_BUILD_NOEXECSTACK y + else + set_opt UCLIBC_BUILD_NOEXECSTACK n + fi + set_opt UCLIBC_BUILD_RELRO y + if use hardened ; then + if has $(tc-arch) ${PIE_STABLE} ; then + set_opt UCLIBC_BUILD_PIE y + else + set_opt UCLIBC_BUILD_PIE n + fi + set_opt UCLIBC_BUILD_NOW y + use ssp && { + set_opt SSP_QUICK_CANARY n + set_opt UCLIBC_BUILD_SSP y + } + else + set_opt UCLIBC_BUILD_PIE n + set_opt SSP_QUICK_CANARY y + set_opt UCLIBC_BUILD_SSP n + set_opt UCLIBC_BUILD_NOW n + fi + + restore_config .config + + # setup build and run paths + local cross=${CTARGET}- + type -p ${cross}ar > /dev/null || cross="" + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" + + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" +} + +src_compile() { + cp myconfig .config + + emake headers || die "make headers failed" + just_headers && return 0 + + emake || die "make failed" + if [[ ${CTARGET} != ${CHOST} ]] ; then + emake -C utils hostutils || die "make hostutils failed" + elif [[ ${CHOST} == *-uclibc* ]] ; then + emake utils || die "make utils failed" + fi +} + +src_test() { + [[ ${CHOST} != ${CTARGET} ]] && return 0 + [[ ${CBUILD} != ${CHOST} ]] && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + make UCLIBC_ONLY=1 check || die "test failed" +} + +src_install() { + local sysroot=${D} + [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die "install failed" + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if [[ ${CTARGET} != ${CHOST} ]] ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + if [[ ${CHOST} == *-uclibc* ]] ; then + emake DESTDIR="${D}" install_utils || die "install-utils failed" + dobin extra/scripts/getent + fi + + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + [[ ${CTARGET} != ${CHOST} ]] && return 0 + [[ ${CHOST} != *-uclibc* ]] && return 0 + + if [[ ! -e ${ROOT}/etc/TZ ]] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [[ ${ROOT} != "/" ]] && return 0 + # update cache before reloading init + /sbin/ldconfig + # reload init ... + [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null +} diff --git a/sys-libs/uclibc/uclibc-0.9.33_pre20110913.ebuild b/sys-libs/uclibc/uclibc-0.9.33_pre20110913.ebuild new file mode 100644 index 0000000..56528b0 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.33_pre20110913.ebuild @@ -0,0 +1,393 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.30.1-r1.ebuild,v 1.9 2011/04/20 18:10:38 ulm Exp $ + +#ESVN_REPO_URI="svn://uclibc.org/trunk/uClibc" +#inherit subversion +inherit eutils flag-o-matic toolchain-funcs savedconfig + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi +# Handle the case where we want uclibc on glibc ... +if [[ ${CTARGET} == ${CHOST} ]] && [[ ${CHOST} != *-uclibc* ]] ; then + export UCLIBC_AND_GLIBC="sitting in a tree" + export CTARGET=${CHOST%%-*}-pc-linux-uclibc +fi + +MY_P=uClibc-20110913 +SVN_VER="" +#PATCH_VER="1.0" +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +#SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2" +SRC_URI="http://uclibc.org/downloads/snapshots/${MY_P}.tar.bz2" + +[[ -z ${SVN_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-svn-update-${SVN_VER}.patch.bz2" +[[ -z ${PATCH_VER} ]] || \ + SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2" + +LICENSE="LGPL-2" +SLOT="0" +KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +IUSE="build elibc_uclibc uclibc-compat debug hardened ssp ipv6 minimal wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +RDEPEND="" +if [[ -n $CTARGET && ${CTARGET} != ${CHOST} ]]; then + DEPEND="" + SLOT="${CTARGET}" +else + DEPEND="virtual/os-headers app-misc/pax-utils" + SLOT="0" +fi + +S=${WORKDIR}/uClibc + +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] \ + || [[ -n ${UCLIBC_AND_GLIBC} ]] + then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && [[ ${CHOST} != ${CTARGET} ]] +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "big";; + *" LSB "*) echo "little";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + just_headers && return 0 + has_version ${CATEGORY}/uclibc || return 0 + [[ -n ${UCLIBC_AND_GLIBC} ]] && return 0 + [[ ${ROOT} != "/" ]] && return 0 + [[ ${CATEGORY} == cross-* ]] && return 0 + +} + +PIE_STABLE="arm mips ppc x86" + +CPU_ALPHA="" +CPU_AMD64="" +CPU_ARM="GENERIC_ARM ARM{610,710,7TDMI,720T,920T,922T,926T,10T,1136JF_S,1176JZ{_,F_}S,_{SA110,SA1100,XSCALE,IWMMXT}}" +CPU_IA64="" +CPU_M68K="" +CPU_MIPS="MIPS_ISA_{1,2,3,4,MIPS{32,64}} MIPS_{N64,O32,N32}_ABI" +CPU_PPC="" +CPU_SH="SH{2,3,4,5}" +CPU_SPARC="SPARC_V{7,8,9,9B}" +CPU_X86="GENERIC_386 {3,4,5,6}86 586MMX PENTIUM{II,III,4} K{6,7} ELAN CRUSOE WINCHIP{C6,2} CYRIXIII NEHEMIAH" +IUSE_UCLIBC_CPU="${CPU_ARM} ${CPU_MIPS} ${CPU_PPC} ${CPU_SH} ${CPU_SPARC} ${CPU_X86}" + +check_cpu_opts() { + local cpu_var="CPU_$(echo $(tc-arch) | tr [a-z] [A-Z])" + [[ -z ${!cpu_var} ]] && return 0 + + if [[ -z ${UCLIBC_CPU} ]] ; then + ewarn "You really should consider setting UCLIBC_CPU" + ewarn "Otherwise, the build will be generic (read: slow)." + ewarn "Available CPU options:" + UCLIBC_CPU=$(eval echo ${!cpu_var}) + echo ${UCLIBC_CPU} + case ${CTARGET} in + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + *) export UCLIBC_CPU=${UCLIBC_CPU%% *};; + esac + else + local cpu found=0 + for cpu in $(eval echo ${!cpu_var}) ; do + [[ ${UCLIBC_CPU} == "${cpu}" ]] && found=1 && break + done + if [[ ${found} -eq 0 ]] ; then + ewarn "UCLIBC_CPU choice '${UCLIBC_CPU}' not supported" + ewarn "Valid choices:" + eval echo ${!cpu_var} + die "pick a supported cpu type" + fi + fi +} + +set_opt() { + sed -i -e "/^\# $1 is not set/d" -e "/^$1=.*/d" .config + echo "$1=$2" >> .config +} +get_opt() { + ( + unset $1 + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_unpack() { + [[ -n ${ESVN_REPO_URI} ]] \ + && subversion_src_unpack \ + || unpack ${A} + cd "${S}" + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## PATCHES ########## + + [[ -n ${SVN_VER} ]] && \ + epatch "${WORKDIR}"/${MY_P}-cvs-update-${SVN_VER}.patch + + if [[ -n ${PATCH_VER} ]] ; then + unpack ${MY_P}-patches-${PATCH_VER}.tar.bz2 + EPATCH_SUFFIX="patch" + epatch "${WORKDIR}"/patch + fi + + #epatch "${FILESDIR}"/${PN}-${PV}-clean.patch + epatch "${FILESDIR}"/gen_wc8bit.patch + epatch "${FILESDIR}"/gen_wctype.patch + + sed -i 's:getline:get_line:' extra/scripts/unifdef.c #277186 + + ########## CPU SELECTION ########## + + local target config_target + case $(tc-arch) in + alpha) target="alpha"; config_target="no cpu-specific options";; + amd64) target="x86_64"; config_target="no cpu-specific options";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32"; config_target="no cpu-specific options";; + ia64) target="ia64"; config_target="no cpu-specific options";; + m68k) target="m68k"; config_target="no cpu-specific options";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc"; config_target="no cpu-specific options";; + sh) target="sh"; config_target="SH4";; + sparc) target="sparc"; config_target="no cpu-specific options";; + x86) target="i386"; config_target="GENERIC_386";; + *) die "$(tc-arch) lists no defaults :/";; + esac + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + ########## CONFIG SETUP ########## + + make ARCH=${target} defconfig >/dev/null || die "could not config" + + for def in DO{DEBUG{,_PT},ASSERTS} SUPPORT_LD_DEBUG{,_EARLY} UCLIBC_HAS_PROFILING; do + sed -i -e "s:${def}=y:# ${def} is not set:" .config + done + if use debug ; then + set_opt SUPPORT_LD_DEBUG y + set_opt DODEBUG y + fi + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + set_opt "ARCH_WANTS_$(uclibc_endian | tr [a-z] [A-Z])_ENDIAN" y + + if [[ $(tc-is-softfloat) != "no" ]] ; then + set_opt UCLIBC_HAS_FPU n + fi + + if [[ ${CTARGET/eabi} != ${CTARGET} ]] ; then + set_opt CONFIG_ARM_OABI n + set_opt CONFIG_ARM_EABI y + fi + + local moredefs="COMPAT_ATEXIT" + local compat_sym=atexit + + # We need todo this for a few months. .30 is a major upgrade. + # Don't do it from cross-compiling case though + if ! use uclibc-compat ; then + if [[ -z ${UCLIBC_AND_GLIBC} ]] && [[ -z ${UCLIBC_SCANNED_COMPAT} ]] && \ + ! just_headers && [[ ${CHOST} == ${CTARGET} ]] ; then + local fnames="" + einfo "Doing a scanelf in paths for bins containing the ${compat_sym} symbol" + fnames=$(scanelf -pyqs${compat_sym} -F%F#s) + if [[ -z ${fnames} ]] ; then + einfo "This system is clean." + einfo "To prevent the scanning of files again in the future you can export UCLIBC_SCANNED_COMPAT=1" + moredefs="" + else + ewarn "You need to remerge the packages that contain the following files before you can remerge ${P} without USE=uclibc-compat enabled." + ewarn "qfile -Cq $(echo ${fnames}) | sort | uniq" + echo + ewarn "Leaving on ${moredefs}" + fi + else + moredefs="" + fi + fi + for def in ${moredefs} MALLOC_GLIBC_COMPAT DO_C99_MATH UCLIBC_HAS_{RPC,FULL_RPC,CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC,FTW} UCLIBC_HAS_REENTRANT_RPC UCLIBC_HAS_GNU_GLOB PTHREADS_DEBUG_SUPPORT UCLIBC_HAS_TZ_FILE_READ_MANY UCLIBC_HAS_FENV UCLIBC_SUSV3_LEGACY UCLIBC_SUSV3_LEGACY_MACROS UCLIBC_HAS_PROGRAM_INVOCATION_NAME ; do + set_opt "${def}" y + done + set_opt UCLIBC_HAS_CTYPE_UNSAFE n + set_opt UCLIBC_HAS_LOCALE n + + use ipv6 && set_opt UCLIBC_HAS_IPV6 y + + use wordexp && set_opt UCLIBC_HAS_WORDEXP y + + # we need to do it independently of hardened to get ssp.c built into libc + set_opt UCLIBC_HAS_SSP y + set_opt UCLIBC_HAS_SSP_COMPAT y + set_opt UCLIBC_HAS_ARC4RANDOM y + set_opt PROPOLICE_BLOCK_ABRT n + set_opt PROPOLICE_BLOCK_SEGV y + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc; then + set_opt UCLIBC_BUILD_NOEXECSTACK y + else + set_opt UCLIBC_BUILD_NOEXECSTACK n + fi + set_opt UCLIBC_BUILD_RELRO y + if use hardened ; then + if has $(tc-arch) ${PIE_STABLE} ; then + set_opt UCLIBC_BUILD_PIE y + else + set_opt UCLIBC_BUILD_PIE n + fi + set_opt UCLIBC_BUILD_NOW y + use ssp && { + set_opt SSP_QUICK_CANARY n + set_opt UCLIBC_BUILD_SSP y + } + else + set_opt UCLIBC_BUILD_PIE n + set_opt SSP_QUICK_CANARY y + set_opt UCLIBC_BUILD_SSP n + set_opt UCLIBC_BUILD_NOW n + fi + + restore_config .config + + # setup build and run paths + local cross=${CTARGET}- + type -p ${cross}ar > /dev/null || cross="" + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${cross}\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + yes "" 2> /dev/null | make -s oldconfig > /dev/null || die "could not make oldconfig" + + cp .config myconfig + + emake -s clean > /dev/null || die "could not clean" + + # TODO: These should depend on some useflag, eg iconv + # Run after make clean, otherwise files removed + find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt + #cp ./extra/locale/LOCALES ./extra/locale/locales.txt + cp "${FILESDIR}"/locales.txt ./extra/locale/locales.txt + # TODO: Now edit locales as appropriate... + # FIXME: ... +} + +src_compile() { + cp myconfig .config + + emake headers || die "make headers failed" + just_headers && return 0 + + emake || die "make failed" + if [[ ${CTARGET} != ${CHOST} ]] ; then + emake -C utils hostutils || die "make hostutils failed" + elif [[ ${CHOST} == *-uclibc* ]] ; then + emake utils || die "make utils failed" + fi +} + +src_test() { + [[ ${CHOST} != ${CTARGET} ]] && return 0 + [[ ${CBUILD} != ${CHOST} ]] && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + make UCLIBC_ONLY=1 check || die "test failed" +} + +src_install() { + local sysroot=${D} + [[ ${CHOST} != ${CTARGET} ]] && sysroot="${sysroot}/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die "install failed" + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # Make sure we install the sys-include symlink so that when + # we build a 2nd stage cross-compiler, gcc finds the target + # system headers correctly. See gcc/doc/gccinstall.info + if [[ ${CTARGET} != ${CHOST} ]] ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + if [[ ${CHOST} == *-uclibc* ]] ; then + emake DESTDIR="${D}" install_utils || die "install-utils failed" + dobin extra/scripts/getent + fi + + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + [[ ${CTARGET} != ${CHOST} ]] && return 0 + [[ ${CHOST} != *-uclibc* ]] && return 0 + + if [[ ! -e ${ROOT}/etc/TZ ]] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + [[ ! -d ${ROOT}/etc ]] && mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [[ ${ROOT} != "/" ]] && return 0 + # update cache before reloading init + /sbin/ldconfig + # reload init ... + [[ -x /sbin/telinit ]] && /sbin/telinit U &> /dev/null +}