userspace
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* musl — the musl C library.
|
||||
*
|
||||
* A library building block, NOT a system switch: glibc remains the
|
||||
* system libc; this package makes musl available in the store (headers,
|
||||
* static libc.a, shared libc.so + ld-musl loader, crt objects).
|
||||
*
|
||||
* CONSUMING MUSL (no musl-gcc wrapper ships in 1.2.6 — it was replaced
|
||||
* by clang-based wrappers, and we ship gcc). Link with gcc directly:
|
||||
*
|
||||
* gcc -nostdinc -isystem $MUSL/usr/include \
|
||||
* -nostdlib -L$MUSL/usr/lib -Wl,-dynamic-linker,$MUSL/lib/ld-musl-x86_64.so.1 \
|
||||
* -static -lcrt1.o -lc -lgcc ...
|
||||
*
|
||||
* or for fully static binaries, the simpler:
|
||||
*
|
||||
* gcc -nostdinc -isystem $MUSL/usr/include -nostdlib -static \
|
||||
* -L$MUSL/usr/lib -lcrt1.o -lc -lgcc -lgcc_eh
|
||||
*
|
||||
* where $MUSL is the store install root. Build requires only a C
|
||||
* compiler and make; no external deps.
|
||||
*/
|
||||
package "musl" {
|
||||
const version = "1.2.6"
|
||||
const source = "https://musl.libc.org/releases/musl-${version}.tar.gz"
|
||||
sha256 = "d585fd3b613c66151fc3249e8ed44f77020cb5e6c1e635a616d3f9f82460512a"
|
||||
license = "MIT"
|
||||
|
||||
provides = ["musl", "libc.a", "ld-musl"]
|
||||
|
||||
depends = [
|
||||
{ name = "make" },
|
||||
]
|
||||
|
||||
prepare {
|
||||
curl -L -O ${source}
|
||||
echo "d585fd3b613c66151fc3249e8ed44f77020cb5e6c1e635a616d3f9f82460512a musl-${version}.tar.gz" | sha256sum -c -
|
||||
tar xf musl-${version}.tar.gz --strip-components=1
|
||||
}
|
||||
|
||||
build {
|
||||
./configure --prefix=${prefix}
|
||||
make -j${jobs}
|
||||
}
|
||||
|
||||
// NOTE: no check phase — musl 1.2.6's Makefile has no check/test target.
|
||||
|
||||
install {
|
||||
make DESTDIR=${destdir} install
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user