libcxx: fix xlocale.h forglibc 2.26 and use clang as CC.

This commit is contained in:
Leah Neukirchen 2017-08-16 18:09:01 +02:00
parent bcfbba40f4
commit c7b50cf301
2 changed files with 41 additions and 5 deletions

View file

@ -0,0 +1,23 @@
From 6e02e89f65ca1ca1d6ce30fbc557563164dd327e Mon Sep 17 00:00:00 2001
From: Eric Fiselier <eric@efcs.ca>
Date: Thu, 3 Aug 2017 04:28:10 +0000
Subject: [PATCH] Fix libcxx build with glibc 2.26+ by removing xlocale.h
include.
Patch by Khem Raj. Reviewed as D35697. Also see PR33729.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309920 91177308-0d34-0410-b5e6-96231b3b80d8
---
--- include/__locale
+++ include/__locale
@@ -34,7 +34,7 @@
# include <support/solaris/xlocale.h>
#elif defined(_NEWLIB_VERSION)
# include <support/newlib/xlocale.h>
-#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \
+#elif (defined(__APPLE__) || defined(__FreeBSD__) \
|| defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
# include <xlocale.h>
#elif defined(__Fuchsia__)

View file

@ -1,20 +1,21 @@
# Template file for 'libcxx'
pkgname=libcxx
version=4.0.1
revision=1
revision=2
build_style=cmake
hostmakedepends="python"
hostmakedepends="clang llvm python"
makedepends="libcxxabi-devel llvm llvm-libunwind-devel"
case "$XBPS_TARGET_MACHINE" in
arm*)
# libcxxabi doesn't build on arm.
_broken="libcxxabi doesn't build on arm."
;;
*)
configure_args+="
-DLIBCXX_CXX_ABI=libcxxabi
-DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON
-DLIBCXX_CXX_ABI_LIBRARY_PATH=/usr/lib
-DLIBCXX_CXX_ABI_LIBRARY_PATH=${XBPS_CROSS_BASE}/usr/lib
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
"
makedepends="llvm llvm-libunwind-devel libcxxabi-devel"
LDFLAGS="-Wl,--no-as-needed -lunwind -Wl,--as-needed"
esac
case "$XBPS_TARGET_MACHINE" in
@ -36,6 +37,18 @@ post_extract() {
sed -i 's/!defined(_GCC_MAX_ALIGN_T)/& \&\& !defined(__DEFINED_max_align_t)/' include/stddef.h
esac
}
pre_configure() {
export CC="clang"
export CXX="clang++"
if [ "$CROSS_BUILD" ]; then
for _gccdir in /usr/lib/gcc/$XBPS_CROSS_TRIPLET/*.*.*; do
CFLAGS+=" --target=$XBPS_CROSS_TRIPLET --sysroot=/usr/$XBPS_CROSS_TRIPLET -B$_gccdir"
CXXFLAGS+=" --target=$XBPS_CROSS_TRIPLET --sysroot=/usr/$XBPS_CROSS_TRIPLET -B$_gccdir"
LDFLAGS+=" -L$_gccdir"
done
fi
}
libcxx-devel_package() {
short_desc+=" - development files"
depends="${sourcepkg}>=${version}_${revision}"