blob: 5fe8f7ab46b09ba02805521e0791b4986de75bd8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# Contributor: Alexander 'hatred' Drozdov <adrozdoff@gmail.com>
# Contributor: toha257 <toha257@gmail.com>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Kevin Mihelich <kevin@archlinuxarm.org>
# Maintainer: Tavian Barnes <tavianator@tavianator.com>
_target="arm-linux-gnueabihf"
pkgname=${_target}-glibc
pkgver=2.30
pkgrel=3.2
pkgdesc="GNU C Library (${_target})"
arch=('any')
url="https://www.gnu.org/software/libc/"
license=(GPL LGPL)
depends=("${_target}-linux-api-headers>=5.3.1-2")
makedepends=("${_target}-gcc-stage2" python gperf)
provides=("${_target}-glibc-headers=${pkgver}" "${_target}-eglibc")
conflicts=("${_target}-glibc-headers" "${_target}-eglibc")
replaces=("${_target}-glibc-headers")
options=(!buildflags !strip staticlibs)
_commit=a6aaabd036d735a1b412f441bf6c706832655598
#source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
glibc-${_commit}.patch
sdt.h sdt-config.h
bz20338.patch
file-truncated-while-reading-soname-after-patchelf.patch)
validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
md5sums=('2b1dbdf27b28620752956c061d62f60c'
'SKIP'
'0cdb7529cb9e2965d7ffaa155e1fcf9d'
'91fec3b7e75510ae2ac42533aa2e695e'
'680df504c683640b02ed4a805797c0b2'
'430673eccc78e52c249aa4b0f1786450'
'0820504d2e83ee15f74a656771361872')
prepare() {
mkdir -p glibc-build
[[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc
cd glibc
local i; for i in ${source[@]}; do
case ${i%::*} in
*.patch)
msg2 "Applying ${i}"
patch -p1 -i "$srcdir/${i}"
;;
esac
done
}
build() {
local _configure_flags=(
--prefix=/
--with-headers=/usr/${_target}/include
--enable-add-ons
--enable-bind-now
--enable-lock-elision
--disable-multi-arch
--enable-stack-protector=strong
--enable-stackguard-randomization
--disable-profile
--disable-werror
)
cd glibc-build
echo "slibdir=/lib" >> configparms
echo "rtlddir=/lib" >> configparms
echo "sbindir=/bin" >> configparms
echo "rootsbindir=/bin" >> configparms
# remove fortify for building libraries
CPPFLAGS=${CPPFLAGS/-D_FORTIFY_SOURCE=2/}
#
CFLAGS=${CFLAGS/-fno-plt/}
CXXFLAGS=${CXXFLAGS/-fno-plt/}
LDFLAGS=${LDFLAGS/,-z,now/}
export BUILD_CC=gcc
export CC=${_target}-gcc
export CXX=${_target}-g++
export AR=${_target}-ar
export RANLIB=${_target}-ranlib
"$srcdir/glibc-$pkgver/configure" \
--libdir=/lib \
--libexecdir=/lib \
${_configure_flags[@]} \
--target=${_target} \
--host=${_target} \
--build=${CHOST}
echo "build-programs=no" >> configparms
make
}
package() {
cd glibc-build
make install_root="$pkgdir/usr/$_target" install
mkdir -p "$pkgdir/usr/$_target/usr"
ln -s ../{include,lib} "$pkgdir/usr/$_target/usr"
# Remove unneeded for compilation files
rm -rf "$pkgdir/usr/$_target/"{bin,sbin,etc,share,var}
# 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/$_target/include/sys/sdt.h"
install -Dm644 "$srcdir/sdt-config.h" "$pkgdir/usr/$_target/include/sys/sdt-config.h"
}
|