2022-10-05 01:50:56 +03:00
|
|
|
distributable:
|
2023-05-01 20:14:59 +03:00
|
|
|
url: https://git.musl-libc.org/cgit/musl/snapshot/musl-{{ version }}.tar.gz
|
2022-10-05 01:50:56 +03:00
|
|
|
strip-components: 1
|
|
|
|
|
|
|
|
versions:
|
2023-05-01 20:14:59 +03:00
|
|
|
url: https://git.musl-libc.org/cgit/musl/refs/tags
|
|
|
|
match: /musl-\d+\.\d+\.\d+\.tar\.gz/
|
|
|
|
strip:
|
|
|
|
- /musl-/
|
|
|
|
- /.tar.gz/
|
2022-10-05 01:50:56 +03:00
|
|
|
|
|
|
|
relocatable: true
|
|
|
|
|
2023-05-01 20:14:59 +03:00
|
|
|
platforms: linux
|
|
|
|
|
2022-10-05 01:50:56 +03:00
|
|
|
provides:
|
|
|
|
- bin/ld.musl-clang
|
|
|
|
- bin/musl-clang
|
|
|
|
|
|
|
|
build:
|
|
|
|
script: |
|
|
|
|
./configure --prefix={{ prefix }} --syslibdir={{ prefix }}/lib
|
|
|
|
|
|
|
|
make --jobs {{ hw.concurrency }}
|
|
|
|
make install
|
|
|
|
|
|
|
|
ln -sf libc.so {{prefix}}/lib/ld-musl-{{hw.arch}}.so.1
|
|
|
|
|
|
|
|
# fix script paths; might be a better way
|
|
|
|
#FIXME probably: dynamic linker causes segfaults
|
|
|
|
sed -i.bak \
|
|
|
|
-e 's/-dynamic-linker "\$ldso"//' \
|
|
|
|
-e 's/^sflags=$/sflags="-static"/' \
|
|
|
|
-e 's/^libc=".*/libc="$(dirname $(dirname $(which ld.musl-clang)))"/' \
|
|
|
|
-e 's#^libc_inc=".*#libc_inc="$libc/include"#' \
|
|
|
|
-e 's#^libc_lib=".*#libc_lib="$libc/lib"#' \
|
|
|
|
{{prefix}}/bin/musl-clang \
|
|
|
|
{{prefix}}/bin/ld.musl-clang
|
|
|
|
env:
|
|
|
|
CC: clang
|
|
|
|
|
|
|
|
test:
|
|
|
|
fixture: |
|
|
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
|
|
printf("Hello World!");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
script: |
|
|
|
|
mv $FIXTURE $FIXTURE.c
|
|
|
|
musl-clang $FIXTURE.c
|
|
|
|
test "$(./a.out)" = "Hello World!"
|