update glibc

This commit is contained in:
joborun linux 2023-10-02 11:20:53 +03:00
parent 94c31e05f2
commit 632b3a115a
3 changed files with 159 additions and 119 deletions

View file

@ -9,14 +9,12 @@
# NOTE: valgrind requires rebuilt with each major glibc version
pkgbase=glibc
pkgname=(glibc lib32-glibc)
pkgname=(glibc lib32-glibc glibc-locales)
pkgver=2.38
_commit=f6445dc94da185b3d1ee283f0ca0a34c4e1986cc
pkgrel=05
pkgrel=06
url='https://www.gnu.org/software/libc'
makedepends=(git gd lib32-gcc-libs python)
#optdepends=('perl: for mtrace')
#options=(debug staticlibs !lto)
options=(staticlibs !lto)
source=(git+https://sourceware.org/git/glibc.git#commit=${_commit}
locale.gen.txt
@ -35,7 +33,6 @@ prepare() {
# which relies on DT_HASH to be present in these libs.
# reconsider 2023-01
patch -Np1 -i "${srcdir}"/reenable_DT_HASH.patch
}
build() {
@ -48,66 +45,79 @@ build() {
--enable-fortify-source
--enable-kernel=4.4
--enable-multi-arch
--disable-nscd
--enable-stack-protector=strong
--enable-systemtap
--disable-nscd
--disable-profile
--disable-werror
)
cd "$srcdir/glibc-build"
(
cd glibc-build
echo "slibdir=/usr/lib" >> configparms
echo "rtlddir=/usr/lib" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
echo "slibdir=/usr/lib" >> configparms
echo "rtlddir=/usr/lib" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
# remove fortify for building libraries
# CFLAGS=${CFLAGS/-Wp,-D_FORTIFY_SOURCE=2/}
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
# remove fortify for building libraries
# CFLAGS=${CFLAGS/-Wp,-D_FORTIFY_SOURCE=2/}
"$srcdir/glibc/configure" \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
"${_configure_flags[@]}"
"${srcdir}"/glibc/configure \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
"${_configure_flags[@]}"
make -O
make -O
# build info pages manually for reproducibility
make info
# build info pages manually for reproducibility
make info
)
cd "$srcdir/lib32-glibc-build"
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
(
cd lib32-glibc-build
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
"$srcdir/glibc/configure" \
--host=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
"${srcdir}"/glibc/configure \
--host=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
make -O
make -O
)
# pregenerate C.UTF-8 locale until it is built into glibc
# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8, FS#74864)-
elf/ld.so --library-path "$PWD" locale/localedef -c -f ../glibc/localedata/charmaps/UTF-8 -i ../glibc/localedata/locales/C ../C.UTF-8/
# pregenerate locales here instead of in package
# functions because localedef does not like fakeroot
make -C "${srcdir}"/glibc/localedata objdir="${srcdir}"/glibc-build \
DESTDIR="${srcdir}"/locales install-locale-files
}
# Credits for skip_test() and check() @allanmcrae
# Credits for _skip_test() and check() @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
#skip_test() {
# test=${1}
# file=${2}
# sed -i "/\b${test} /d" "${srcdir}"/glibc/${file}
#}
_skip_test() {
test=${1}
file=${2}
sed -i "/\b${test} /d" "${srcdir}"/glibc/${file}
}
# 238-6
#
# 11 FAIL
# 5036 PASS
# 195 UNSUPPORTED
# 12 XFAIL
# 8 XPASS
#
#check() {
#check() (
# cd glibc-build
#
# # adjust/remove buildflags that cause false-positive testsuite failures
@ -120,19 +130,16 @@ build() {
# # The following tests fail due to restrictions in the Arch build system
# # The correct fix is to add the following to the systemd-nspawn call:
# # --system-call-filter="@clock @memlock @pkey"
# skip_test test-errno-linux sysdeps/unix/sysv/linux/Makefile
# skip_test tst-mlock2 sysdeps/unix/sysv/linux/Makefile
# skip_test tst-ntp_gettime sysdeps/unix/sysv/linux/Makefile
# skip_test tst-ntp_gettimex sysdeps/unix/sysv/linux/Makefile
# skip_test tst-pkey sysdeps/unix/sysv/linux/Makefile
### skip_test tst-ttyname sysdeps/unix/sysv/linux/Makefile
# skip_test tst-process_mrelease sysdeps/unix/sysv/linux/Makefile
# skip_test tst-adjtime time/Makefile
### skip_test tst-clock2 time/Makefile
# _skip_test test-errno-linux sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-mlock2 sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-ntp_gettime sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-ntp_gettimex sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-pkey sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-process_mrelease sysdeps/unix/sysv/linux/Makefile
# _skip_test tst-adjtime time/Makefile
#
# make -O check
#}
#
#)
package_glibc() {
pkgdesc='GNU C Library w/o systemd'
@ -143,7 +150,7 @@ package_glibc() {
backup=(etc/gai.conf
etc/locale.gen)
make -C glibc-build install_root="$pkgdir" install
make -C glibc-build DESTDIR="$pkgdir" install
rm -f "$pkgdir"/etc/ld.so.cache
# Shipped in tzdata
@ -160,21 +167,24 @@ package_glibc() {
# Create /etc/locale.gen
install -m644 "$srcdir/locale.gen.txt" "$pkgdir/etc/locale.gen"
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
"$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
localedata/SUPPORTED >> "$pkgdir/etc/locale.gen"
# Add SUPPORTED file to pkg
sed -e '1,3d' -e 's|/| |g' -e 's| \\||g' \
"${srcdir}"/glibc/localedata/SUPPORTED > "${pkgdir}"/usr/share/i18n/SUPPORTED
localedata/SUPPORTED > "${pkgdir}"/usr/share/i18n/SUPPORTED
# install C.UTF-8 so that it is always available
install -dm755 "$pkgdir/usr/lib/locale"
cp -r "$srcdir/C.UTF-8" -t "$pkgdir/usr/lib/locale"
sed -i '/#C\.UTF-8 /d' "$pkgdir/etc/locale.gen"
# should be built into glibc eventually
# https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
# https://bugs.archlinux.org/task/74864
install -dm755 "${pkgdir}"/usr/lib/locale
cp -r "${srcdir}"/locales/usr/lib/locale/C.utf8 -t "${pkgdir}"/usr/lib/locale
sed -i '/#C\.UTF-8 /d' "${pkgdir}"/etc/locale.gen
# Provide tracing probes to libstdc++ for exceptions, possibly for other
# libraries too. Useful for gdb's catch command.
install -Dm644 "$srcdir/sdt.h" "$pkgdir/usr/include/sys/sdt.h"
install -Dm644 "$srcdir/sdt-config.h" "$pkgdir/usr/include/sys/sdt-config.h"
install -Dm644 "${srcdir}"/sdt.h "${pkgdir}"/usr/include/sys/sdt.h
install -Dm644 "${srcdir}"/sdt-config.h "${pkgdir}"/usr/include/sys/sdt-config.h
}
package_lib32-glibc() {
@ -184,7 +194,7 @@ package_lib32-glibc() {
cd lib32-glibc-build
make install_root="$pkgdir" install
make DESTDIR="$pkgdir" install
rm -rf "$pkgdir"/{etc,sbin,usr/{bin,sbin,share},var}
# We need to keep 32 bit specific header files
@ -201,6 +211,17 @@ package_lib32-glibc() {
ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
}
package_glibc-locales() {
pkgdesc='Pregenerated locales for GNU C Library'
depends=("glibc=$pkgver")
cp -r locales/* -t "${pkgdir}"
rm -r "${pkgdir}"/usr/lib/locale/C.utf8
# deduplicate locale data
hardlink -c "${pkgdir}"/usr/lib/locale
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
@ -218,6 +239,6 @@ sha256sums=(SKIP
cdc234959c6fdb43f000d3bb7d1080b0103f4080f5e67bcfe8ae1aaf477812f0 # sdt-config.h
cf9fe494f7ec69752a63d1b0a9ad689aa620888ae9b902b6383a6fbc7c1726a7) # reenable_DT_HASH.patch
## 48bacaa2f581a7a12b9edc06df56148331c929a10da245d7243c95c5149b3aac glibc-2.38-05-x86_64.pkg.tar.lz
## f80790a0067d89209b2337f7b0e7c336f5a848d3355818cc795bf20e2df61fad lib32-glibc-2.38-05-x86_64.pkg.tar.lz
## 2b0f9aa9fb80a47f1daa930aa29faec8ebcfb682fe808b4dbfd9866849efe6fb glibc-2.38-06-x86_64.pkg.tar.lz
## 7a2abdeab9417f98452a2adce0e8307c7c2866a811c55ba44de9fe66a0790fd7 glibc-locales-2.38-06-x86_64.pkg.tar.lz
## e8aaaf321f32ad89f23c6a712e762253eab1060b6f18e3cdf87bc8ca4d15febf lib32-glibc-2.38-06-x86_64.pkg.tar.lz

View file

@ -7,10 +7,10 @@
# NOTE: valgrind requires rebuilt with each major glibc version
pkgbase=glibc
pkgname=(glibc lib32-glibc)
pkgname=(glibc lib32-glibc glibc-locales)
pkgver=2.38
_commit=f6445dc94da185b3d1ee283f0ca0a34c4e1986cc
pkgrel=5
pkgrel=6
arch=(x86_64)
url='https://www.gnu.org/software/libc'
license=(GPL LGPL)
@ -62,59 +62,64 @@ build() {
--disable-werror
)
cd "${srcdir}"/glibc-build
(
cd glibc-build
echo "slibdir=/usr/lib" >> configparms
echo "rtlddir=/usr/lib" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
echo "slibdir=/usr/lib" >> configparms
echo "rtlddir=/usr/lib" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
# remove fortify for building libraries
# CFLAGS=${CFLAGS/-Wp,-D_FORTIFY_SOURCE=2/}
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
# remove fortify for building libraries
# CFLAGS=${CFLAGS/-Wp,-D_FORTIFY_SOURCE=2/}
"${srcdir}"/glibc/configure \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
"${_configure_flags[@]}"
"${srcdir}"/glibc/configure \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
"${_configure_flags[@]}"
make -O
make -O
# build info pages manually for reproducibility
make info
# build info pages manually for reproducibility
make info
)
cd "${srcdir}"/lib32-glibc-build
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
(
cd lib32-glibc-build
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
"${srcdir}"/glibc/configure \
--host=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
"${srcdir}"/glibc/configure \
--host=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
make -O
make -O
)
# pregenerate C.UTF-8 locale until it is built into glibc
# (https://sourceware.org/glibc/wiki/Proposals/C.UTF-8, FS#74864)-
elf/ld.so --library-path "$PWD" locale/localedef -c -f ../glibc/localedata/charmaps/UTF-8 -i ../glibc/localedata/locales/C ../C.UTF-8/
# pregenerate locales here instead of in package
# functions because localedef does not like fakeroot
make -C "${srcdir}"/glibc/localedata objdir="${srcdir}"/glibc-build \
DESTDIR="${srcdir}"/locales install-locale-files
}
# Credits for skip_test() and check() @allanmcrae
# Credits for _skip_test() and check() @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
skip_test() {
_skip_test() {
test=${1}
file=${2}
sed -i "/\b${test} /d" "${srcdir}"/glibc/${file}
}
check() {
check() (
cd glibc-build
# adjust/remove buildflags that cause false-positive testsuite failures
@ -127,16 +132,16 @@ check() {
# The following tests fail due to restrictions in the Arch build system
# The correct fix is to add the following to the systemd-nspawn call:
# --system-call-filter="@clock @memlock @pkey"
skip_test test-errno-linux sysdeps/unix/sysv/linux/Makefile
skip_test tst-mlock2 sysdeps/unix/sysv/linux/Makefile
skip_test tst-ntp_gettime sysdeps/unix/sysv/linux/Makefile
skip_test tst-ntp_gettimex sysdeps/unix/sysv/linux/Makefile
skip_test tst-pkey sysdeps/unix/sysv/linux/Makefile
skip_test tst-process_mrelease sysdeps/unix/sysv/linux/Makefile
skip_test tst-adjtime time/Makefile
_skip_test test-errno-linux sysdeps/unix/sysv/linux/Makefile
_skip_test tst-mlock2 sysdeps/unix/sysv/linux/Makefile
_skip_test tst-ntp_gettime sysdeps/unix/sysv/linux/Makefile
_skip_test tst-ntp_gettimex sysdeps/unix/sysv/linux/Makefile
_skip_test tst-pkey sysdeps/unix/sysv/linux/Makefile
_skip_test tst-process_mrelease sysdeps/unix/sysv/linux/Makefile
_skip_test tst-adjtime time/Makefile
make -O check
}
)
package_glibc() {
pkgdesc='GNU C Library'
@ -147,7 +152,7 @@ package_glibc() {
backup=(etc/gai.conf
etc/locale.gen)
make -C glibc-build install_root="${pkgdir}" install
make -C glibc-build DESTDIR="${pkgdir}" install
rm -f "${pkgdir}"/etc/ld.so.cache
# Shipped in tzdata
@ -164,15 +169,18 @@ package_glibc() {
# Create /etc/locale.gen
install -m644 "${srcdir}"/locale.gen.txt "${pkgdir}"/etc/locale.gen
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
"${srcdir}"/glibc/localedata/SUPPORTED >> "${pkgdir}"/etc/locale.gen
localedata/SUPPORTED >> "${pkgdir}"/etc/locale.gen
# Add SUPPORTED file to pkg
sed -e '1,3d' -e 's|/| |g' -e 's| \\||g' \
"${srcdir}"/glibc/localedata/SUPPORTED > "${pkgdir}"/usr/share/i18n/SUPPORTED
localedata/SUPPORTED > "${pkgdir}"/usr/share/i18n/SUPPORTED
# install C.UTF-8 so that it is always available
# should be built into glibc eventually
# https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
# https://bugs.archlinux.org/task/74864
install -dm755 "${pkgdir}"/usr/lib/locale
cp -r "${srcdir}"/C.UTF-8 -t "${pkgdir}"/usr/lib/locale
cp -r "${srcdir}"/locales/usr/lib/locale/C.utf8 -t "${pkgdir}"/usr/lib/locale
sed -i '/#C\.UTF-8 /d' "${pkgdir}"/etc/locale.gen
# Provide tracing probes to libstdc++ for exceptions, possibly for other
@ -188,7 +196,7 @@ package_lib32-glibc() {
cd lib32-glibc-build
make install_root="${pkgdir}" install
make DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}"/{etc,sbin,usr/{bin,sbin,share},var}
# We need to keep 32 bit specific header files
@ -204,3 +212,14 @@ package_lib32-glibc() {
# Symlink /usr/lib32/locale to /usr/lib/locale
ln -s ../lib/locale "${pkgdir}"/usr/lib32/locale
}
package_glibc-locales() {
pkgdesc='Pregenerated locales for GNU C Library'
depends=("glibc=$pkgver")
cp -r locales/* -t "${pkgdir}"
rm -r "${pkgdir}"/usr/lib/locale/C.utf8
# deduplicate locale data
hardlink -c "${pkgdir}"/usr/lib/locale
}

View file

@ -5,6 +5,6 @@ python
bison
libjpeg-turbo
libgit2
graphite