fix(musl)

closes #5421
This commit is contained in:
Jacob Heider 2024-03-07 18:18:27 -05:00 committed by Jacob Heider
parent 532a55ff6e
commit c95101b4b2

View file

@ -17,25 +17,30 @@ provides:
- bin/ld.musl-clang - bin/ld.musl-clang
- bin/musl-clang - bin/musl-clang
dependencies:
llvm.org: '*' # needs clang
build: build:
script: | script:
./configure --prefix={{ prefix }} --syslibdir={{ prefix }}/lib - ./configure --prefix={{ prefix }} --syslibdir={{ prefix }}/lib
make --jobs {{ hw.concurrency }} - make --jobs {{ hw.concurrency }}
make install - make install
ln -sf libc.so {{prefix}}/lib/ld-musl-{{hw.arch}}.so.1 - run: ln -sf libc.so ld-musl-{{hw.arch}}.so.1
working-directory: '{{prefix}}/lib'
# fix script paths; might be a better way # fix script paths; might be a better way
#FIXME probably: dynamic linker causes segfaults #FIXME probably: dynamic linker causes segfaults
sed -i.bak \ - run: sed -i
-e 's/-dynamic-linker "\$ldso"//' \ -e 's/-dynamic-linker "\$ldso"//'
-e 's/^sflags=$/sflags="-static"/' \ -e 's/^sflags=$/sflags="-static"/'
-e 's/^libc=".*/libc="$(dirname $(dirname $(which ld.musl-clang)))"/' \ -e 's/^libc=".*/libc="$(dirname $(dirname $(command -v ld.musl-clang)))"/'
-e 's#^libc_inc=".*#libc_inc="$libc/include"#' \ -e 's#^libc_inc=".*#libc_inc="$libc/include"#'
-e 's#^libc_lib=".*#libc_lib="$libc/lib"#' \ -e 's#^libc_lib=".*#libc_lib="$libc/lib"#'
{{prefix}}/bin/musl-clang \ -e 's/print-prog-name=ld/print-prog-name=ld.lld/'
{{prefix}}/bin/ld.musl-clang musl-clang ld.musl-clang
working-directory: '{{prefix}}/bin'
env: env:
CC: clang CC: clang