Commit d3d6aef1 authored by Sylvestre Ledru's avatar Sylvestre Ledru

Merge branch 'snapshot' into 'snapshot'

Integrating OpenMP in toolchain See merge request !4
parents 8b61e675 430f8ff5
......@@ -10,7 +10,8 @@ Build-Depends: debhelper (>= 9.0), flex, bison, dejagnu, tcl, expect,
libjsoncpp-dev, pkg-config,
lcov, procps, help2man, zlib1g-dev,
g++-multilib [amd64 i386 kfreebsd-amd64 mips mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32],
libjs-mathjax
libjs-mathjax,
doxygen, gfortran
# ocaml-nox [amd64 arm64 armel armhf i386 ppc64el s390x],
# ocaml-findlib [amd64 arm64 armel armhf i386 ppc64el s390x],
# libctypes-ocaml-dev [amd64 arm64 armel armhf i386 ppc64el s390x],
......@@ -473,3 +474,103 @@ Description: Next generation, high-performance debugger, header files
Project, such as the Clang expression parser and LLVM disassembler.
.
This package provides the header files to build extension over lldb.
# ------------- openmp -------------
Package: libiomp-7-dev
Section: libdevel
Architecture: any
Depends: libomp-7-dev (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: Intel OpenMP runtime - dev package - transition package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
.
This package has been replaced by the LLVM sources. This is the Intel version
moved under the LLVM umbrella. This is a dependency package.
Package: libomp-7-dev
Section: libdevel
Architecture: any
Depends: libomp5-7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Suggests: libomp-7-doc
Replaces: libiomp-7-dev (<< 3.7-1)
Breaks: libiomp-7-dev (<< 3.7-1)
Description: LLVM OpenMP runtime - dev package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
Package: libiomp5-7
Section: libs
Architecture: any
Depends: libomp5-7, ${shlibs:Depends}, ${misc:Depends}
Description: Intel OpenMP runtime - transition package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
.
This package has been replaced by the LLVM sources. This is the Intel version
moved under the LLVM umbrella. This is a dependency package.
Package: libomp5-7
Multi-Arch: same
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Replaces: libiomp5-7 (<< 3.7-1)
Breaks: libiomp5-7 (<< 3.7-1)
Description: LLVM OpenMP runtime
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
Package: libiomp5-7-dbg
Section: debug
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libomp5-7 (= ${binary:Version})
Description: Intel OpenMP runtime - Debug transition package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
.
This package has been replaced by the LLVM sources. This is the Intel version
moved under the LLVM umbrella. This is a dependency package.
Package: libomp5-7-dbg
Section: debug
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}, libomp5-7 (= ${binary:Version})
Replaces: libiomp5-7-dbg (<< 3.7-1)
Breaks: libiomp5-7-dbg (<< 3.7-1)
Description: LLVM OpenMP runtime - Debug package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
Package: libiomp-7-doc
Section: doc
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, libomp-7-doc
Description: Intel OpenMP runtime - Documentation - Transition package
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
.
This package has been replaced by the LLVM sources. This is the Intel version
moved under the LLVM umbrella. This is a dependency package.
Package: libomp-7-doc
Section: doc
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery
Replaces: libiomp-7-doc (<< 3.7-1)
Breaks: libiomp-7-doc (<< 3.7-1)
Description: LLVM OpenMP runtime - Documentation
The runtime is the part of the OpenMP implementation that your code is
linked against, and that manages the multiple threads in an OpenMP program
while it is executing.
.
This package contains the documentation of this package.
/usr/lib/llvm-@LLVM_VERSION@/include/openmp/omp*.h
/usr/lib/llvm-@LLVM_VERSION@/lib/libgomp.so
/usr/lib/llvm-@LLVM_VERSION@/lib/libiomp5.so
/usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so
openmp/runtime/doc/doxygen/generated/html/
usr/lib/llvm-@LLVM_VERSION@/lib/libomp.so.5
libomp5-@LLVM_VERSION@: postinst-must-call-ldconfig usr/lib/*/libomp-@LLVM_VERSION@.so.5
......@@ -6,7 +6,9 @@
# llvm-toolchain-snapshot-3.2_3.2repack.orig-lld.tar.bz2
# llvm-toolchain-snapshot-3.2_3.2repack.orig-lldb.tar.bz2
# llvm-toolchain-snapshot-3.2_3.2repack.orig-polly.tar.bz2
# llvm-toolchain-snapshot-3.2_3.2repack.orig-openmp.tar.bz2
# llvm-toolchain-snapshot-3.2_3.2repack.orig.tar.bz2
set -e
# TODO rest of the options
......@@ -182,6 +184,14 @@ rm -rf $LLDB_TARGET/www/
tar jcf $FULL_VERSION.orig-lldb.tar.bz2 $LLDB_TARGET
rm -rf $LLDB_TARGET
# OPENMP
OPENMP_TARGET=openmp_$VERSION
checkout_sources openmp $(get_svn_url openmp $BRANCH $TAG) $OPENMP_TARGET "$BRANCH" $REVISION
rm -rf $OPENMP_TARGET/www/
tar jcf $FULL_VERSION.orig-openmp.tar.bz2 $OPENMP_TARGET
rm -rf $OPENMP_TARGET
PATH_DEBIAN="$(pwd)/$(dirname $0)/../"
echo "going into $PATH_DEBIAN"
export DEBFULLNAME="Sylvestre Ledru"
......
Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/tools/check-execstack.pl
===================================================================
--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/tools/check-execstack.pl
+++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/tools/check-execstack.pl
@@ -46,7 +46,8 @@ sub execstack($) {
# GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
# Linux* OS Intel(R) 64:
# GNU_STACK 0x000000 0x0000000000000000 0x0000000000000000 0x000000 0x000000 RWE 0x8
- if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0x[0-9a-f]+\s*\z} ) {
+# if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0x[0-9a-f]+\s*\z} ) {
+ if ( $stack[ 0 ] !~ m{\A\s*(?:GNU_)?STACK(?:\s+0x[0-9a-f]+){5}\s+([R ][W ][E ])\s+0(?:x[0-9a-f]+)*\s*\z} ) {
runtime_error( "$file: Cannot parse stack segment line:", ">>> $stack[ 0 ]" );
}; # if
my $attrs = $1;
Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/src/kmp_affinity.h
===================================================================
--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/src/kmp_affinity.h
+++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/src/kmp_affinity.h
@@ -212,28 +212,29 @@ public:
#elif __NR_sched_getaffinity != 223
#error Wrong code for getaffinity system call.
#endif /* __NR_sched_getaffinity */
-#elif KMP_ARCH_MIPS
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 4239
-#elif __NR_sched_setaffinity != 4239
-#error Wrong code for setaffinity system call.
-#endif /* __NR_sched_setaffinity */
-#ifndef __NR_sched_getaffinity
-#define __NR_sched_getaffinity 4240
-#elif __NR_sched_getaffinity != 4240
-#error Wrong code for getaffinity system call.
-#endif /* __NR_sched_getaffinity */
-#elif KMP_ARCH_MIPS64
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 5195
-#elif __NR_sched_setaffinity != 5195
-#error Wrong code for setaffinity system call.
-#endif /* __NR_sched_setaffinity */
-#ifndef __NR_sched_getaffinity
-#define __NR_sched_getaffinity 5196
-#elif __NR_sched_getaffinity != 5196
-#error Wrong code for getaffinity system call.
-#endif /* __NR_sched_getaffinity */
+# elif KMP_ARCH_MIPS
+# ifndef __NR_sched_setaffinity
+# define __NR_sched_setaffinity 4239
+# elif __NR_sched_setaffinity != 4239
+# error Wrong code for setaffinity system call.
+# endif /* __NR_sched_setaffinity */
+# ifndef __NR_sched_getaffinity
+# define __NR_sched_getaffinity 4240
+# elif __NR_sched_getaffinity != 4240
+# error Wrong code for getaffinity system call.
+# endif /* __NR_sched_getaffinity */
+# elif KMP_ARCH_MIPS64
+# ifndef __NR_sched_setaffinity
+# define __NR_sched_setaffinity 5195
+# elif __NR_sched_setaffinity != 5195
+# error Wrong code for setaffinity system call.
+# endif /* __NR_sched_setaffinity */
+# ifndef __NR_sched_getaffinity
+# define __NR_sched_getaffinity 5196
+# elif __NR_sched_getaffinity != 5196
+# error Wrong code for getaffinity system call.
+# endif /* __NR_sched_getaffinity */
+# else
#error Unknown or unsupported architecture
#endif /* KMP_ARCH_* */
class KMPNativeAffinity : public KMPAffinity {
Index: llvm-toolchain-snapshot_7~svn335949/openmp/runtime/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot_7~svn335949.orig/openmp/runtime/CMakeLists.txt
+++ llvm-toolchain-snapshot_7~svn335949/openmp/runtime/CMakeLists.txt
@@ -357,7 +357,8 @@ else()
set(LIBOMP_INSTALL_KIND ARCHIVE)
endif()
-set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${LIBOMP_LIBRARY_SUFFIX})
+set(LIBOMP_LIB_FILE ${LIBOMP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBOMP_VERSION_MAJOR})
+
# Optional backwards compatibility aliases.
set(LIBOMP_INSTALL_ALIASES TRUE CACHE BOOL
......@@ -51,3 +51,6 @@ remove-test-freezing.diff
0048-Set-html_static_path-_static-everywhere.patch
0049-Use-Debian-provided-MathJax-everywhere.patch
impl-path-hurd.diff
openmp-check-execstack.diff
openmp-soname.diff
openmp-mips-affinity.patch
......@@ -14,6 +14,7 @@ ifeq ($(LLVM_VERSION),$(LLVM_VERSION_FULL))
endif
SONAME_EXT := 1
SONAME_OPENMP := 5
# Manage the case when the version is 3.5~svn213052-1~exp1 or 3.4.2-1
DEBIAN_REVISION := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\3,p")
ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
......@@ -176,6 +177,14 @@ ifeq (,$(filter $(DEB_HOST_ARCH_OS),linux))
LIBFUZZER_ENABLE=no
endif
ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel))
LIBOMP_ARCH = mips
endif
ifneq (,$(filter $(DEB_HOST_ARCH), mips64 mips64el))
LIBOMP_ARCH = mips64
endif
%:
dh $@ $(DH_OPTIONS)
......@@ -243,6 +252,13 @@ override_dh_auto_configure: preconfigure
ln -s ../compiler-rt .; \
readlink compiler-rt
cd projects/ && \
if test -h openmp; then \
rm openmp; \
fi; \
ln -s ../openmp .; \
readlink openmp
# Configure coverity (we need the compilers) + work around perf issues
-(if test $(COVERITY_ENABLE) -eq 1; then \
export PATH=$$PATH:/opt/cov-analysis/bin/; \
......@@ -351,6 +367,8 @@ build_doc:
echo "Generating manpage of $$f"; \
LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1; \
done
cd openmp/runtime && doxygen doc/doxygen/config
cd openmp/runtime/doc/doxygen/generated/html/ && rm jquery.js && ln -s /usr/share/javascript/jquery/jquery.js
override_dh_auto_install:
# Clean up temporary files to make sure the install works
......@@ -369,6 +387,12 @@ override_dh_auto_install:
cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/ && rm -f libclang.so.$(SONAME_EXT) libclang-$(LLVM_VERSION).so; \
ln -s libclang-$(LLVM_VERSION).so.$(SONAME_EXT) libclang.so.$(SONAME_EXT)
cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && rm -f libomp.so; \
ln -s libomp.so.$(SONAME_OPENMP) libomp.so
mkdir -p debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp
cp openmp/runtime/exports/common.dia.50.ompt.optional/include/* debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp
# Remove artefact (where compiler-rt is built)
# if test -d $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux; then \
# cd $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux && rm -rf $$(find . -mindepth 2 -maxdepth 2 -type d) && rm -rf $$(find -empty) && rm -rf */.dir; \
......@@ -492,6 +516,7 @@ override_dh_makeshlibs:
dh_makeshlibs -plibclang$(SONAME_EXT)-$(LLVM_VERSION) -V"libclang$(SONAME_EXT)-$(LLVM_VERSION) (>= 1:7~svn298832-1~)" -- -c4
dh_makeshlibs -pliblldb-$(LLVM_VERSION) -V"liblldb-$(LLVM_VERSION) (>= 1:7~svn298832-1~)"
dh_makeshlibs -plibllvm$(LLVM_VERSION) -V"libllvm$(LLVM_VERSION) (>= 1:7~svn298832-1~)"
dh_makeshlibs -plibomp$(SONAME_OPENMP)-$(LLVM_VERSION) -V"libomp$(SONAME_OPENMP)-$(LLVM_VERSION)) (>= 1:7~svn298832-1~)"
dh_makeshlibs --remaining-packages
override_dh_shlibdeps:
......@@ -513,6 +538,7 @@ ifeq (0, $(strip $(shell dpkg --compare-versions $(DH_VERSION) ge 9.20160114; ec
dh_strip -p libclang$(SONAME_EXT)-$(LLVM_VERSION) --dbgsym-migration='libclang$(SONAME_EXT)-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
dh_strip -p libllvm$(LLVM_VERSION) --dbgsym-migration='libllvm$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
dh_strip -p liblldb-$(LLVM_VERSION) --dbgsym-migration='liblldb-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
dh_strip -p libomp$(SONAME_OPENMP)-$(LLVM_VERSION) --dbgsym-migration='libomp$(SONAME_OPENMP)-$(LLVM_VERSION)-dbg (<< 1:7~svn327768-1~)'
endif
# ifeq (${LLD_ENABLE},yes)
# dh_strip -p liblld-$(LLVM_VERSION) --dbg-package=liblld-$(LLVM_VERSION)-dbg
......
......@@ -5,7 +5,7 @@ SVN_REV=`ls -1 *svn*bz2 | tail -1|perl -ne 'print "$1\n" if /svn(\d+)/;' | sort
echo "Unpack of llvm"
tar jxf llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig.tar.bz2
cd llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV/ || ( echo "Bad SVN_REV:\"$SVN_REV\"" && exit 1 )
for f in ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-clang.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-clang-tools-extra.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-compiler-rt.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-lld.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-lldb.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-polly.tar.bz2; do
for f in ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-clang.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-clang-tools-extra.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-compiler-rt.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-lld.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-lldb.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-polly.tar.bz2 ../llvm-toolchain-snapshot_$MAJOR_VERSION~svn$SVN_REV.orig-openmp.tar.bz2; do
if test -e $f; then
echo "unpack of $f"
tar jxf $f
......@@ -17,5 +17,6 @@ ln -s compiler-rt_$MAJOR_VERSION~svn$SVN_REV compiler-rt
ln -s polly_$MAJOR_VERSION~svn$SVN_REV polly
ln -s lld_$MAJOR_VERSION~svn$SVN_REV lld
ln -s lldb_$MAJOR_VERSION~svn$SVN_REV lldb
ln -s openmp_$MAJOR_VERSION~svn$SVN_REV openmp
cp -R ../snapshot/debian .
QUILT_PATCHES=debian/patches/ quilt push -a --fuzz=0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment