diff options
Diffstat (limited to 'devel/gcc-compat/MAKEPKG')
| -rw-r--r-- | devel/gcc-compat/MAKEPKG | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/devel/gcc-compat/MAKEPKG b/devel/gcc-compat/MAKEPKG new file mode 100644 index 0000000..4d0fceb --- /dev/null +++ b/devel/gcc-compat/MAKEPKG @@ -0,0 +1,47 @@ +#!/bin/mkpkg +# description: GCC compatibility shims for pure LLVM/musl systems +name=gcc-compat +version=1.0.0 +release=2 +#depends=(llvm-toolchain) +depends=() +source=() + +sha256sums=( +) + +build() { + mkdir -p $PKG/usr/lib + mkdir -p $PKG/usr/bin + + # libgcc_s → libunwind + ln -s libunwind.so.1 $PKG/usr/lib/libgcc_s.so.1 + printf 'INPUT(-lunwind)\n' > $PKG/usr/lib/libgcc_s.so + + # libgcc.a → compiler-rt builtins + _builtins=$(clang --print-libgcc-file-name 2>/dev/null || true) + if [ -n "$_builtins" ] && [ -f "$_builtins" ]; then + printf 'INPUT(%s)\n' "$_builtins" > $PKG/usr/lib/libgcc.a + else + llvm-ar cr $PKG/usr/lib/libgcc.a + fi + + # libstdc++ → libc++ + printf 'INPUT(-lc++)\n' > $PKG/usr/lib/libstdc++.so + ln -s libc++.so.1 $PKG/usr/lib/libstdc++.so.6 + if [ -f /usr/lib/libc++.a ]; then + printf 'INPUT(-lc++ -lc++abi)\n' > $PKG/usr/lib/libstdc++.a + fi + + # rustc-wrapper — force dynamic linking on musl + printf '#!/bin/sh\nexec /usr/bin/rustc -C target-feature=-crt-static "$@"\n' \ + > $PKG/usr/bin/rustc-wrapper + chmod 755 $PKG/usr/bin/rustc-wrapper +} + +signify() { + untrusted comment: public key + RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 +} + +# vim: filetype=sh |
