main/compiler-rt: Fix compiler-rt install location

Alpine currently installs compiler-rt into the following location.
  [DESTDIR]/lib/clang/[CLANG_VERSION]

However, Clang expects compiler-rt to be located at a specific location.
  [DESTDIR]/lib/clang/[CLANG_VERSION]/lib/[OS]

This results in clang on Alpine not being able to use compiler-rt.
  clang -rtlib=compiler-rt hello.c
  /usr/bin/ld: cannot find crtbeginS.o: No such file or directory
  /usr/bin/ld: cannot find /usr/lib/clang/9.0.0/lib/linux/libclang_rt.builtins-x86_64.a: No such file or directory
  /usr/bin/ld: cannot find /usr/lib/clang/9.0.0/lib/linux/libclang_rt.builtins-x86_64.a: No such file or directory
  /usr/bin/ld: cannot find crtendS.o: No such file or directory

This change corrects the install location and allows clang to use
compiler-rt as a runtime library via -rtlib=compiler-rt.
This commit is contained in:
Eric Molitor 2020-02-16 12:19:32 +00:00 committed by Leo
parent c58cd4138f
commit 8b44ad2619

View File

@ -1,9 +1,10 @@
# Contributor Eric Molitor <eric@molitor.org>
# Contributor Travis Tilley <ttilley@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=compiler-rt
# Note: Update together with llvm.
pkgver=9.0.1
pkgrel=0
pkgrel=1
_llvmver=${pkgver%%.*}
pkgdesc="LLVM compiler-rt runtime libraries"
arch="aarch64 armv7 x86 x86_64"
@ -64,10 +65,10 @@ package() {
cd "$pkgdir"
mkdir -p usr/lib/clang
mkdir -p usr/lib/clang/$pkgver/lib
case "$CARCH" in
ppc64le | s390x) ;;
*) mv usr/lib/linux usr/lib/clang/$pkgver;;
*) mv usr/lib/linux usr/lib/clang/$pkgver/lib;;
esac
}