aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers')
-rwxr-xr-xwrappers/cross-pkg-config1
-rwxr-xr-xwrappers/emerge-wrapper20
2 files changed, 21 insertions, 0 deletions
diff --git a/wrappers/cross-pkg-config b/wrappers/cross-pkg-config
index f178147..4e4da92 100755
--- a/wrappers/cross-pkg-config
+++ b/wrappers/cross-pkg-config
@@ -112,6 +112,7 @@ var="LIBDIR_${ABI}"
eval libdir=\${${var}}
if [ -z "${libdir}" ] ; then
# Fall back to probing the compiler.
+ ## TODO: CLANG FIX
libdir=$(realpath "$(${CC:-${CHOST}-gcc} ${CFLAGS} ${LDFLAGS} -print-file-name=pkgconfig)/..")
# Chopping the basename isn't exactly correct, but it's good enough for now.
libdir=${libdir##*/}
diff --git a/wrappers/emerge-wrapper b/wrappers/emerge-wrapper
index 87dcb00..79c182e 100755
--- a/wrappers/emerge-wrapper
+++ b/wrappers/emerge-wrapper
@@ -87,6 +87,26 @@ cross_wrap_etc()
-e "s:__CBUILD__:${CBUILD}:g" \
"${confs[@]}"
+ if [[ "${LLVM}" == "yes" ]] ; then
+ cat <<-EOF >>${SYSROOT}/etc/portage/profile/make.defaults
+ AR=llvm-ar
+ AS=llvm-as
+ CC="${CHOST}-clang"
+ CROSS_COMPILE="${CHOST}-"
+ CXX="${CHOST}-clang++"
+ DLLTOOL=llvm-dlltool
+ HOSTCC="${CC:=clang}"
+ HOSTCXX="${CXX:=clang++}"
+ LD=ld.lld
+ LLVM=1
+ NM=llvm-nm
+ OBJCOPY=llvm-objcopy
+ RANLIB=llvm-ranlib
+ READELF=llvm-readelf
+ STRIP=llvm-strip
+ EOF
+ fi
+
return 0
}