summaryrefslogtreecommitdiff
path: root/libcxxabi/lib
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-01-24 23:42:30 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-01-24 23:42:30 +0000
commitabc770690a70c49c947e684bcfa10cce3ac24522 (patch)
tree50bce111e7a1ea85773221e936a99e81d9ed3b90 /libcxxabi/lib
parent1b8e437ab63e1487dfef32e9dbd1b3b10496c80f (diff)
downloadllvm-abc770690a70c49c947e684bcfa10cce3ac24522.tar.gz
By changing all of the throw() specs to noexcept I've been able to compile and link all of the source files into a dylib. Prior to this substitution the changed functions were calling __cxa_call_unexpected which isn't implemented yet. However in none of these cases do we actaully want __cxa_call_unexpected to be called. Primative buildit script added.
llvm-svn: 148880
Diffstat (limited to 'libcxxabi/lib')
-rwxr-xr-xlibcxxabi/lib/buildit90
1 files changed, 90 insertions, 0 deletions
diff --git a/libcxxabi/lib/buildit b/libcxxabi/lib/buildit
new file mode 100755
index 000000000000..e2dac39beea2
--- /dev/null
+++ b/libcxxabi/lib/buildit
@@ -0,0 +1,90 @@
+#! /bin/sh
+#
+# Set the $TRIPLE environment variable to your system's triple before
+# running this script. If you set $CXX, that will be used to compile
+# the library. Otherwise we'll use clang++.
+
+set -e
+
+if [ `basename $(pwd)` != "lib" ]
+then
+ echo "current directory must be lib"
+ exit 1
+fi
+
+if [ -z "$CXX" ]
+then
+ CXX=clang++
+fi
+
+if [ -z "$CC" ]
+then
+ CC=clang
+fi
+
+if [ -z $RC_ProjectSourceVersion ]
+then
+ RC_ProjectSourceVersion=1
+fi
+
+EXTRA_FLAGS="-std=c++0x -stdlib=libc++"
+
+case $TRIPLE in
+ *-apple-*)
+ if [ -z $RC_XBS ]
+ then
+ RC_CFLAGS="-arch i386 -arch x86_64"
+ fi
+ SOEXT=dylib
+ if [ -n "$SDKROOT" ]
+ then
+ EXTRA_FLAGS+="-isysroot ${SDKROOT}"
+ CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
+ CC=`xcrun -sdk "${SDKROOT}" -find clang`
+ fi
+ LDSHARED_FLAGS="-o libc++abi.dylib \
+ -dynamiclib -nodefaultlibs \
+ -current_version ${RC_ProjectSourceVersion} \
+ -compatibility_version 1 \
+ -install_name /usr/lib/libc++abi.dylib \
+ -lSystem"
+ ;;
+ *-*-mingw*)
+ # FIXME: removing libgcc and libsupc++ dependencies means porting libcxxrt and LLVM/compiler-rt
+ SOEXT=dll
+ LDSHARED_FLAGS="-o libc++abi.dll \
+ -shared -nodefaultlibs -Wl,--export-all-symbols -Wl,--allow-multiple-definition -Wl,--out-implib,libc++abi.dll.a \
+ -lsupc++ -lpthread -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcr100 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt"
+ ;;
+ *)
+ RC_CFLAGS="-fPIC"
+ SOEXT=so
+ LDSHARED_FLAGS="-o libc++abi.so.1.0 \
+ -shared -nodefaultlibs -Wl,-soname,libc++abi.so.1 \
+ -lpthread -lrt -lc -lstdc++"
+ ;;
+esac
+
+if [ -z $RC_XBS ]
+then
+ rm -f libc++abi.1.$SOEXT*
+fi
+
+set -x
+
+for FILE in ../src/*.cpp; do
+ $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
+done
+case $TRIPLE in
+ *-*-mingw*)
+ for FILE in ../src/support/win32/*.cpp; do
+ $CXX -c -g -Os $RC_CFLAGS $EXTRA_FLAGS -I../include $FILE
+ done
+ ;;
+esac
+$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
+
+if [ -z $RC_XBS ]
+then
+ rm *.o
+fi