tags 837608 patch

Attached patch managed to compile libc++ 3.9.0 with clang-3.9.

I did only minimal testing with it. But test suit for my own library
at least passed when compiled with clang-3.9 and linked to libc++ 3.9.
Of course that test suit uses only small part of standard library but
at least std::map, std::vector, std::string, std::string_view,
exceptions and cxxabi::demangle are required to pass the test suit.

I want to use std:pmr::memory_resource in my project but clang doesn't
compile libstdc++ version of that while packaged libc++ doesn't yet
include polymorphic allocator.
Index: debian/changelog
===================================================================
--- debian/changelog	(revision 2248)
+++ debian/changelog	(working copy)
@@ -1,3 +1,9 @@
+libc++ (3.9.0-1) unstable; urgency=medium
+
+  * New upstream release 3.9.0
+
+ -- Pauli <suok...@gmail.com>  Mon, 31 Oct 2016 12:56:19 +0200
+
 libc++ (3.7.0-1) unstable; urgency=medium
 
   * New upstrem release
Index: debian/libc++-get-orig-source.sh
===================================================================
--- debian/libc++-get-orig-source.sh	(revision 2248)
+++ debian/libc++-get-orig-source.sh	(working copy)
@@ -5,7 +5,7 @@
     exit 1
 fi
 
-if test $# -ne 1 -o test $# -ne 2; then
+if test $# -ne 1 -a $# -ne 2; then
     echo "Version is expected"
     echo "Example: sh debian/libc++-get-orig-source.sh 3.6.2 RELEASE_362/final/"
     exit 1
Index: debian/patches/disable-arm-excep-handling.diff
===================================================================
--- debian/patches/disable-arm-excep-handling.diff	(revision 2248)
+++ debian/patches/disable-arm-excep-handling.diff	(working copy)
@@ -1,10 +1,10 @@
-Index: aze/libcxxabi/include/__cxxabi_config.h
+Index: libcxx-pkg/libcxxabi/include/__cxxabi_config.h
 ===================================================================
---- aze.orig/libcxxabi/include/__cxxabi_config.h
-+++ aze/libcxxabi/include/__cxxabi_config.h
+--- libcxx-pkg.orig/libcxxabi/include/__cxxabi_config.h
++++ libcxx-pkg/libcxxabi/include/__cxxabi_config.h
 @@ -12,7 +12,7 @@
  
- #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) && \
+ #if defined(__arm__) && !defined(__USING_SJLJ_EXCEPTIONS__) &&                 \
      !defined(__ARM_DWARF_EH__)
 -#define LIBCXXABI_ARM_EHABI 1
 +#define LIBCXXABI_ARM_EHABI 0
Index: debian/patches/libcxx-buildit.patch
===================================================================
--- debian/patches/libcxx-buildit.patch	(revision 2248)
+++ debian/patches/libcxx-buildit.patch	(working copy)
@@ -1,23 +1,49 @@
-Index: foo/libcxx/lib/buildit
+Update build for 3.9.0
+
+Index: libcxx-pkg/libcxx/lib/buildit
 ===================================================================
---- foo.orig/libcxx/lib/buildit
-+++ foo/libcxx/lib/buildit
-@@ -123,19 +123,20 @@ case $TRIPLE in
+--- libcxx-pkg.orig/libcxx/lib/buildit
++++ libcxx-pkg/libcxx/lib/buildit
+@@ -14,17 +14,17 @@ fi
+ 
+ if [ -z "$CXX" ]
+ then
+-    CXX=clang++
++    CXX=clang++-3.9
+ fi
+ 
+ if [ -z "$CXX_LANG" ]
+ then
+-    CXX_LANG=c++11
++    CXX_LANG=c++1y
+ fi
+ 
+ if [ -z "$CC" ]
+ then
+-    CC=clang
++    CC=clang-3.9
+ fi
+ 
+ if [ -z "$MACOSX_DEPLOYMENT_TARGET" ]
+@@ -41,7 +41,7 @@ then
+ fi
+ 
+ EXTRA_FLAGS="-nostdinc++ -std=${CXX_LANG} -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion \
+-             -Wstrict-aliasing=2 -Wstrict-overflow=4 "
++             -DLIBCXX_BUILDING_LIBCXXABI -Wstrict-aliasing=2 -Wstrict-overflow=4 "
+ 
+ case $TRIPLE in
+   *-apple-*)
+@@ -123,7 +123,7 @@ case $TRIPLE in
      SOEXT=so
      LDSHARED_FLAGS="-o libc++.so.1.0 \
          -shared -nodefaultlibs -Wl,-soname,libc++.so.1 \
 -        -lpthread -lrt -lc -lstdc++"
 +        -lpthread -lrt -lc -L../../libcxxabi/lib"
-+    EXTRA_FLAGS="$EXTRA_FLAGS -DLIBCXXABI"
      ;;
  esac
  
- if [ -z "$RC_XBS" ]
- then
--    rm -f libc++.1.$SOEXT*
-+    rm -f libc++.a
- fi
- 
+@@ -135,15 +135,21 @@ fi
  set -x
  
  for FILE in ../src/*.cpp; do
@@ -26,7 +52,9 @@
  done
  case $TRIPLE in
    *-*-mingw*)
-@@ -144,8 +145,12 @@ case $TRIPLE in
+   for FILE in ../src/support/win32/*.cpp; do
+-    $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
++    $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include -I../../libcxxabi/include $FILE
    done
    ;;
  esac
@@ -35,8 +63,7 @@
 +done;
 +ar x ../../libcxxabi/lib/libc++abi.a
 +ar rcs libc++.a *.o
++
  $CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
--
+ 
  #libtool -static -o libc++.a *.o
- 
- # Create the link for the final library name, so that we can use this directory
Index: debian/patches/libcxxabi-buildit.patch
===================================================================
--- debian/patches/libcxxabi-buildit.patch	(revision 2248)
+++ debian/patches/libcxxabi-buildit.patch	(working copy)
@@ -1,27 +1,50 @@
-Index: aze/libcxxabi/lib/buildit
+Fix compiling for libc++ 3.9.0
+
+Index: libcxx-pkg/libcxxabi/lib/buildit
 ===================================================================
---- aze.orig/libcxxabi/lib/buildit	2013-12-01 11:05:40.761988022 +0100
-+++ aze/libcxxabi/lib/buildit	2013-12-01 11:07:33.777991638 +0100
-@@ -70,29 +70,31 @@
+--- libcxx-pkg.orig/libcxxabi/lib/buildit
++++ libcxx-pkg/libcxxabi/lib/buildit
+@@ -14,12 +14,12 @@ fi
+ 
+ if [ -z "$CXX" ]
+ then
+-	CXX=clang++
++	CXX=clang++-3.9
+ fi
+ 
+ if [ -z "$CC" ]
+ then
+-    CC=clang
++    CC=clang-3.9
+ fi
+ 
+ if [ -z $RC_ProjectSourceVersion ]
+@@ -27,7 +27,7 @@ then
+   RC_ProjectSourceVersion=1
+ fi
+ 
+-EXTRA_FLAGS="-std=c++11 -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 \
++EXTRA_FLAGS="-std=c++1y -stdlib=libc++ -fstrict-aliasing -Wstrict-aliasing=2 \
+              -Wsign-conversion -Wshadow -Wconversion -Wunused-variable \
+              -Wmissing-field-initializers -Wchar-subscripts -Wmismatched-tags \
+              -Wmissing-braces -Wshorten-64-to-32 -Wsign-compare \
+@@ -70,7 +70,7 @@ case $TRIPLE in
      SOEXT=so
      LDSHARED_FLAGS="-o libc++abi.so.1.0 \
          -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
 -        -lpthread -lrt -lc -lstdc++"
-+        -lpthread -lc "
++        -lpthread -lrt -lc"
      ;;
  esac
  
- if [ -z $RC_XBS ]
- then
-     rm -f libc++abi.1.$SOEXT*
-+    rm -f libc++abi.a
- fi
- 
+@@ -82,17 +82,20 @@ fi
  set -x
  
  for FILE in ../src/*.cpp; do
 -	$CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include $OPTIONS $FILE
-+	$CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include -I../../libcxx/include $OPTIONS $FILE
++	if [ $(basename $FILE) != "cxa_noexception.cpp" ]; then
++		$CXX -c -g -O3 $RC_CFLAGS $EXTRA_FLAGS -I../include -I../../libcxx/include $OPTIONS $FILE
++	fi
  done
  case $TRIPLE in
    *-*-mingw*)
Index: debian/patches/series
===================================================================
--- debian/patches/series	(revision 2248)
+++ debian/patches/series	(working copy)
@@ -1,6 +1,4 @@
 libcxx-buildit.patch
 libcxxabi-buildit.patch
 libcxxabi-testit.patch
-libcxx-testit.patch
 disable-arm-excep-handling.diff
-kfreebsd-support.diff

Reply via email to