Gentoo Archives: gentoo-commits

From: "Michael Januszewski (spock)" <spock@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/klibc: klibc-1.5.20.ebuild ChangeLog
Date: Sun, 28 Nov 2010 19:59:52
Message-Id: 20101128195937.5B6E320051@flycatcher.gentoo.org
1 spock 10/11/28 19:59:37
2
3 Modified: ChangeLog
4 Added: klibc-1.5.20.ebuild
5 Log:
6 Version bump (bugs #310011, #336830).
7
8 (Portage version: 2.1.9.25/cvs/Linux x86_64)
9
10 Revision Changes Path
11 1.73 dev-libs/klibc/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/klibc/ChangeLog?rev=1.73&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/klibc/ChangeLog?rev=1.73&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/klibc/ChangeLog?r1=1.72&r2=1.73
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v
20 retrieving revision 1.72
21 retrieving revision 1.73
22 diff -u -r1.72 -r1.73
23 --- ChangeLog 10 Jan 2010 09:50:36 -0000 1.72
24 +++ ChangeLog 28 Nov 2010 19:59:37 -0000 1.73
25 @@ -1,6 +1,12 @@
26 # ChangeLog for dev-libs/klibc
27 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.72 2010/01/10 09:50:36 robbat2 Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/ChangeLog,v 1.73 2010/11/28 19:59:37 spock Exp $
30 +
31 +*klibc-1.5.20 (28 Nov 2010)
32 +
33 + 28 Nov 2010; MichaƂ Januszewski <spock@g.o> +klibc-1.5.20.ebuild,
34 + +files/klibc-1.5.20-kbuild.patch:
35 + Version bump (bugs #310011, #336830).
36
37 10 Jan 2010; Robin H. Johnson <robbat2@g.o> klibc-1.5.12-r1.ebuild,
38 klibc-1.5.15.ebuild, klibc-1.5.15-r1.ebuild:
39
40
41
42 1.1 dev-libs/klibc/klibc-1.5.20.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/klibc/klibc-1.5.20.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/klibc/klibc-1.5.20.ebuild?rev=1.1&content-type=text/plain
46
47 Index: klibc-1.5.20.ebuild
48 ===================================================================
49 # Copyright 1999-2010 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/dev-libs/klibc/klibc-1.5.20.ebuild,v 1.1 2010/11/28 19:59:37 spock Exp $
52
53 # Robin H. Johnson <robbat2@g.o>, 12 Nov 2007:
54 # This still needs major work.
55 # But it is significently better than the previous version.
56 # In that it will now build on biarch systems, such as ppc64-32ul.
57
58 # NOTES:
59 # ======
60 # We need to bring in the kernel sources seperately
61 # Because they have to be configured in a way that differs from the copy in
62 # /usr/src/. The sys-kernel/linux-headers are too stripped down to use
63 # unfortunetly.
64 # This will be able to go away once the klibc author updates his code
65 # to build again the headers provided by the kernel's 'headers_install' target.
66
67 inherit eutils multilib toolchain-funcs
68
69 DESCRIPTION="A minimal libc subsetfor use with initramfs."
70 HOMEPAGE="http://www.zytor.com/mailman/listinfo/klibc"
71 KV_MAJOR="2" KV_MINOR="6" KV_SUB="36"
72 PKV_EXTRA=""
73 if [ -n "${PKV_EXTRA}" ]; then
74 PKV="${KV_MAJOR}.${KV_MINOR}.$((${KV_SUB}+1))-${PKV_EXTRA}"
75 PATCH_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/patch-${PKV}.bz2"
76 fi
77 OKV="${KV_MAJOR}.${KV_MINOR}.${KV_SUB}"
78 KERNEL_URI="
79 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2
80 mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/testing/linux-${OKV}.tar.bz2"
81 SRC_URI="
82 mirror://kernel/linux/libs/klibc/1.5/${P}.tar.bz2
83 mirror://kernel/linux/libs/klibc/Current/${P}.tar.bz2
84 ${PATCH_URI}
85 ${KERNEL_URI}"
86
87 LICENSE="|| ( GPL-2 LGPL-2 )"
88 KEYWORDS="~amd64 -mips ~ppc ~sparc ~x86 ~arm"
89 SLOT="0"
90 IUSE="debug n32"
91
92 DEPEND="dev-lang/perl"
93 RDEPEND="${DEPEND}"
94
95 KS="${WORKDIR}/linux-${OKV}"
96
97 # Klibc has no PT_GNU_STACK support, so scanning for execstacks is moot
98 QA_EXECSTACK="*"
99 # Do not strip
100 RESTRICT="strip"
101
102 kernel_asm_arch() {
103 a="${1:${ARCH}}"
104 case ${a} in
105 # Merged arches
106 x86|amd64) echo x86 ;;
107 ppc*) echo powerpc ;;
108 # Non-merged
109 alpha|arm|ia64|m68k|mips|sh|sparc*) echo ${1} ;;
110 *) die "TODO: Update the code for your asm-ARCH symlink" ;;
111 esac
112 }
113
114 # For a given Gentoo ARCH,
115 # specify the kernel defconfig most relevant
116 kernel_defconfig() {
117 a="${1:${ARCH}}"
118 # most, but not all arches have a sanely named defconfig
119 case ${a} in
120 ppc64) echo ppc64_defconfig ;;
121 ppc) echo pmac32_defconfig ;;
122 sh*) die "TODO: Your arch is not supported by the klibc ebuild. Please suggest a defconfig in a bug." ;;
123 *) echo defconfig ;;
124 esac
125 }
126
127 src_unpack() {
128 unpack linux-${OKV}.tar.bz2 ${P}.tar.bz2
129 [ -n "${PKV}" ] && EPATCH_OPTS="-d ${KS} -p1" epatch "${DISTDIR}"/patch-${PKV}.bz2
130 cd "${S}"
131
132 # Symlink /usr/src/linux to ${S}/linux
133 ln -snf "${KS}" linux
134 #ln -snf "/usr" linux
135
136 # Build interp.o with EXTRA_KLIBCAFLAGS (.S source)
137 epatch "${FILESDIR}"/${PN}-1.4.11-interp-flags.patch
138
139 # Fix usage of -s, bug #201006
140 epatch "${FILESDIR}"/klibc-1.5.7-strip-fix-dash-s.patch
141
142 # Fix infinite loop during build with make 3.82
143 # http://www.zytor.com/pipermail/klibc/2010-November/002786.html
144 epatch "${FILESDIR}"/${PN}-1.5.20-kbuild.patch
145 }
146
147 # klibc has it's own ideas of arches
148 # They reflect userspace strictly.
149 # This functions maps from a Gentoo ARCH, to an arch that klibc expects
150 # Look at klibc-${S}/usr/klibc/arch for a list of these arches
151 klibc_arch() {
152 a="${1:${ARCH}}"
153 case ${a} in
154 amd64) echo x86_64;;
155 mips) die 'TODO: Use the $ABI' ;;
156 x86) echo i386;;
157 *) echo ${a} ;;
158 esac
159 }
160
161 src_compile() {
162 local myargs="all"
163 local myARCH="${ARCH}" myABI="${ABI}"
164 # TODO: For cross-compiling
165 # You should set ARCH and ABI here
166 CC="$(tc-getCC)"
167 HOSTCC="$(tc-getBUILD_CC)"
168 KLIBCARCH="$(klibc_arch ${ARCH})"
169 KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
170 libdir="$(get_libdir)"
171 # This should be the defconfig corresponding to your userspace!
172 # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
173 defconfig=$(kernel_defconfig ${ARCH})
174 unset ABI ARCH # Unset these, because they interfere
175 unset KBUILD_OUTPUT # we are using a private copy
176
177 cd "${KS}"
178 emake ${defconfig} CC="${CC}" HOSTCC="${HOSTCC}" || die "No defconfig"
179 if [[ "${KLIBCARCH/arm}" != "${KLIBCARCH}" ]] && \
180 [[ "${CHOST/eabi}" != "${CHOST}" ]]; then
181 # The delete and insert are seperate statements
182 # so that they are reliably used.
183 sed -i \
184 -e '/CONFIG_AEABI/d' \
185 -e '1iCONFIG_AEABI=y' \
186 -e '/CONFIG_OABI_COMPAT/d' \
187 -e '1iCONFIG_OABI_COMPAT=y' \
188 "${KS}"/.config \
189 "${S}"/defconfig
190 fi
191 emake prepare CC="${CC}" HOSTCC="${HOSTCC}" || die "Failed to prepare kernel sources for header usage"
192
193 cd "${S}"
194
195 use debug && myargs="${myargs} V=1"
196 use test && myargs="${myargs} test"
197
198 emake \
199 EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
200 EXTRA_KLIBCLDFLAGS="-z,noexecstack" \
201 HOSTCC="${HOSTCC}" CC="${CC}" \
202 INSTALLDIR="/usr/${libdir}/klibc" \
203 KLIBCARCH=${KLIBCARCH} \
204 KLIBCASMARCH=${KLIBCASMARCH} \
205 SHLIBDIR="/${libdir}" \
206 libdir="/usr/${libdir}" \
207 mandir="/usr/share/man" \
208 T="${T}" \
209 ${myargs} || die "Compile failed!"
210
211 #SHLIBDIR="/${libdir}" \
212
213 ARCH="${myARCH}" ABI="${myABI}"
214 }
215
216 src_install() {
217 local myargs
218 local myARCH="${ARCH}" myABI="${ABI}"
219 # TODO: For cross-compiling
220 # You should set ARCH and ABI here
221 CC="$(tc-getCC)"
222 HOSTCC="$(tc-getBUILD_CC)"
223 KLIBCARCH="$(klibc_arch ${ARCH})"
224 KLIBCASMARCH="$(kernel_asm_arch ${ARCH})"
225 libdir="$(get_libdir)"
226 # This should be the defconfig corresponding to your userspace!
227 # NOT your kernel. PPC64-32ul would choose 'ppc' for example.
228 defconfig=$(kernel_defconfig ${ARCH})
229
230 use debug && myargs="${myargs} V=1"
231
232 local klibc_prefix
233 if tc-is-cross-compiler ; then
234 klibc_prefix=$("${S}/klcc/${KLIBCARCH}-klcc" -print-klibc-prefix)
235 else
236 klibc_prefix=$("${S}/klcc/klcc" -print-klibc-prefix)
237 fi
238
239 unset ABI ARCH # Unset these, because they interfere
240 unset KBUILD_OUTPUT # we are using a private copy
241
242 emake \
243 EXTRA_KLIBCAFLAGS="-Wa,--noexecstack" \
244 EXTRA_KLIBCLDFLAGS="-z,noexecstack" \
245 HOSTCC="${HOSTCC}" CC="${CC}" \
246 INSTALLDIR="/usr/${libdir}/klibc" \
247 INSTALLROOT="${D}" \
248 KLIBCARCH=${KLIBCARCH} \
249 KLIBCASMARCH=${KLIBCASMARCH} \
250 SHLIBDIR="/${libdir}" \
251 libdir="/usr/${libdir}" \
252 mandir="/usr/share/man" \
253 ${myargs} \
254 install || die "Install failed!"
255
256 #SHLIBDIR="/${libdir}" \
257
258 # klibc doesn't support prelinking, so we need to mask it
259 cat > "${T}/70klibc" <<-EOF
260 PRELINK_PATH_MASK="/usr/${libdir}/klibc"
261 EOF
262
263 doenvd "${T}"/70klibc
264
265 # Fix the permissions (bug #178053) on /usr/${libdir}/klibc/include
266 # Actually I have no idea, why the includes have those weird-ass permissions
267 # on a particular system, might be due to inherited permissions from parent
268 # directory
269 find "${D}"/usr/${libdir}/klibc/include | xargs chmod o+rX
270
271 # Hardlinks becoming copies
272 for x in gunzip zcat ; do
273 rm -f "${D}/${klibc_prefix}/bin/${x}"
274 dosym gzip "${klibc_prefix}/bin/${x}"
275 done
276
277 # Restore now, so we can use the tc- functions
278 ARCH="${myARCH}" ABI="${myABI}"
279 if ! tc-is-cross-compiler ; then
280 cd "${S}"
281 insinto /usr/share/aclocal
282 doins contrib/klibc.m4
283
284 dodoc README usr/klibc/CAVEATS
285 docinto gzip; dodoc usr/gzip/README
286 fi
287
288 # Fix up the symlink
289 # Mainly for merged arches
290 linkname="${D}/usr/${libdir}/klibc/include/asm"
291 if [ -L "${linkname}" ] && [ ! -e "${linkname}" ] ; then
292 ln -snf asm-${KLIBCASMARCH} "${linkname}"
293 fi
294 }
295
296 src_test() {
297 if ! tc-is-cross-compiler ; then
298 cd "${S}"/usr/klibc/tests
299 ALL_TESTS="$(ls *.c |sed 's,\.c$,,g')"
300 BROKEN_TESTS="idtest fcntl fnmatch testrand48"
301 failed=0
302 for t in $ALL_TESTS ; do
303 if has $t $BROKEN_TESTS ; then
304 echo "=== $t SKIP"
305 else
306 echo -n "=== $t "
307 ./$t </dev/null >/dev/null
308 rc=$?
309 if [ $rc -eq 0 ]; then
310 echo PASS
311 else
312 echo FAIL
313 failed=1
314 fi
315 fi
316 done
317 [ $failed -ne 0 ] && die "Some tests failed."
318 fi
319 }