forked from sgerrand/docker-glibc-builder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
builder
executable file
·32 lines (25 loc) · 855 Bytes
/
builder
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
#!/usr/bin/env bash
set -eo pipefail; [[ "$TRACE" ]] && set -x
main() {
declare version="${1:-$GLIBC_VERSION}" prefix="${2:-$PREFIX_DIR}" arch="${3:-$ARCH}"
: "${version:?}" "${prefix:?}"
{
wget -qO- "https://ftpmirror.gnu.org/libc/glibc-$version.tar.gz" \
| tar zxf -
git apply /patches/*.diff
mkdir -p /glibc-build && cd /glibc-build
"/glibc-$version/configure" \
--prefix="$prefix" \
--libdir="$prefix/lib" \
--libexecdir="$prefix/lib" \
--host=${arch} \
--enable-multi-arch \
--enable-stack-protector=strong \
--disable-werror # GCC 9.X Fix - https://github.com/cirosantilli/linux-kernel-module-cheat/issues/97
ls -l
make && make install
tar --dereference --hard-dereference -zcf "/glibc-bin-$version-$arch.tar.gz" "$prefix"
} >&2
[[ $STDOUT ]] && cat "/glibc-bin-$version-$arch.tar.gz"
}
main "$@"