/
build_tarballs.jl
54 lines (42 loc) · 1.79 KB
/
build_tarballs.jl
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
using BinaryBuilder
name = "Glibc"
version = v"2.29"
# sources to build, such as glibc, linux kernel headers, our patches, etc....
sources = [
ArchiveSource("https://mirrors.kernel.org/gnu/glibc/glibc-$(version.major).$(version.minor).tar.xz",
"f3eeb8d57e25ca9fc13c2af3dae97754f9f643bc69229546828e3a240e2af04b"),
DirectorySource("./bundled"),
]
# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/glibc-*/
# patch for avoiding linking in musl libs for a glibc-linked binary
atomic_patch -p1 $WORKSPACE/srcdir/patches/glibc_musl_rejection.patch
# Patch to fix u_char_t definition problems
atomic_patch -p1 $WORKSPACE/srcdir/patches/glibc_sunrpc_uchar.patch
mkdir -p $WORKSPACE/srcdir/glibc_build
cd $WORKSPACE/srcdir/glibc_build
$WORKSPACE/srcdir/glibc-*/configure --prefix=/usr \
--host=${target} \
--disable-multilib \
--disable-werror
make -j${nproc}
# Install to the main prefix and also to the sysroot.
make install install_root=${prefix}
"""
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = [p for p in supported_platforms() if libc(p) == :glibc]
# The products that we will ensure are always built
products = [
LibraryProduct("libc", :libc; dont_dlopen=true),
LibraryProduct("libdl", :libld; dont_dlopen=true),
LibraryProduct("libm", :libm; dont_dlopen=true),
LibraryProduct("libpthread", :libpthread; dont_dlopen=true),
LibraryProduct("librt", :librt; dont_dlopen=true),
]
# Dependencies that must be installed before this package can be built
dependencies = [
]
# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; skip_audit=true, preferred_gcc_version=v"8")