Magellan Linux

Contents of /smage/trunk/core/glibc/glibc-2.30-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 13742 - (show annotations) (download)
Wed Aug 7 09:13:51 2019 UTC (4 years, 8 months ago) by niro
File size: 17797 byte(s)
-linux-libc-headers-4.19.64, binutils-2.32, glibc-2.30, gcc-9.1.0 toolchain - stage1
1 # $Id$
2
3 PNAME="glibc"
4 PVER="2.30"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="glibc glibc-dev glibc-locale-de glibc-locale-us"
8
9 PCAT="sys-libs"
10 HOMEPAGE="http://www.gnu.org/software/libc/libc.html"
11
12 GLIBC_DEPEND=">= sys-apps/base-files-0.7
13 >= sys-libs/tzdata-2019"
14
15 # we force headers to one specific version
16 SDEPEND="== sys-kernel/linux-libc-headers-4.19.64
17 >= dev-lang/python3-3
18 ${GLIBC_DEPEND}"
19
20 # functions to include in the mage file
21 SPECIAL_FUNCTIONS="fix_db_files"
22
23 SRCFILE="glibc-${PVER}.tar.xz"
24 SRCDIR="${BUILDDIR}/glibc-${PVER}"
25
26 ENVD_REV="1.2"
27
28 sminclude mtools cleanutils alx
29
30 SRC_URI=(
31 ftp://sources.redhat.com/pub/glibc/releases/${SRCFILE}
32 ftp://sources.redhat.com/pub/glibc/snapshots/${SRCFILE}
33 gnu://${PNAME}/${SRCFILE}
34 mirror://${PNAME}/${SRCFILE}
35 mirror://${PNAME}/glibc.envd-${ENVD_REV}
36 mirror://${PNAME}/locale.gen-header
37 mirror://${PNAME}/locale-gen
38 mirror://${PNAME}/${PNAME}-2.17-syscalld-infinite-loop.patch
39 )
40
41 # sed line: on 2 digits add an zero: 2.7 -> 2.7.0
42 UP2DATE="updatecmd_gnu ${PNAME/-nptl/} | sed 's/^\([0-9]\.[0-9]\$\)/\1.0/'"
43
44 # glibc don't like strong CFLAGS
45 #export CFLAGS="${CFLAGS//-O?} -O2"
46 # glibc -> nptl thread don't like striping
47 msetfeature "!strip static"
48
49 # hack to fix NPTL issues with xen, only required on 32bit arches
50 if [[ ${ARCH} = i*86 ]]
51 then
52 export CFLAGS="${CFLAGS} -mno-tls-direct-seg-refs"
53 fi
54
55 ## glibc-2.6.1 and above needs march CFLAGS: -march=${ARCH} -mtune=generic
56 ## first filter -mtune and -march from flags
57 #for flag in ${CFLAGS}
58 #do
59 # case ${flag} in
60 # -mtune=*) continue ;;
61 # -march=*) continue ;;
62 # esac
63 # newflags="${newflags} ${flag}"
64 #done
65 #export CFLAGS="${newflags}"
66 #
67 ## than add our defaults for glibc
68 #[[ ${ARCH} = i*86 ]] && export CFLAGS="${CFLAGS} -march=${ARCH}" # only i*86
69 #export CFLAGS="${CFLAGS} -mtune=generic" # all arches
70 #export CXXFLAGS="${CFLAGS}"
71
72 # use other linux-headers
73 [[ -z ${ALT_HEADERS} ]] && export ALT_HEADERS="/usr/include"
74
75 # kernel support
76 export ENABLE_KERNEL=3.2.0
77
78 split_info_glibc()
79 {
80 DESCRIPTION="GNU libc6 (also called glibc2) C library with NPTL Threads."
81 DEPEND="${GLIBC_DEPEND}"
82 PROVIDE="virtual/glibc"
83 }
84
85 split_info_glibc-dev()
86 {
87 DESCRIPTION="Development files for sys-libs/glibc-${PVER}."
88 DEPEND="== sys-libs/glibc-${PVER}"
89 PROVIDE="virtual/glibc-dev"
90 }
91
92 split_info_glibc-locale-de()
93 {
94 DESCRIPTION="Provide german locales for sys-libs/glibc-${PVER}."
95 DEPEND="== sys-libs/glibc-${PVER}"
96 }
97
98 split_info_glibc-locale-us()
99 {
100 DESCRIPTION="Provide english US locales for sys-libs/glibc-${PVER}."
101 DEPEND="== sys-libs/glibc-${PVER}"
102 }
103
104 src_prepare()
105 {
106 munpack ${SRCFILE} || die
107 cd ${SRCDIR}
108
109 # fix a test case that fails when built using gcc-5.x
110 sed -i '/tst-audit2-ENV/i CFLAGS-tst-audit2.c += -fno-builtin' elf/Makefile || die
111
112 # fixes an infinite loop while syscall.d creation
113 # see: http://sourceware.org/bugzilla/show_bug.cgi?id=15711
114 mpatch ${PNAME}-2.17-syscalld-infinite-loop.patch || die
115 # use 1.0 second instead of 0.5 (required by arch i686 builds on 64bit machines)
116 sed -i 's:0.5 seconds ago:1.0 seconds ago:' ${SRCDIR}/Makerules || die
117
118 # scripts/test-installation.pl sometime fails
119 #
120 # CC="gcc" /usr/bin/perl scripts/test-installation.pl
121 # /usr/src/glibc-2.16.0.bld/
122 # Unmatched ( in regex; marked by <-- HERE in m/$( <-- HERE if $(abi-32-ld-soname),$(abi-32-ld-soname),ld/ at scripts/test-installation.pl line 172, <LDD>
123 # line 1
124 sed -i 's:CC="$(CC)" $(PERL) scripts/test-installation.pl $(common-objpfx)::' Makefile || die
125
126 # binutils patch needs reconf
127 # autoconf --force || die
128
129 # fix permissions on some of the scripts
130 chmod u+x ${SRCDIR}/scripts/*.sh || die
131
132 install -d ${SRCDIR}/build || die
133 cd ${SRCDIR}/build
134
135 if [ ! -f /etc/ld.so.conf ]
136 then
137 touch /etc/ld.so.conf || die
138 fi
139 }
140
141 src_compile()
142 {
143 local myopts
144
145 # generic pathes
146 myopts="--prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info"
147 myopts+=" --with-headers=/usr/include"
148 # bugurl
149 myopts+=" --with-bugurl=http://bugs.magellan-linux.de/"
150 # disable profiling
151 myopts+=" --disable-profile"
152 # enable addons
153 myopts+=" --enable-add-ons"
154 # supported kernel-release
155 myopts+=" --enable-kernel=${ENABLE_KERNEL}"
156 # disable cvs and gd support
157 myopts+=" --without-cvs --without-gd"
158 # enable bindnow
159 myopts+=" --enable-bind-now"
160 # # enable obsolete rpc implementation
161 # myopts+=" --enable-obsolete-rpc"
162 # # enable obsolete nsl implementation
163 # myopts+=" --enable-obsolete-nsl"
164 # enable lock elision
165 myopts+=" --enable-lock-elision"
166 # disable -werror
167 myopts+=" --disable-werror"
168 # enable multi-arch
169 myopts+=" --enable-multi-arch"
170 # enable stackguard randomization
171 myopts+=" --enable-stackguard-randomization"
172 # enable stack protector
173 myopts+=" --enable-stack-protector=strong"
174 # enable static pie
175 myopts+=" --enable-static-pie"
176 # enable intel cet + branch tracking (IBT) and shadow stack (SHSTK)
177 myopts+=" --enable-cet"
178
179 # remove fortify for building libraries
180 export CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
181
182 # support multilib lib64 dir (x86_64 only)
183 if [[ ${ARCH} = x86_64 ]]
184 then
185 # first build a -m32 version
186 install -d ${SRCDIR}/build-m32
187 cd ${SRCDIR}/build-m32
188
189 # honor /usr move
190 echo "rootsbindir=/usr/sbin" >> ${SRCDIR}/build-m32/configparms || die
191 # make sure the -m32 libs goes really to /usr/lib
192 echo "slibdir=/usr/lib" >> ${SRCDIR}/build-m32/configparms || die
193 echo "rtlddir=/usr/lib" >> ${SRCDIR}/build-m32/configparms || die
194
195 CC="gcc -m32" CXX="g++ -m32" \
196 CFLAGS="${CFLAGS//-march=${ARCH}} -march=i686" \
197 CXXFLAGS="${CXXFLAGS//-march=${ARCH}} -march=i686" \
198 ../configure \
199 --build=${CHOST} \
200 --host=i686-pc-linux-gnu \
201 --libdir=/usr/lib \
202 --libexecdir=/usr/lib/glibc \
203 ${myopts} \
204 || die
205
206 make PARALLELMFLAGS="${MAKEOPTS}" || die
207 fi
208
209 cd ${SRCDIR}/build
210
211 # honor /usr move
212 echo "rootsbindir=/usr/sbin" >> ${SRCDIR}/build/configparms || die
213 # make sure the -m64 libs goes really to /lib64
214 echo "slibdir=/usr/$(mlibdir)" >> ${SRCDIR}/build/configparms || die
215 echo "rtlddir=/usr/$(mlibdir)" >> ${SRCDIR}/build/configparms || die
216
217 ../configure \
218 --build=${CHOST} \
219 --host=${CHOST} \
220 --libdir=/usr/$(mlibdir) \
221 --libexecdir=/usr/$(mlibdir)/glibc \
222 ${myopts} \
223 || die
224
225 make PARALLELMFLAGS="${MAKEOPTS}" || die
226 }
227
228 src_install_glibc()
229 {
230 if [[ ${ARCH} = x86_64 ]]
231 then
232 # install -m32 libs
233 cd ${SRCDIR}/build-m32
234 make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die
235 fi
236
237 cd ${SRCDIR}/build
238 make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die
239
240 # cleanup
241 # utf-16 is needed by wfica >= 12.1
242 # utf-32 is needed by wfica >= 13.1
243 zapmost ${BINDIR} usr/$(mlibdir)/\*.so \
244 usr/$(mlibdir)/\*.so.\* \
245 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/*.so usr/lib/*.so.*') \
246 usr/sbin/ldconfig \
247 usr/bin/iconv \
248 usr/bin/locale \
249 usr/bin/ldd \
250 usr/bin/getent \
251 usr/$(mlibdir)/gconv/CP1252.so \
252 usr/$(mlibdir)/gconv/IBM850.so \
253 usr/$(mlibdir)/gconv/ISO8859-1.so \
254 usr/$(mlibdir)/gconv/ISO8859-15.so \
255 usr/$(mlibdir)/gconv/UNICODE.so \
256 usr/$(mlibdir)/gconv/UTF-16.so \
257 usr/$(mlibdir)/gconv/UTF-32.so \
258 usr/$(mlibdir)/gconv/gconv-modules \
259 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/CP1252.so') \
260 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/IBM850.so') \
261 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/ISO8859-1.so') \
262 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/ISO8859-15.so') \
263 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/UNICODE.so') \
264 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/UTF-16.so') \
265 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/UTF-32.so') \
266 $([[ ${ARCH} = x86_64 ]] && echo 'usr/lib/gconv/gconv-modules') \
267 || die
268
269 # nsswitch configuration file
270 minstalletc ${SRCDIR}/nss/nsswitch.conf || die
271
272 # base environment
273 minstallenv glibc.envd-${ENVD_REV} 00glibc || die
274 if [[ ${ARCH} = x86_64 ]]
275 then
276 MCONFIG="/etc/env.d/00glibc"
277 maddconfig "LDPATH=\"/$(mlibdir)\"" || die
278 maddconfig "LDPATH=\"/usr/$(mlibdir)\"" || die
279 maddconfig "LDPATH=\"/usr/local/$(mlibdir)\"" || die
280 maddconfig "LDPATH=\"/opt/$(mlibdir)\"" || die
281 fi
282
283 # strip all binaries
284 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep -v "pie executable" | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-unneeded || die
285
286 # strip all libraries
287 # want to be safe here; --strip-unneeded seems to cause pthread problems
288 # strip all but libpthread, libc and ld
289 install -d ${BUILDDIR}/thread-backup/$(mlibdir) || die
290 mv ${BINDIR}/usr/$(mlibdir)/lib{pthread,thread_db,c-}* ${BUILDDIR}/thread-backup/$(mlibdir)/ || die
291 mv ${BINDIR}/usr/$(mlibdir)/ld-* ${BUILDDIR}/thread-backup/$(mlibdir)/ || die
292
293 # now strip
294 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep "[shared object|pie executable]" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-debug || die
295 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-debug || die
296 mv -f ${BUILDDIR}/thread-backup/* ${BINDIR}/usr/$(mlibdir)/ || die
297 # remove stale directory
298 rm -rf ${BUILDDIR}/thread-backup || die
299
300 # prepare glibc for installation; slackware method
301 minstalldir /incoming || die
302 mv ${BINDIR}/usr/$(mlibdir)/*.so ${BINDIR}/incoming || die
303 mv ${BINDIR}/usr/$(mlibdir)/*.so.* ${BINDIR}/incoming || die
304 mv ${BINDIR}/incoming ${BINDIR}/usr/$(mlibdir)/incoming || die
305 mv ${BINDIR}/usr/$(mlibdir)/incoming/libSegFault.so ${BINDIR}/usr/$(mlibdir) || die
306 }
307
308 src_install_glibc-dev()
309 {
310 if [[ ${ARCH} = x86_64 ]]
311 then
312 # install -m32 libs
313 cd ${SRCDIR}/build-m32
314 make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die
315 fi
316
317 cd ${SRCDIR}/build
318 make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} install || die
319
320 # cleanup -> in glibc
321 rm ${BINDIR}/usr/$(mlibdir)/*.so || die
322 rm ${BINDIR}/usr/$(mlibdir)/*.so.* || die
323 rm ${BINDIR}/usr/$(mlibdir)/gconv/CP1252.so || die
324 rm ${BINDIR}/usr/$(mlibdir)/gconv/IBM850.so || die
325 rm ${BINDIR}/usr/$(mlibdir)/gconv/ISO8859-1.so || die
326 rm ${BINDIR}/usr/$(mlibdir)/gconv/ISO8859-15.so || die
327 rm ${BINDIR}/usr/$(mlibdir)/gconv/UNICODE.so || die
328 rm ${BINDIR}/usr/$(mlibdir)/gconv/UTF-16.so || die
329 rm ${BINDIR}/usr/$(mlibdir)/gconv/gconv-modules || die
330 if [[ ${ARCH} = x86_64 ]]
331 then
332 rm ${BINDIR}/usr/lib/*.so || die
333 rm ${BINDIR}/usr/lib/*.so.* || die
334 rm ${BINDIR}/usr/lib/gconv/CP1252.so || die
335 rm ${BINDIR}/usr/lib/gconv/IBM850.so || die
336 rm ${BINDIR}/usr/lib/gconv/ISO8859-1.so || die
337 rm ${BINDIR}/usr/lib/gconv/ISO8859-15.so || die
338 rm ${BINDIR}/usr/lib/gconv/UNICODE.so || die
339 rm ${BINDIR}/usr/lib/gconv/UTF-16.so || die
340 rm ${BINDIR}/usr/lib/gconv/gconv-modules || die
341 fi
342 rm ${BINDIR}/usr/sbin/ldconfig || die
343 rm ${BINDIR}/usr/bin/iconv || die
344 rm ${BINDIR}/usr/bin/locale || die
345 rm ${BINDIR}/usr/bin/ldd || die
346 rm ${BINDIR}/usr/bin/getent || die
347
348 # do not generate the locales here, let it the user do with the locale-gen tool
349 # make PARALLELMFLAGS="${MAKEOPTS}" install_root=${BINDIR} localedata/install-locales || die
350
351 # install locales list and generate tools
352 # generate locale.gen file from localedata/SUPPORTED file
353 minstalletc locale.gen-header locale.gen || die
354 sed \
355 -e 's:/: :g' \
356 -e 's:\\: :g' \
357 -e 's:SUPPORTED-LOCALES=::' \
358 -e 's:\ \ $::g' \
359 -e '/^#/d' \
360 -e 's:^:#:g' \
361 ${SRCDIR}/localedata/SUPPORTED \
362 >> ${BINDIR}/etc/locale.gen || die
363 minstalldir /usr/sbin || die
364 minstallexec -s locale-gen /usr/sbin || die
365
366 # nscd configuration file
367 minstalletc ${SRCDIR}/nscd/nscd.conf || die
368 # systemd services, but do not include systemd.sminc to have a hard depend on systemd
369 minstalldir /usr/lib/systemd/system || die
370 minstallfile ${SRCDIR}/nscd/nscd.service /usr/lib/systemd/system || die
371 minstalldir /etc/tmpfiles.d || die
372 minstallfile ${SRCDIR}/nscd/nscd.tmpfiles /etc/tmpfiles.d/nscd.conf || die
373
374 # gai configuration file
375 minstalletc ${SRCDIR}/posix/gai.conf || die
376
377 # now in tzdata
378 ## we use Berlin as default
379 ## busybox compat
380 #local args
381 #if need_busybox_support /bin/cp
382 #then
383 # args="-f"
384 #else
385 # args="--remove-destination"
386 #fi
387 #cp ${args} ${BINDIR}/usr/share/zoneinfo/Europe/Berlin ${BINDIR}/etc/localtime || die
388 [ -f ${BINDIR}/etc/ld.so.conf ] && { rm -f ${BINDIR}/etc/ld.so.conf || die; }
389 [ -e ${BINDIR}/etc/ld.so.cache ] && { rm -rf ${BINDIR}/etc/ld.so.cache || die; }
390
391 # strip all binaries
392 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep -v "pie executable" | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-unneeded || die
393
394 # now strip but only debuging symbols
395 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep "[shared object|pie executable]" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-debug || die
396 find ${BINDIR} ! -type d | xargs --no-run-if-empty file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip --strip-debug || die
397 }
398
399 src_install_glibc-locale-de()
400 {
401 cd ${SRCDIR}/build
402
403 # create locale-archive
404 minstalldir /usr/$(mlibdir)/locale || die
405 locale/localedef \
406 --prefix=${BINDIR} \
407 --inputfile=../localedata/locales/de_DE \
408 --charmap=../localedata/charmaps/UTF-8 \
409 --alias-file=../intl/locale.alias \
410 --force \
411 de_DE.UTF-8 \
412 || die
413
414 # test locale-archive
415 [[ $(locale/localedef --prefix=${BINDIR} --list-archive) = de_DE.utf8 ]] || die
416 }
417
418 src_install_glibc-locale-us()
419 {
420 cd ${SRCDIR}/build
421
422 # create locale-archive
423 minstalldir /usr/$(mlibdir)/locale || die
424 locale/localedef \
425 --prefix=${BINDIR} \
426 --inputfile=../localedata/locales/en_US \
427 --charmap=../localedata/charmaps/UTF-8 \
428 --alias-file=../intl/locale.alias \
429 --force \
430 en_US.UTF-8 \
431 || die
432
433 # test locale-archive
434 [[ $(locale/localedef --prefix=${BINDIR} --list-archive) = en_US.utf8 ]] || die
435 }
436
437 fix_db_files()
438 {
439 local i
440 local DB_ENTRY="${BUILDDIR}/${PKGNAME}"
441
442 for i in .files .symlinks .dirs
443 do
444 [ ! -f ${DB_ENTRY}/${i} ] && continue
445 [[ -z $(< ${DB_ENTRY}/${i}) ]] && continue
446
447 echo " fixing /usr/$(mlibdir)/incoming from db-entry '${i}' ..."
448
449 # /usr/lib/incoming -> empty line; sed2 removes all empty lines
450 #sed -i -e "s:/$(mlibdir)/incoming.*::g" -e '/^$/d' ${DB_ENTRY}/${i}
451 # do not simply emtpy the line, but change it the the correct path,
452 # so no stale libs are around if the package gets updated!
453 sed -i \
454 -e "s:/usr/$(mlibdir)/incoming:/usr/$(mlibdir):g" \
455 -e "s:/usr/$(mlibdir)/incoming.*::g" \
456 -e '/^$/d' ${DB_ENTRY}/${i}
457 done
458 }
459
460 preinstall_glibc()
461 {
462 add_conf_prot_mask /etc/env.d /etc/nsswitch.conf
463 }
464
465 postinstall_glibc()
466 {
467 # first save the old libpthread.so.0;
468 # it will later used to determinate that there are no stale
469 # libpthreads that breaks ldconfig
470 local OLD_PTHREAD
471 OLD_PTHREAD="$(readlink ${MROOT}/usr/$(mlibdir)/libpthread.so.0)"
472
473 # slackware install method
474
475 # we cannot easily install the glibc libs,
476 # because our tools for cp etc needs them to run
477
478 local file
479
480 echo " Switching to new glibc ..."
481 # swap libraries on the fly:
482 if [ -x /usr/sbin/ldconfig -a -d /usr/$(mlibdir)/incoming ] && [[ -z ${MROOT} ]]
483 then
484 # first create copies of the incoming libraries:
485 cd /usr/$(mlibdir)/incoming
486 for file in $(find /usr/$(mlibdir)/incoming -type f)
487 do
488 if [ ! -r "../$(basename ${file}).incoming" ]
489 then
490 cp -a ${file} ../$(basename ${file}).incoming
491 fi
492 done
493
494 # then switch to them all at once:
495 /usr/sbin/ldconfig -l /usr/$(mlibdir)/*.incoming 2> /dev/null
496
497 # finally, rename them and clean up:
498 cd /usr/$(mlibdir)
499 for file in *.incoming
500 do
501 rm -f $(basename ${file} .incoming)
502 cp -a ${file} $(basename ${file} .incoming)
503 /usr/sbin/ldconfig -l $(basename ${file} .incoming)
504 rm -f ${file}
505 done
506
507 # no ldconfig?
508 # good, it's safe to just jam it on home (and make links below):
509 else
510 (
511 cd ${MROOT}/usr/$(mlibdir)/incoming
512 for file in *
513 do
514 cp -a ${file} ..
515 done
516
517 local my_sym
518 local my_dest
519
520 # rebuild symlinks
521 echo " Recreating Symlinks:"
522 for i in $(find ${MROOT}/usr/$(mlibdir)/incoming -type l)
523 do
524 my_sym="$(readlink ${i})"
525 my_dest="$(basename ${i})"
526
527 echo " ${my_dest} -> ${my_dest}"
528
529 # assure to remove the old ones;
530 [ -L ${MROOT}/usr/$(mlibdir)/"${my_dest}" ] && \
531 rm ${MROOT}/usr/$(mlibdir)/"${my_dest}"
532
533 ln -snf "${my_sym}" ${MROOT}/usr/$(mlibdir)/"${my_dest}"
534 done
535 )
536 fi
537
538 # now, get rid of the temporary directory:
539 rm -rf ${MROOT}/usr/$(mlibdir)/incoming
540
541 # remove stale nptl libpthread-2.?.?.so,
542 # fix only needed for glibc with linuxthreads;
543 # prevent reloc errors such as:
544 # ls: error while loading shared libraries: libpthread.so.0: cannot open shared object file: No such file or directory
545
546 # get our new libpthread.so.0
547 local NEW_PTHREAD
548 NEW_PTHREAD="$(readlink ${MROOT}/usr/$(mlibdir)/libpthread.so.0)"
549
550 if [ "${NEW_PTHREAD}" != "${OLD_PTHREAD}" ]
551 then
552 echo " Removing stale libpthread libraries ..."
553 for file in ${MROOT}/usr/$(mlibdir)/libpthread-*
554 do
555 if [ "$(basename ${file})" != "${NEW_PTHREAD}" ]
556 then
557 rm -f ${file}
558 fi
559 done
560
561 #rm -f /lib/${OLD_PTHREAD}
562
563 ln -snf ${NEW_PTHREAD} ${MROOT}/usr/$(mlibdir)/libpthread.so.0
564 fi
565
566 # now we must fix the mage db files
567 # to stop the annoying errors messages
568 fix_db_files
569 }
570
571 postinstall_glibc-dev()
572 {
573 if [ -x /usr/sbin/iconvconfig ]
574 then
575 # generate fastloading iconv module configuration file.
576 echo " Generate iconv module config ..."
577 /usr/sbin/iconvconfig --prefix=${MROOT}/
578 fi
579
580 # not working with busybox
581 if ! need_busybox_support /sbin/init
582 then
583 # reloading init
584 echo " Reloading init ..."
585 [[ -z ${MROOT} ]] && /sbin/init U &> /dev/null
586 fi
587
588 # generating user def locales
589 echo " Generating user defined locales ..."
590 [[ -z ${MROOT} ]] && /usr/sbin/locale-gen
591 }