Skip to content

Commit

Permalink
Update libc++ to r208080
Browse files Browse the repository at this point in the history
Fix build on FreeBSD 8.4 by using devel/libmissing and new devel/xlocale
Add devel/xlocale which is a striped down version of freebsd's xlocale with just the minimal
requirements for libc++, initially maintained in libc++'s trunk for solaris support
  • Loading branch information
bapt committed May 6, 2014
1 parent 5cd9a22 commit b73bb11
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 9 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4619,6 +4619,7 @@
SUBDIR += xdg-utils
SUBDIR += xfce4-dev-tools
SUBDIR += xfce4-vala
SUBDIR += xlocale
SUBDIR += xmake
SUBDIR += xmltooling
SUBDIR += xorg-macros
Expand Down
27 changes: 21 additions & 6 deletions devel/libc++/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
# Created by: Koop Mast <[email protected]>
# $FreeBSD$

PORTNAME= libc++
PORTNAME?= libc++
DISTNAME= libc++-${PORTVERSION}
PORTVERSION= ${SVN_REV}
CATEGORIES= devel
MASTER_SITES= http://files.etoilebsd.net/libc++/ \
LOCAL/bapt

MAINTAINER= [email protected]
COMMENT= Llvm's C++ standard library with c++11 support
COMMENT?= Llvm's C++ standard library with c++11 support

LIB_DEPENDS= libcxxrt.so:${PORTSDIR}/devel/libcxxrt
USES= tar:xz

.ifndef MASTERDIR
LICENSE_GROUP= MIT UIUC
LICENSE_NAME_UIUC= University of Illinois/NCSA Open Source License
LICENSE_PERMS_UIUC= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

USES= cmake:outsource compiler:c++11-lang tar:xz
LIB_DEPENDS= libcxxrt.so:${PORTSDIR}/devel/libcxxrt

USES+= cmake:outsource compiler:c++11-lang
USE_LDCONFIG= yes
LDFLAGS+= -L${LOCALBASE}/lib

Expand All @@ -30,6 +34,16 @@ CXXRT_INCS= ${LOCALBASE}/include/cxxrt/
CXXRT_LIB= ${LOCALBASE}/lib/libcxxrt.so
.endif

.if ${OPSYS} == FreeBSD && ${OSVERSION} < 900000
LIB_DEPENDS+= libmissing.so:${PORTSDIR}/math/libmissing \
libxlocale.so:${PORTSDIR}/devel/xlocale
EXTRA_PATCHES= ${FILESDIR}/extra-libmissing
CXXFLAGS+= -I${LOCALBASE}/include -D__LONG_LONG_SUPPORTED
LDFLAGS+= -lmissing
EXTRALIB= ${LOCALBASE}/lib/libmissing.so.2 ${LOCALBASE}/lib/libxlocale.so.0
.endif


CMAKE_ARGS= -DLIBCXX_CXX_ABI=libcxxrt -DLIBCXX_LIBCXXRT_INCLUDE_PATHS=${CXXRT_INCS}

.if !defined(SVN_REV)
Expand All @@ -56,10 +70,11 @@ post-install:
${LN} -sf c++/v1 ${STAGEDIR}${PREFIX}/include/c++/v1/tr1
${RM} ${STAGEDIR}${PREFIX}/lib/libc++.so
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/c++/
${ECHO} 'GROUP ( ${PREFIX}/lib/libc++.so.1 ${CXXRT_LIB})' > ${STAGEDIR}${PREFIX}/lib/libc++.so
${ECHO} 'GROUP ( ${PREFIX}/lib/libc++.so.1 ${CXXRT_LIB})' > ${STAGEDIR}${PREFIX}/lib/c++/libstdc++.so
${ECHO} 'GROUP ( ${PREFIX}/lib/libc++.so.1 ${CXXRT_LIB} ${EXTRALIB})' > ${STAGEDIR}${PREFIX}/lib/libc++.so
${ECHO} 'GROUP ( ${PREFIX}/lib/libc++.so.1 ${CXXRT_LIB} ${EXTRALIB})' > ${STAGEDIR}${PREFIX}/lib/c++/libstdc++.so

regression-test: build
cd ${WRKSRC}/test && ${SH} ./testit

.endif
.include <bsd.port.mk>
2 changes: 1 addition & 1 deletion devel/libc++/Makefile.svn_rev
Original file line number Diff line number Diff line change
@@ -1 +1 @@
SVN_REV= 200683
SVN_REV= 208080
4 changes: 2 additions & 2 deletions devel/libc++/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (libc++-200683.tar.xz) = a9771ae4d6151fa9c7ca5a3cb9f00492ddc1f165d38dc6461a8876a5abe4711f
SIZE (libc++-200683.tar.xz) = 863432
SHA256 (libc++-208080.tar.xz) = e764167cef1b73f03f2e736eedb2d45d0d2247590de8c878f8ca0bba6f2a9cfc
SIZE (libc++-208080.tar.xz) = 867788
22 changes: 22 additions & 0 deletions devel/libc++/files/extra-libmissing
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- ./include/cmath.orig 2014-01-06 19:12:50.000000000 +0100
+++ ./include/cmath 2014-05-06 14:14:44.388681947 +0200
@@ -299,6 +299,7 @@

#include <__config>
#include <math.h>
+#include <missing_math.h>
#include <type_traits>

#ifdef _LIBCPP_MSVCRT
--- include/__locale.orig 2014-05-06 15:33:07.907356770 +0200
+++ include/__locale 2014-05-06 15:32:20.702360182 +0200
@@ -24,6 +24,9 @@
#elif _AIX
# include <support/ibm/xlocale.h>
#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)) || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)
+# define __LONG_LONG_SUPPORTED
+# include <stdlib.h>
+# include <limits.h>
# include <xlocale.h>
#endif // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__

13 changes: 13 additions & 0 deletions devel/libc++/files/patch-include__support__solaris__xlocale.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- ./include/support/solaris/xlocale.h.orig 2014-01-16 17:58:45.000000000 +0100
+++ ./include/support/solaris/xlocale.h 2014-05-06 16:11:11.135199398 +0200
@@ -32,8 +32,8 @@

#define LC_GLOBAL_LOCALE ((locale_t)-1)

-size_t __mb_cur_max(locale_t l);
-#define MB_CUR_MAX_L(l) __mb_cur_max(l)
+size_t __mb_cur_max_l(locale_t l);
+#define MB_CUR_MAX_L(l) __mb_cur_max_l(l)

locale_t newlocale(int mask, const char * locale, locale_t base);
void freelocale(locale_t loc);
10 changes: 10 additions & 0 deletions devel/libc++/files/patch-src__string.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- ./src/string.cpp.orig 2014-05-06 16:01:31.219239454 +0200
+++ ./src/string.cpp 2014-05-06 15:59:03.134249779 +0200
@@ -19,6 +19,7 @@
#include "support/win32/support.h"
#endif // _LIBCPP_MSVCRT
#include <stdio.h>
+#include <stdlib.h>

_LIBCPP_BEGIN_NAMESPACE_STD

11 changes: 11 additions & 0 deletions devel/libc++/files/patch-src__support__solaris__xlocale.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ./src/support/solaris/xlocale.c.orig 2014-01-16 17:58:45.000000000 +0100
+++ ./src/support/solaris/xlocale.c 2014-05-06 15:50:38.219287659 +0200
@@ -26,7 +26,7 @@
#include "mbsnrtowcs.inc"
#include "wcsnrtombs.inc"

-size_t __mb_cur_max(locale_t __l) {
+size_t __mb_cur_max_l(locale_t __l) {
FIX_LOCALE(__l);
return (__l->lc_ctype->cmapp->cm_mb_cur_max);
}
2 changes: 2 additions & 0 deletions devel/libc++/pkg-plist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include/c++/v1/__functional_base_03
include/c++/v1/__hash_table
include/c++/v1/__locale
include/c++/v1/__mutex_base
include/c++/v1/__refstring
include/c++/v1/__split_buffer
include/c++/v1/__sso_allocator
include/c++/v1/__std_stream
Expand All @@ -30,6 +31,7 @@ include/c++/v1/c++/v1/__functional_base_03
include/c++/v1/c++/v1/__hash_table
include/c++/v1/c++/v1/__locale
include/c++/v1/c++/v1/__mutex_base
include/c++/v1/c++/v1/__refstring
include/c++/v1/c++/v1/__split_buffer
include/c++/v1/c++/v1/__sso_allocator
include/c++/v1/c++/v1/__std_stream
Expand Down
27 changes: 27 additions & 0 deletions devel/xlocale/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# $FreeBSD$

PORTNAME= xlocale

COMMENT?= Minimal xlocale implementation

LICENSE= BSD2CLAUSE

MASTERDIR= ${.CURDIR}/../libc++

BUILD_WRKSRC= ${WRKSRC}/src/support/solaris
CFLAGS+= -I${WRKSRC}/include/support/solaris

PLIST= ${.CURDIR}/pkg-plist
DESCR= ${.CURDIR}/pkg-descr

do-build:
cd ${BUILD_WRKSRC}; ${CC} ${CFLAGS} -fPIC -c xlocale.c ; \
${CC} ${LDFLAGS} xlocale.o -shared -o libxlocale.so.0 -Wl,-soname=libxlocale.so.0

do-install:
${INSTALL_LIB} ${BUILD_WRKSRC}/libxlocale.so.0 ${STAGEDIR}${PREFIX}/lib
${INSTALL_DATA} ${WRKSRC}/include/support/solaris/xlocale.h ${STAGEDIR}${PREFIX}/include
${LN} -sf libxlocale.so.0 ${STAGEDIR}${PREFIX}/lib/libxlocale.so

.include "${MASTERDIR}/../libc++/Makefile.svn_rev"
.include "${MASTERDIR}/../libc++/Makefile"
4 changes: 4 additions & 0 deletions devel/xlocale/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Minimal xlocale implementation for Solaris. This implements the subset of the
xlocale APIs that libc++ depends on.

WWW: http://libcxx.llvm.org
3 changes: 3 additions & 0 deletions devel/xlocale/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib/libxlocale.so.0
lib/libxlocale.so
include/xlocale.h

0 comments on commit b73bb11

Please sign in to comment.