pkg-lib32-glibc/PKGBUILD
BigfootACA 7e8d2a45ef
Some checks failed
gitea/pkg-lib32-glibc/pipeline/head There was a failure building this commit
Initial commit
2023-12-15 01:39:58 +08:00

101 lines
3.2 KiB
Bash

# Maintainer: BigfootACA <bigfoot@classfun.cn>
# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc
# NOTE: valgrind requires rebuilt with each major glibc version
pkgbase=glibc
pkgname=(lib32-glibc)
pkgver=2.38
_commit=750a45a783906a19591fb8ff6b7841470f1f5701
pkgrel=7
arch=(aarch64)
url='https://www.gnu.org/software/libc'
license=(GPL LGPL)
makedepends=(git gd armv7l-linux-gnueabihf-gcc armv7l-linux-gnueabihf-linux-api-headers python)
options=(staticlibs !lto)
source=(git+https://gitmirrors.classfun.cn:4443/glibc.git#commit=${_commit}
lib32-glibc.conf
reenable_DT_HASH.patch
)
validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
b2sums=('SKIP'
'7c265e6d36a5c0dff127093580827d15519b6c7205c2e1300e82f0fb5b9dd00b6accb40c56581f18179c4fbbc95bd2bf1b900ace867a83accde0969f7b609f8a'
'35e03ed912e1b0cd23783ab83ce919412885c141344905b8b67bbad4a86c48cf3e893806060e48d5737514ff80cea0b58b0e1f15707c32224579c416dcd810c0')
prepare() {
mkdir -p lib32-glibc-build
[[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc
cd glibc
# Re-enable `--hash-style=both` for building shared objects due to issues with EPIC's EAC
# which relies on DT_HASH to be present in these libs.
# reconsider 2023-01
patch -Np1 -i "${srcdir}"/reenable_DT_HASH.patch
}
build() {
local _configure_flags=(
--prefix=/usr
--with-headers=/usr/armv7l-linux-gnueabihf/include
--with-bugurl=https://bugs.archlinux.org/
--enable-bind-now
--enable-cet
--enable-fortify-source
--enable-kernel=4.4
--enable-stack-protector=strong
--enable-systemtap
--disable-nscd
--disable-profile
--disable-werror
--disable-multi-arch
)
(
cd lib32-glibc-build
export CC="armv7l-linux-gnueabihf-gcc"
export CXX="armv7l-linux-gnueabihf-g++"
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
"${srcdir}"/glibc/configure \
--host=armv7l-linux-gnueabihf \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
make -O
)
}
package_lib32-glibc() {
pkgdesc='GNU C Library (32-bit)'
depends=("glibc")
options+=('!emptydirs')
cd lib32-glibc-build
make DESTDIR="${pkgdir}" install
rm -rf "${pkgdir}"/{etc,sbin,usr/{bin,sbin,share},var}
# We need to keep 32 bit specific header files
find "${pkgdir}"/usr/include -type f -not -name '*-32.h' -delete
# Dynamic linker
install -d "${pkgdir}"/usr/lib
ln -s ../lib32/ld-linux-armhf.so.3 "${pkgdir}"/usr/lib/
# Add lib32 paths to the default library search path
install -Dm644 "${srcdir}"/lib32-glibc.conf "${pkgdir}"/etc/ld.so.conf.d/lib32-glibc.conf
# Symlink /usr/lib32/locale to /usr/lib/locale
ln -s ../lib/locale "${pkgdir}"/usr/lib32/locale
}