summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorK Puneetha <k.puneetha@samsung.com>2017-04-27 10:17:25 +0100
committerK Puneetha <k.puneetha@samsung.com>2017-04-27 12:29:37 +0100
commitcd52c21ea66d12736943c14302c7b05674ff35c1 (patch)
tree89ef7a768c3529abfab64cfaf45826967319fdb0
parentefded49928704773da6faefa7906e543e5ab2ba1 (diff)
downloadlibllvm-cd52c21ea66d12736943c14302c7b05674ff35c1.tar.gz
libllvm-cd52c21ea66d12736943c14302c7b05674ff35c1.tar.bz2
libllvm-cd52c21ea66d12736943c14302c7b05674ff35c1.zip
[DIBS] Add scripts to libllvm to build in DIBS.
Change-Id: I6068cf891024e6067a0655704c98734b1f1a8188 Signed-off-by: K Puneetha <k.puneetha@samsung.com>
-rwxr-xr-xbuild-libllvm-ubuntu-64.sh89
-rwxr-xr-xpackage/build.linux32
-rw-r--r--package/changelog3
-rw-r--r--package/pkginfo.manifest10
4 files changed, 134 insertions, 0 deletions
diff --git a/build-libllvm-ubuntu-64.sh b/build-libllvm-ubuntu-64.sh
new file mode 100755
index 0000000..2ce0a0f
--- /dev/null
+++ b/build-libllvm-ubuntu-64.sh
@@ -0,0 +1,89 @@
+#!/bin/sh
+
+CURDIR=`pwd`
+SOURCE_TAR_DIR=${CURDIR}/sources
+LLVM_SOURCE_TAR_FILE=${SOURCE_TAR_DIR}/llvm-4.0.0.tar.gz
+LLVM_SOURCE_DIR=${CURDIR}/llvm-4.0.0
+BUILD_PATH=${CURDIR}/rbuild-${TARGET_OS}
+ARM_BUILD_PATH=${CURDIR}/arm_rbuild-${TARGET_OS}
+INSTALL_PATH=${SRCDIR}/install-libllvm-4.0.0-${TARGET_OS}
+ARM_INSTALL_PATH=${CURDIR}/arm-libllvm-4.0.0-${TARGET_OS}
+LIB_INSTALL_PATH=${SRCDIR}/libllvm-4.0.0-${TARGET_OS}
+
+rm -rf ${LLVM_SOURCE_DIR}
+tar xf ${LLVM_SOURCE_TAR_FILE}
+if [ -d ${LLVM_SOURCE_DIR} ]
+then
+ echo "[checking llvm source.. ok]"
+else
+ echo "[error: there is not llvm source]"
+ exit 1
+fi
+
+mkdir $BUILD_PATH
+cd $BUILD_PATH
+echo "CMAKE for release mode"
+export COMPILER_DIR=${ROOTDIR}/tools/x86_64-linux-gnu-gcc-4.9/bin
+export SYSROOT_DIR=${ROOTDIR}/rs-devel_glibc-2.20.x86_64
+
+
+cmake $LLVM_SOURCE_DIR \
+ -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" \
+ -DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static-libgcc --disable-shared --enable-static" \
+ -DCMAKE_SHARED_LINKER_FLAGS="-static-libstdc++ -static-libgcc --disable-shared --enable-static" \
+ -DCMAKE_C_COMPILER=$COMPILER_DIR/x86_64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=$COMPILER_DIR/x86_64-linux-gnu-g++ \
+ -DCMAKE_C_FLAGS="--sysroot=${SYSROOT_DIR}" -DCMAKE_CXX_FLAGS="--sysroot=${SYSROOT_DIR}" \
+ -DCMAKE_AR=$COMPILER_DIR/x86_64-linux-gnu-ar -DCMAKE_RANLIB=$COMPILER_DIR/x86_64-linux-gnu-ranlib \
+ -DCMAKE_LINKER=$COMPILER_DIR/x86_64-linux-gnu-ld \
+ -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
+ -DLLVM_INCLUDE_TESTS=OFF 2>&1 | tee ../build.log
+
+echo "make for release mode"
+make ENABLE_OPTIMIZED=1 -j4 2>&1 | tee -a ../build.log
+
+echo "make install for release mode"
+make install 2>&1 | tee -a ../build.log
+
+cd ..
+cd $INSTALL_PATH
+rm -rf bin/APIChecker
+rm -rf include
+rm -rf share
+
+cd ${SRCDIR}
+rm -rf $ARM_BUILD_PATH
+mkdir $ARM_BUILD_PATH
+cd $ARM_BUILD_PATH
+
+export SYSROOT_DIR=${ROOTDIR}/rs-devel_glibc-2.20.armv7l
+export COMPILER_DIR=${ROOTDIR}/tools/arm-linux-gnueabi-gcc-4.9/bin
+
+cmake $LLVM_SOURCE_DIR -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="ARM" -DCMAKE_CROSSCOMPILING=True -DLLVM_DEFAULT_TARGET_TRIPLE=arm-linux-gnueabi -DHAVE_POSIX_SPAWN=0 -DCMAKE_INSTALL_PREFIX=$ARM_INSTALL_PATH -DCMAKE_C_COMPILER=$COMPILER_DIR/arm-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=$COMPILER_DIR/arm-linux-gnueabi-g++ -DCMAKE_SYSROOT=$SYSROOT_DIR -DCMAKE_AR=$COMPILER_DIR/arm-linux-gnueabi-ar -DCMAKE_RANLIB=$COMPILER_DIR/arm-linux-gnueabi-ranlib -DCMAKE_LINKER=$COMPILER_DIR/arm-linux-gnueabi-ld -DCMAKE_CROSSCOMPILING=True -DLLVM_TARGET_ARCH=ARM -DLLVM_TABLEGEN=$BUILD_PATH/bin/llvm-tblgen -DCLANG_TABLEGEN=$BUILD_PATH/bin/clang-tblgen -DCMAKE_SHARED_LINKER_FLAGS="-static-libgcc" -DLLVM_INCLUDE_TESTS=OFF 2>&1 | tee ../build_profilert.log
+
+make -j4 2>&1 | tee ../build_profilert.log
+make install 2>&1 | tee -a ../build_profilert.log
+
+cd ${SRCDIR}
+mkdir -p $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.asan-i386.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.builtins-i386.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.profile-i386.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.asan-x86_64.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.builtins-x86_64.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.profile-x86_64.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+
+cp -r $ARM_INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.asan-arm.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $ARM_INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.builtins-arm.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+cp -r $ARM_INSTALL_PATH/lib/clang/4.0.0/lib/linux/libclang_rt.profile-arm.a $LIB_INSTALL_PATH/lib/clang/4.0.0/lib/linux/
+
+#clean
+rm -rf $INSTALL_PATH
+rm -rf $ARM_INSTALL_PATH
+rm -rf $BUILD_PATH
+rm -rf $ARM_BUILD_PATH
+
+cd $CURDIR
+
diff --git a/package/build.linux b/package/build.linux
new file mode 100755
index 0000000..4a115c6
--- /dev/null
+++ b/package/build.linux
@@ -0,0 +1,32 @@
+#!/bin/sh -xe
+
+LIB_DEST_DIR=${SRCDIR}/libllvm-4.0.0-${TARGET_OS}
+
+echo $DEST_BIN_DIR
+# clean
+clean()
+{
+ rm -rf ${LIB_DEST_DIR}
+}
+
+
+# build
+build()
+{
+ SOURCE_TAR_DIR=${SRCDIR}/sources
+ rm -rf ${SOURCE_TAR_DIR}
+ mkdir ${SOURCE_TAR_DIR}
+ # Copy source code
+ cp $ROOTDIR/llvm-4.0.0.tar.gz $SOURCE_TAR_DIR/
+ ./build-libllvm-ubuntu-64.sh
+ cd ${SRCDIR}
+}
+
+# install
+install()
+{
+ INSTALL_DIR=$SRCDIR/package/libllvm-4.0.0.package.${TARGET_OS}/data/tools/llvm-4.0.0
+ rm -rf $SRCDIR/package/libllvm-4.0.0.package.${TARGET_OS}
+ mkdir -p $INSTALL_DIR
+ mv ${LIB_DEST_DIR}/* $INSTALL_DIR
+}
diff --git a/package/changelog b/package/changelog
new file mode 100644
index 0000000..27e6fc3
--- /dev/null
+++ b/package/changelog
@@ -0,0 +1,3 @@
+* 0.0.1
+- Initial libllvm-4.0.0 checkin
+== Puneetha K <k.puneetha@samsung.com> 2017-04-27
diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest
new file mode 100644
index 0000000..230693c
--- /dev/null
+++ b/package/pkginfo.manifest
@@ -0,0 +1,10 @@
+Source : llvm-4.0.0
+Version : 0.0.1
+Maintainer : Karthik Bhat <kv.bhat@samsung.com>, Dinesh Dwivedi <dinesh.d@samsung.com>, Seunghwan Lee <sh.cat.lee@samsung.com>
+
+Package : libllvm-4.0.0
+OS : ubuntu-32,ubuntu-64,windows-32,windows-64,macos-64
+Build-host-os : ubuntu-64
+Source-dependency : llvm-4.0.0.tar.gz
+Build-dependency : rs-devel_glibc-2.20.armv7l [ubuntu-64],cross-arm-gcc-4.9[ubuntu-64],cross-x86-64-gcc-4.9[ubuntu-64],rs-devel_glibc-2.20.x86_64 [ubuntu-64]
+Description : llvm libraries for Tizen SDK