From dc80bb786208fb94b8c68e899e7e2b9a6838b98849e53a76ea27852ade965db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 2 Sep 2016 07:08:38 +0000 Subject: [PATCH 01/11] Accepting request 424333 from home:scarabeus_iv:branches:devel:tools:compiler - Convert to use %cmake macros - Start conversion to use cmake macros with now introduced compatibility for ninja - Reduce number of threads if we don't have enough memory - Add patch for the nonvoid returns: * llvm-nonvoid-return.patch OBS-URL: https://build.opensuse.org/request/show/424333 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=466 --- lldb.changes | 5 ++ lldb.spec | 37 +++++------ llvm-nonvoid-return.patch | 13 ++++ llvm.changes | 9 +++ llvm.spec | 128 ++++++++++++++++++++------------------ 5 files changed, 110 insertions(+), 82 deletions(-) create mode 100644 llvm-nonvoid-return.patch diff --git a/lldb.changes b/lldb.changes index 5fd2301..fee61c9 100644 --- a/lldb.changes +++ b/lldb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Aug 31 10:24:31 UTC 2016 - tchvatal@suse.com + +- Convert to use %cmake macros + ------------------------------------------------------------------- Thu Aug 25 16:42:02 UTC 2016 - ronisbr@gmail.com diff --git a/lldb.spec b/lldb.spec index 4997963..60de7dd 100644 --- a/lldb.spec +++ b/lldb.spec @@ -82,30 +82,23 @@ This package contains the development files for LLDB. sed -i s,LLDB_REVISION,\"%{_revision}\",g source/lldb.cpp #" %build -mkdir build -pushd build - -cmake -DCMAKE_C_COMPILER=clang \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ - -DCMAKE_BUILD_TYPE=Release \ - %if "%{_lib}" == "lib64" - -DLLVM_LIBDIR_SUFFIX=64 \ - %endif - -DLLVM_RUNTIME_OUTPUT_INTDIR=$PWD/bin \ - -DLLVM_LIBRARY_OUTPUT_INTDIR=$PWD/%{_lib} \ - -DPYTHON_VERSION_MAJOR=%{py_major} \ - -DPYTHON_VERSION_MINOR=%{py_minor} \ - -G "Ninja" \ - .. - -ninja +%define __builder ninja +%cmake \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ + -DBUILD_SHARED_LIBS=OFF \ +%if "%{_lib}" == "lib64" + -DLLVM_LIBDIR_SUFFIX=64 \ +%endif + -DLLVM_RUNTIME_OUTPUT_INTDIR=$PWD/bin \ + -DLLVM_LIBRARY_OUTPUT_INTDIR=$PWD/%{_lib} \ + -DPYTHON_VERSION_MAJOR=%{py_major} \ + -DPYTHON_VERSION_MINOR=%{py_minor} +%make_jobs %install -pushd build -DESTDIR=%{buildroot} ninja install +%cmake_install # Python: fix binary libraries location. rm %{buildroot}%{py_sitedir}/lldb/_lldb.so diff --git a/llvm-nonvoid-return.patch b/llvm-nonvoid-return.patch new file mode 100644 index 0000000..a140bc4 --- /dev/null +++ b/llvm-nonvoid-return.patch @@ -0,0 +1,13 @@ +Index: llvm-3.8.0.src/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp +=================================================================== +--- llvm-3.8.0.src.orig/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp ++++ llvm-3.8.0.src/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp +@@ -254,7 +254,7 @@ test_then_inc< kmp_int64 >( volatile kmp + // compare_and_swap template (general template should NOT be used) + template< typename T > + static __forceinline kmp_int32 +-compare_and_swap( volatile T *p, T c, T s ) { KMP_ASSERT(0); }; ++compare_and_swap( volatile T *p, T c, T s ); + + template<> + __forceinline kmp_int32 diff --git a/llvm.changes b/llvm.changes index baaafd6..45235e8 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Aug 26 10:03:56 UTC 2016 - tchvatal@suse.com + +- Start conversion to use cmake macros with now introduced + compatibility for ninja +- Reduce number of threads if we don't have enough memory +- Add patch for the nonvoid returns: + * llvm-nonvoid-return.patch + ------------------------------------------------------------------- Thu Jul 28 09:59:01 UTC 2016 - normand@linux.vnet.ibm.com diff --git a/llvm.spec b/llvm.spec index 81b3336..1c510ca 100644 --- a/llvm.spec +++ b/llvm.spec @@ -77,6 +77,7 @@ Patch8: revert-cmake-soname.patch Patch9: lldb-cmake.patch Patch10: glibc-2.23-libcxx.patch Patch11: glibc-2.24-libcxx.patch +Patch12: llvm-nonvoid-return.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: binutils-devel >= 2.21.90 BuildRequires: bison @@ -91,6 +92,7 @@ BuildRequires: libstdc++-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: ninja +BuildRequires: procps BuildRequires: python-base BuildRequires: python-xml # llvm does not work on ppc or s390 @@ -193,6 +195,7 @@ disassembler. %patch10 %patch11 %endif +%patch12 -p1 # Move into right place mv cfe-%{version}.src tools/clang @@ -235,88 +238,93 @@ EOF %endif %build -TOPLEVEL=$PWD -mkdir stage1 stage2 -pushd stage1 - -export CC=gcc -export CXX=g++ - -cmake -G "Ninja" \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_TARGETS_TO_BUILD=host \ - -DLLDB_DISABLE_PYTHON=ON \ - .. - -ninja %{?_smp_mflags} clang -v - -popd -pushd stage2 - -export CC=$TOPLEVEL/stage1/bin/clang -export CXX=$TOPLEVEL/stage1/bin/clang++ - -cmake -G "Ninja" \ - -DBUILD_SHARED_LIBS=ON \ -%ifarch %arm ppc64 ppc64le - -DCMAKE_BUILD_TYPE=Release \ -%else - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -%endif - -DCMAKE_INSTALL_PREFIX=%{_prefix} \ +# Disable c/xx/flags as the clang fails to build with hardening right now +#flags="%{optflags} -fno-strict-aliasing" +flags="-fno-strict-aliasing" %ifarch armv6hl - -DCMAKE_C_FLAGS="-mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" \ - -DCMAKE_CXX_FLAGS="-mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" \ +flags+=" -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" %endif %ifarch armv7hl - -DCMAKE_C_FLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" \ - -DCMAKE_CXX_FLAGS="-mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" \ +flags+=" -mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" +%endif +# do not eat all memory +ninjaproc="%{?jobs:%{jobs}}" +echo "Available memory:" +free +echo "System limits:" +ulimit -a +if test -n "$ninjaproc" -a "$ninjaproc" -gt 1 ; then + mem_per_process=1000 + max_mem=`LANG=C free -t -m | sed -n "s|^Mem: *\([0-9]*\).*$|\1|p"` + max_jobs="$(($max_mem / $mem_per_process))" + test "$ninjaproc" -gt "$max_jobs" && ninjaproc="$max_jobs" && echo "Warning: Reducing number of jobs to $max_jobs because of memory limits" + test "$ninjaproc" -le 0 && ninjaproc=1 && echo "Warning: Do not use the parallel build at all becuse of memory limits" +fi + +%define __builder ninja +%define __builddir stage1 +# -z,now is breaking now, it needs to be fixed +%cmake \ + -DCMAKE_C_FLAGS="$flags" \ + -DCMAKE_CXX_FLAGS="$flags" \ + -DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_TARGETS_TO_BUILD=host \ + -DLLDB_DISABLE_PYTHON=ON \ + -DCMAKE_SKIP_RPATH:BOOL=OFF \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed" \ + -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" +ninja -v -j $ninjaproc +cd .. + +%define __builddir build +export CC=${PWD}/stage1/bin/clang +export CXX=${PWD}/stage1/bin/clang++ +# -z,now is breaking now, it needs to be fixed +%cmake \ + -DCMAKE_C_FLAGS="$flags" \ + -DCMAKE_CXX_FLAGS="$flags" \ + -DLLVM_REQUIRES_RTTI=ON \ + -DLLVM_ENABLE_TIMESTAMPS=OFF \ + -DLLVM_ENABLE_ASSERTIONS=OFF \ + -DLLVM_ENABLE_PIC=ON \ + -DLLVM_BINUTILS_INCDIR=/usr/include \ +%ifarch %{ix86} x86_64 + -DLLVM_TARGETS_TO_BUILD="all" \ +%else + -DLLVM_TARGETS_TO_BUILD=host \ %endif %if "%{_lib}" == "lib64" - -DLLVM_LIBDIR_SUFFIX=64 \ -%endif - -DLLVM_REQUIRES_RTTI=ON \ - -DLLVM_ENABLE_TIMESTAMPS=OFF \ - -DLLVM_ENABLE_ASSERTIONS=OFF \ - -DLLVM_ENABLE_PIC=ON \ - -DLLVM_BINUTILS_INCDIR=/usr/include \ -%ifarch %{ix86} x86_64 - -DLLVM_TARGETS_TO_BUILD="all" \ -%else - -DLLVM_TARGETS_TO_BUILD=host \ + -DLLVM_LIBDIR_SUFFIX=64 \ %endif %if %{build_lldb} - -DLLDB_DISABLE_PYTHON=ON \ + -DLLDB_DISABLE_PYTHON=ON \ %endif - .. - -ninja %{?_smp_mflags} -v + -DCMAKE_SKIP_RPATH:BOOL=OFF \ + -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed" \ + -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \ + -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" +ninja -v -j $ninjaproc %check -cd stage2 +cd build %ifnarch armv7hl armv7l %if 0%{!?qemu_user_space_build:1} # we just do not have enough memory with qemu emulation -ninja check -ninja clang-test +ninja -v %{?_smp_mflags} check +ninja -v %{?_smp_mflags} clang-test %if %{build_libcxx} - -ninja check-libcxx -ninja check-libcxxabi +ninja -v %{?_smp_mflags} check-libcxx +ninja -v %{?_smp_mflags} check-libcxxabi %endif %endif %endif %install -cd stage2 -DESTDIR=%{buildroot} ninja install -cd .. - +%cmake_install # Build man/html pages cd docs # Docs are prebuilt due to sphinx dependency From f08dbfb441a739d77a546547aa8ec207fce7457cb98f3c6018f29e74986dfe19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 06:46:04 +0000 Subject: [PATCH 02/11] Accepting request 425075 from home:TheBlackCat:branches:devel:tools:compiler Update to llvm 3.8.1 Many other fixes and cleanups OBS-URL: https://build.opensuse.org/request/show/425075 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=467 --- arm_suse_support.diff | 6 +- assume-opensuse.patch | 6 +- baselibs.conf | 7 +- cfe-3.8.0.src.tar.xz | 3 - cfe-3.8.1.src.tar.xz | 3 + cfe-docs-3.8.0.src.tar.xz | 3 - cfe-docs-3.8.1.src.tar.xz | 3 + clang-resourcedirs.patch | 6 +- clang-tools-extra-3.8.0.src.tar.xz | 3 - clang-tools-extra-3.8.1.src.tar.xz | 3 + compiler-rt-3.8.0.src.tar.xz | 3 - compiler-rt-3.8.1.src.tar.xz | 3 + default-to-i586.patch | 6 +- glibc-2.23-libcxx.patch | 24 +- glibc-2.24-libcxx.patch | 6 +- libcxx-3.8.0.src.tar.xz | 3 - libcxx-3.8.1.src.tar.xz | 3 + libcxxabi-3.8.0.src.tar.xz | 3 - libcxxabi-3.8.1.src.tar.xz | 3 + lldb-3.8.0.src.tar.xz | 3 - lldb-3.8.1.src.tar.xz | 3 + lldb-add-pthread-dl-libs.patch | 6 +- lldb-cmake.patch | 12 +- lldb.changes | 44 +++ lldb.spec | 96 +++-- llvm-3.8.0.src.tar.xz | 3 - llvm-3.8.1.src.tar.xz | 3 + llvm-docs-3.8.0.src.tar.xz | 3 - llvm-docs-3.8.1.src.tar.xz | 3 + llvm-fix-find-gcc5-install.patch | 6 +- llvm-nonvoid-return.patch | 6 +- llvm-remove-clang-only-flags.patch | 6 +- llvm-rpmlintrc | 1 - llvm.changes | 44 +++ llvm.spec | 607 ++++++++++++++++++++--------- openmp-3.8.0.src.tar.xz | 3 - openmp-3.8.1.src.tar.xz | 3 + revert-cmake-soname.patch | 12 +- set-revision.patch | 6 +- 39 files changed, 676 insertions(+), 291 deletions(-) delete mode 100644 cfe-3.8.0.src.tar.xz create mode 100644 cfe-3.8.1.src.tar.xz delete mode 100644 cfe-docs-3.8.0.src.tar.xz create mode 100644 cfe-docs-3.8.1.src.tar.xz delete mode 100644 clang-tools-extra-3.8.0.src.tar.xz create mode 100644 clang-tools-extra-3.8.1.src.tar.xz delete mode 100644 compiler-rt-3.8.0.src.tar.xz create mode 100644 compiler-rt-3.8.1.src.tar.xz delete mode 100644 libcxx-3.8.0.src.tar.xz create mode 100644 libcxx-3.8.1.src.tar.xz delete mode 100644 libcxxabi-3.8.0.src.tar.xz create mode 100644 libcxxabi-3.8.1.src.tar.xz delete mode 100644 lldb-3.8.0.src.tar.xz create mode 100644 lldb-3.8.1.src.tar.xz delete mode 100644 llvm-3.8.0.src.tar.xz create mode 100644 llvm-3.8.1.src.tar.xz delete mode 100644 llvm-docs-3.8.0.src.tar.xz create mode 100644 llvm-docs-3.8.1.src.tar.xz delete mode 100644 openmp-3.8.0.src.tar.xz create mode 100644 openmp-3.8.1.src.tar.xz diff --git a/arm_suse_support.diff b/arm_suse_support.diff index bff9ebc..3ff24f5 100644 --- a/arm_suse_support.diff +++ b/arm_suse_support.diff @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Driver/ToolChains.cpp +Index: cfe-3.8.1.src/lib/Driver/ToolChains.cpp =================================================================== ---- cfe-3.8.0.src/lib/Driver/ToolChains.cpp.orig -+++ cfe-3.8.0.src/lib/Driver/ToolChains.cpp +--- cfe-3.8.1.src/lib/Driver/ToolChains.cpp.orig ++++ cfe-3.8.1.src/lib/Driver/ToolChains.cpp @@ -1418,7 +1418,7 @@ bool Generic_GCC::GCCInstallationDetecto static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; static const char *const AArch64Triples[] = { diff --git a/assume-opensuse.patch b/assume-opensuse.patch index 0aab27d..df4f67f 100644 --- a/assume-opensuse.patch +++ b/assume-opensuse.patch @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Driver/ToolChains.cpp +Index: cfe-3.8.1.src/lib/Driver/ToolChains.cpp =================================================================== ---- cfe-3.8.0.src/lib/Driver/ToolChains.cpp.orig -+++ cfe-3.8.0.src/lib/Driver/ToolChains.cpp +--- cfe-3.8.1.src/lib/Driver/ToolChains.cpp.orig ++++ cfe-3.8.1.src/lib/Driver/ToolChains.cpp @@ -3422,6 +3422,7 @@ static bool IsUbuntu(enum Distro Distro) } diff --git a/baselibs.conf b/baselibs.conf index f5bcf56..f027300 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,3 +1,4 @@ -libLLVM -libclang - +libLLVM3_8 +libclang3_8 +llvm-devel +llvm-clang-devel diff --git a/cfe-3.8.0.src.tar.xz b/cfe-3.8.0.src.tar.xz deleted file mode 100644 index dd2877f..0000000 --- a/cfe-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:04149236de03cf05232d68eb7cb9c50f03062e339b68f4f8a03b650a11536cf9 -size 9627228 diff --git a/cfe-3.8.1.src.tar.xz b/cfe-3.8.1.src.tar.xz new file mode 100644 index 0000000..6e8371d --- /dev/null +++ b/cfe-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4cd3836dfb4b88b597e075341cae86d61c63ce3963e45c7fe6a8bf59bb382cdf +size 9605548 diff --git a/cfe-docs-3.8.0.src.tar.xz b/cfe-docs-3.8.0.src.tar.xz deleted file mode 100644 index 40ef46e..0000000 --- a/cfe-docs-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9097443437dc7394e1b5bf09ebdd1a740734f2974d408a8ff136bcfcfd81b4b5 -size 661952 diff --git a/cfe-docs-3.8.1.src.tar.xz b/cfe-docs-3.8.1.src.tar.xz new file mode 100644 index 0000000..dbf61fb --- /dev/null +++ b/cfe-docs-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5656cc4d88e364f4d8ec30a16f051296a0ae10b15ce67e439b4c4caf3a6a9d2a +size 671716 diff --git a/clang-resourcedirs.patch b/clang-resourcedirs.patch index 7921a26..a1e642a 100644 --- a/clang-resourcedirs.patch +++ b/clang-resourcedirs.patch @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Driver/Driver.cpp +Index: cfe-3.8.1.src/lib/Driver/Driver.cpp =================================================================== ---- cfe-3.8.0.src/lib/Driver/Driver.cpp -+++ cfe-3.8.0.src/lib/Driver/Driver.cpp +--- cfe-3.8.1.src/lib/Driver/Driver.cpp ++++ cfe-3.8.1.src/lib/Driver/Driver.cpp @@ -64,7 +64,7 @@ Driver::Driver(StringRef ClangExecutable // Compute the path to the resource directory. diff --git a/clang-tools-extra-3.8.0.src.tar.xz b/clang-tools-extra-3.8.0.src.tar.xz deleted file mode 100644 index 9896a0e..0000000 --- a/clang-tools-extra-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:afbda810106a6e64444bc164b921be928af46829117c95b996f2678ce4cb1ec4 -size 334072 diff --git a/clang-tools-extra-3.8.1.src.tar.xz b/clang-tools-extra-3.8.1.src.tar.xz new file mode 100644 index 0000000..fcbcc33 --- /dev/null +++ b/clang-tools-extra-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:664a5c60220de9c290bf2a5b03d902ab731a4f95fe73a00856175ead494ec396 +size 334768 diff --git a/compiler-rt-3.8.0.src.tar.xz b/compiler-rt-3.8.0.src.tar.xz deleted file mode 100644 index 518f186..0000000 --- a/compiler-rt-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c8d3387e55f229543dac1941769120f24dc50183150bf19d1b070d53d29d56b0 -size 1270128 diff --git a/compiler-rt-3.8.1.src.tar.xz b/compiler-rt-3.8.1.src.tar.xz new file mode 100644 index 0000000..d93c763 --- /dev/null +++ b/compiler-rt-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0df011dae14d8700499dfc961602ee0a9572fef926202ade5dcdfe7858411e5c +size 1263312 diff --git a/default-to-i586.patch b/default-to-i586.patch index f1f414f..fa4168d 100644 --- a/default-to-i586.patch +++ b/default-to-i586.patch @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Driver/Tools.cpp +Index: cfe-3.8.1.src/lib/Driver/Tools.cpp =================================================================== ---- cfe-3.8.0.src/lib/Driver/Tools.cpp.orig -+++ cfe-3.8.0.src/lib/Driver/Tools.cpp +--- cfe-3.8.1.src/lib/Driver/Tools.cpp.orig ++++ cfe-3.8.1.src/lib/Driver/Tools.cpp @@ -1680,8 +1680,8 @@ static const char *getX86TargetCPU(const case llvm::Triple::Bitrig: return "i686"; diff --git a/glibc-2.23-libcxx.patch b/glibc-2.23-libcxx.patch index 54fcf7e..a4fd5d7 100644 --- a/glibc-2.23-libcxx.patch +++ b/glibc-2.23-libcxx.patch @@ -1,7 +1,7 @@ -Index: libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isinf.pass.cpp +Index: libcxx-3.8.1.src/test/std/numerics/c.math/cmath_isinf.pass.cpp =================================================================== ---- libcxx-3.8.0.src.orig/test/std/numerics/c.math/cmath_isinf.pass.cpp -+++ libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isinf.pass.cpp +--- libcxx-3.8.1.src.orig/test/std/numerics/c.math/cmath_isinf.pass.cpp ++++ libcxx-3.8.1.src/test/std/numerics/c.math/cmath_isinf.pass.cpp @@ -11,8 +11,6 @@ // isinf @@ -18,10 +18,10 @@ Index: libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isinf.pass.cpp -} \ No newline at end of file +} -Index: libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isnan.pass.cpp +Index: libcxx-3.8.1.src/test/std/numerics/c.math/cmath_isnan.pass.cpp =================================================================== ---- libcxx-3.8.0.src.orig/test/std/numerics/c.math/cmath_isnan.pass.cpp -+++ libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isnan.pass.cpp +--- libcxx-3.8.1.src.orig/test/std/numerics/c.math/cmath_isnan.pass.cpp ++++ libcxx-3.8.1.src/test/std/numerics/c.math/cmath_isnan.pass.cpp @@ -11,8 +11,6 @@ // isnan @@ -31,10 +31,10 @@ Index: libcxx-3.8.0.src/test/std/numerics/c.math/cmath_isnan.pass.cpp #include #include #include -Index: libcxx-3.8.0.src/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp +Index: libcxx-3.8.1.src/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp =================================================================== ---- libcxx-3.8.0.src.orig/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp -+++ libcxx-3.8.0.src/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp +--- libcxx-3.8.1.src.orig/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp ++++ libcxx-3.8.1.src/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp @@ -11,8 +11,6 @@ // isinf @@ -44,10 +44,10 @@ Index: libcxx-3.8.0.src/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp #include #include #include -Index: libcxx-3.8.0.src/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp +Index: libcxx-3.8.1.src/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp =================================================================== ---- libcxx-3.8.0.src.orig/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp -+++ libcxx-3.8.0.src/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp +--- libcxx-3.8.1.src.orig/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp ++++ libcxx-3.8.1.src/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp @@ -11,8 +11,6 @@ // isnan diff --git a/glibc-2.24-libcxx.patch b/glibc-2.24-libcxx.patch index 86efb41..29f7a55 100644 --- a/glibc-2.24-libcxx.patch +++ b/glibc-2.24-libcxx.patch @@ -1,7 +1,7 @@ -Index: libcxx-3.8.0.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +Index: libcxx-3.8.1.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp =================================================================== ---- libcxx-3.8.0.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp.orig -+++ libcxx-3.8.0.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp +--- libcxx-3.8.1.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp.orig ++++ libcxx-3.8.1.src/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/curr_symbol.pass.cpp @@ -113,7 +113,7 @@ int main() { diff --git a/libcxx-3.8.0.src.tar.xz b/libcxx-3.8.0.src.tar.xz deleted file mode 100644 index 6d9d34f..0000000 --- a/libcxx-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:36804511b940bc8a7cefc7cb391a6b28f5e3f53f6372965642020db91174237b -size 1062884 diff --git a/libcxx-3.8.1.src.tar.xz b/libcxx-3.8.1.src.tar.xz new file mode 100644 index 0000000..958a2c3 --- /dev/null +++ b/libcxx-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77d7f3784c88096d785bd705fa1bab7031ce184cd91ba8a7008abf55264eeecc +size 1074164 diff --git a/libcxxabi-3.8.0.src.tar.xz b/libcxxabi-3.8.0.src.tar.xz deleted file mode 100644 index b5092a0..0000000 --- a/libcxxabi-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:c5ee0871aff6ec741380c4899007a7d97f0b791c81df69d25b744eebc5cee504 -size 508900 diff --git a/libcxxabi-3.8.1.src.tar.xz b/libcxxabi-3.8.1.src.tar.xz new file mode 100644 index 0000000..4376d08 --- /dev/null +++ b/libcxxabi-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1b55f7be3fad746bdd3025f43e42d429fb6194aac5919c2be17c4a06314dae1 +size 508392 diff --git a/lldb-3.8.0.src.tar.xz b/lldb-3.8.0.src.tar.xz deleted file mode 100644 index ccccd81..0000000 --- a/lldb-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3f68f44147df0433e7989bf6ed1c58ff28d7c68b9c47553cb9915f744785a35 -size 10929768 diff --git a/lldb-3.8.1.src.tar.xz b/lldb-3.8.1.src.tar.xz new file mode 100644 index 0000000..dc67bfd --- /dev/null +++ b/lldb-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:349148116a47e39dcb5d5042f10d8a6357d2c865034563283ca512f81cdce8a3 +size 10928220 diff --git a/lldb-add-pthread-dl-libs.patch b/lldb-add-pthread-dl-libs.patch index 5c8feba..ba9f7d1 100644 --- a/lldb-add-pthread-dl-libs.patch +++ b/lldb-add-pthread-dl-libs.patch @@ -1,7 +1,7 @@ -Index: lldb-3.8.0.src/cmake/modules/LLDBConfig.cmake +Index: lldb-3.8.1.src/cmake/modules/LLDBConfig.cmake =================================================================== ---- lldb-3.8.0.src.orig/cmake/modules/LLDBConfig.cmake -+++ lldb-3.8.0.src/cmake/modules/LLDBConfig.cmake +--- lldb-3.8.1.src.orig/cmake/modules/LLDBConfig.cmake ++++ lldb-3.8.1.src/cmake/modules/LLDBConfig.cmake @@ -323,13 +323,9 @@ else() endif() diff --git a/lldb-cmake.patch b/lldb-cmake.patch index 60d73a2..54b765d 100644 --- a/lldb-cmake.patch +++ b/lldb-cmake.patch @@ -1,7 +1,7 @@ -Index: lldb-3.8.0.src/source/lldb.cpp +Index: lldb-3.8.1.src/source/lldb.cpp =================================================================== ---- lldb-3.8.0.src.orig/source/lldb.cpp -+++ lldb-3.8.0.src/source/lldb.cpp +--- lldb-3.8.1.src.orig/source/lldb.cpp ++++ lldb-3.8.1.src/source/lldb.cpp @@ -21,11 +21,7 @@ extern "C" const unsigned char liblldb_c static const char * GetLLDBRevision() @@ -14,10 +14,10 @@ Index: lldb-3.8.0.src/source/lldb.cpp } static const char * -Index: lldb-3.8.0.src/source/Core/IOHandler.cpp +Index: lldb-3.8.1.src/source/Core/IOHandler.cpp =================================================================== ---- lldb-3.8.0.src.orig/source/Core/IOHandler.cpp -+++ lldb-3.8.0.src/source/Core/IOHandler.cpp +--- lldb-3.8.1.src.orig/source/Core/IOHandler.cpp ++++ lldb-3.8.1.src/source/Core/IOHandler.cpp @@ -9,8 +9,8 @@ // C Includes diff --git a/lldb.changes b/lldb.changes index fee61c9..7d62665 100644 --- a/lldb.changes +++ b/lldb.changes @@ -1,3 +1,47 @@ +------------------------------------------------------------------- +Thu Aug 31 20:36:58 UTC 2016 - toddrme2178@gmail.com + +- Update to llvm 3.8.1 + * See http://llvm.org/releases/3.8.1/docs/ReleaseNotes.html and + http://llvm.org/releases/3.8.1/tools/docs/ReleaseNotes.html +- Use versioned libLLVM (to libLLVM3_8) and libclang (to libclang3_8) +- Change versioning of liblldb3_8 to liblldb-3_8 and use a variable + to control the name instead of hard-coding it. +- Use bcond_with and bcond_without to enable/disable build options + instead of hard-coding them. +- Put buildrequires as requires in -devel packages to avoid linker errors + when building packages against the -devel packages. +- Add ffi support (disabled by default). +- Add oprofile support (disabled by default). +- Add valgrind support (disabled by default). +- Link cmake files to the normal cmake file directory to allow autodetection + of cmake interfaces. +- Remove unused lldb components from main spec file. +- Split llvm python bindings into own subpackage. +- Split emacs plugin into own subpackage +- Move additional vim plugins into vim plugins package +- Split libc++, libLTO, LLVMgold, libomp, clang-chekers into own subpackages +- Make python-clang, llvm-vim-plugins, and llvm-emacs-plugins noarch since + they aren't architecture-specific. +- Make packages besides llvm, llvm-clang, and the shared libraries conflict + with other versions. This will be important when multiple LLVM versions + are supported. +- Various spec file cleanups +- Rebase patches: + * arm_suse_support.diff + * assume-opensuse.patch + * clang-resourcedirs.patch + * default-to-i586.patch + * glibc-2.23-libcxx.patch + * glibc-2.24-libcxx.patch + * lldb-add-pthread-dl-libs.patch + * lldb-cmake.patch + * llvm-fix-find-gcc5-install.patch + * llvm-nonvoid-return.patch + * llvm-remove-clang-only-flags.patch + * revert-cmake-soname.patch + * set-revision.patch + ------------------------------------------------------------------- Wed Aug 31 10:24:31 UTC 2016 - tchvatal@suse.com diff --git a/lldb.spec b/lldb.spec index 60de7dd..6b284eb 100644 --- a/lldb.spec +++ b/lldb.spec @@ -16,10 +16,11 @@ # -%define _revision 262553 Name: lldb -Version: 3.8.0 +Version: 3.8.1 Release: 0 +%define _sonum 3_8 +%define _revsn 273405 Summary: Software debugger built using LLVM libraries License: NCSA Group: Development/Tools/Debuggers @@ -33,20 +34,20 @@ Patch1: D15067.id41365.diff Patch2: lldb-add-pthread-dl-libs.patch BuildRequires: cmake BuildRequires: fdupes -BuildRequires: libedit-devel -BuildRequires: libffi-devel -BuildRequires: libxml2-devel -BuildRequires: llvm-clang-devel = %{version} -BuildRequires: llvm-devel = %{version} BuildRequires: ncurses-devel BuildRequires: ninja -BuildRequires: python-devel BuildRequires: swig -BuildRequires: zlib-devel -Requires: libLLVM = %{version} -Requires: libclang = %{version} +BuildRequires: cmake(Clang) = %{version} +BuildRequires: cmake(LLVM) = %{version} +BuildRequires: pkgconfig(libedit) +BuildRequires: pkgconfig(libffi) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(python2) +BuildRequires: pkgconfig(zlib) Requires: python Requires: python-six +# Avoid multiple provider errors +Requires: liblldb%{_sonum} = %{version} ExclusiveArch: arm x86_64 %description @@ -55,23 +56,46 @@ of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler. -%package -n liblldb3_8 + +%package -n liblldb%{_sonum} Summary: LLDB software debugger runtime library Group: System/Libraries +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} = %{version} +Requires: libclang%{_sonum} = %{version} -%description -n liblldb3_8 +%description -n liblldb%{_sonum} This subpackage contains the main LLDB component. + %package devel Summary: Development files for LLDB Group: Development/Languages/Other -Requires: libedit-devel -Requires: liblldb3_8 = %{version} -Requires: zlib-devel +Requires: cmake +Requires: liblldb%{_sonum} = %{version} +Requires: ncurses-devel +Requires: swig +Requires: cmake(Clang) = %{version} +Requires: cmake(LLVM) = %{version} +Requires: pkgconfig(libedit) +Requires: pkgconfig(libffi) +Requires: pkgconfig(libxml-2.0) +Requires: pkgconfig(zlib) %description devel This package contains the development files for LLDB. + +%package -n python-lldb +Summary: Python bindings for liblldb +Group: Development/Languages/Python +Requires: liblldb%{_sonum} = %{version} +Requires: python + +%description -n python-lldb +This package contains the Python bindings to clang (C language) frontend for LLVM. + + %prep %setup -q -n %{name}-%{version}.src %patch0 -p1 @@ -79,7 +103,7 @@ This package contains the development files for LLDB. %patch2 -p1 # Set LLDB revision -sed -i s,LLDB_REVISION,\"%{_revision}\",g source/lldb.cpp #" +sed -i s,LLDB_REVISION,\"%{_revsn}\",g source/lldb.cpp #" %build %define __builder ninja @@ -101,13 +125,13 @@ sed -i s,LLDB_REVISION,\"%{_revision}\",g source/lldb.cpp #" %cmake_install # Python: fix binary libraries location. -rm %{buildroot}%{py_sitedir}/lldb/_lldb.so +rm %{buildroot}%{python_sitearch}/lldb/_lldb.so liblldb=$(basename $(readlink -e %{buildroot}%{_libdir}/liblldb.so)) ln -vsf "../../../${liblldb}" %{buildroot}%{python_sitearch}/lldb/_lldb.so ln -vsf "../../${liblldb}" %{buildroot}%{python_sitearch}/_lldb.so # Remove bundled six.py. -rm -f %{buildroot}%{py_sitedir}/six.* +rm -f %{buildroot}%{python_sitearch}/six.* # Remove static libraries. rm %{buildroot}%{_libdir}/liblldb*.a @@ -115,23 +139,41 @@ rm %{buildroot}%{_libdir}/liblldb*.a # Fix duplicated files. %fdupes %{_includedir}/%{name}/Host/ -%post -n liblldb3_8 -p /sbin/ldconfig -%postun -n liblldb3_8 -p /sbin/ldconfig +mkdir -p %{buildroot}%{_libdir}/cmake/lldb/ +cp cmake/modules/*.cmake %{buildroot}%{_libdir}/cmake/lldb/ + +# Make consistent with the rest of the executables +mv %{buildroot}%{_bindir}/lldb-argdumper %{buildroot}%{_bindir}/lldb-argdumper-%{version} +ln -s %{_bindir}/lldb-argdumper-%{version} %{buildroot}%{_bindir}/lldb-argdumper + +%post -n liblldb%{_sonum} -p /sbin/ldconfig +%postun -n liblldb%{_sonum} -p /sbin/ldconfig %files %defattr(-,root,root,-) -%{_bindir}/lldb* -%{py_sitedir}/_lldb.so -%{py_sitedir}/lldb -%{py_sitedir}/readline.so +%{_bindir}/lldb +%{_bindir}/lldb-argdumper +%{_bindir}/lldb-mi +%{_bindir}/lldb-server +%{_bindir}/lldb-%{version} +%{_bindir}/lldb-argdumper-%{version} +%{_bindir}/lldb-mi-%{version} +%{_bindir}/lldb-server-%{version} -%files -n liblldb3_8 +%files -n python-lldb +%defattr(-,root,root) +%{python_sitearch}/_lldb.so +%{python_sitearch}/lldb/ +%{python_sitearch}/readline.so + +%files -n liblldb%{_sonum} %defattr(-,root,root) %{_libdir}/liblldb.so.* %files devel %defattr(-,root,root,-) -%{_includedir}/lldb +%{_libdir}/cmake/lldb/ +%{_includedir}/lldb/ %{_libdir}/liblldb.so %changelog diff --git a/llvm-3.8.0.src.tar.xz b/llvm-3.8.0.src.tar.xz deleted file mode 100644 index d0c45ad..0000000 --- a/llvm-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:555b028e9ee0f6445ff8f949ea10e9cd8be0d084840e21fbbe1d31d51fc06e46 -size 16580932 diff --git a/llvm-3.8.1.src.tar.xz b/llvm-3.8.1.src.tar.xz new file mode 100644 index 0000000..ea82f9b --- /dev/null +++ b/llvm-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9 +size 16551472 diff --git a/llvm-docs-3.8.0.src.tar.xz b/llvm-docs-3.8.0.src.tar.xz deleted file mode 100644 index 1ea1692..0000000 --- a/llvm-docs-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:465e749bb89b96e50d0a03f1b7e84f25ed81a9e325664b1c5843580adfc94248 -size 1605660 diff --git a/llvm-docs-3.8.1.src.tar.xz b/llvm-docs-3.8.1.src.tar.xz new file mode 100644 index 0000000..1f91674 --- /dev/null +++ b/llvm-docs-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d7d51c4bc0946e3392fe1c71c0afe1be6b120f4423a1c10f3b1210f10853119 +size 1664880 diff --git a/llvm-fix-find-gcc5-install.patch b/llvm-fix-find-gcc5-install.patch index 296a7e4..58779c2 100644 --- a/llvm-fix-find-gcc5-install.patch +++ b/llvm-fix-find-gcc5-install.patch @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Driver/ToolChains.cpp +Index: cfe-3.8.1.src/lib/Driver/ToolChains.cpp =================================================================== ---- cfe-3.8.0.src/lib/Driver/ToolChains.cpp -+++ cfe-3.8.0.src/lib/Driver/ToolChains.cpp +--- cfe-3.8.1.src/lib/Driver/ToolChains.cpp ++++ cfe-3.8.1.src/lib/Driver/ToolChains.cpp @@ -1091,7 +1091,8 @@ Generic_GCC::GCCVersion Linux::GCCVersio if (First.first.getAsInteger(10, GoodVersion.Major) || GoodVersion.Major < 0) return BadVersion; diff --git a/llvm-nonvoid-return.patch b/llvm-nonvoid-return.patch index a140bc4..79ce43d 100644 --- a/llvm-nonvoid-return.patch +++ b/llvm-nonvoid-return.patch @@ -1,7 +1,7 @@ -Index: llvm-3.8.0.src/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp +Index: llvm-3.8.1.src/openmp-3.8.1.src/runtime/src/kmp_dispatch.cpp =================================================================== ---- llvm-3.8.0.src.orig/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp -+++ llvm-3.8.0.src/openmp-3.8.0.src/runtime/src/kmp_dispatch.cpp +--- llvm-3.8.1.src.orig/openmp-3.8.1.src/runtime/src/kmp_dispatch.cpp ++++ llvm-3.8.1.src/openmp-3.8.1.src/runtime/src/kmp_dispatch.cpp @@ -254,7 +254,7 @@ test_then_inc< kmp_int64 >( volatile kmp // compare_and_swap template (general template should NOT be used) template< typename T > diff --git a/llvm-remove-clang-only-flags.patch b/llvm-remove-clang-only-flags.patch index 65bae6b..2759173 100644 --- a/llvm-remove-clang-only-flags.patch +++ b/llvm-remove-clang-only-flags.patch @@ -1,7 +1,7 @@ -Index: llvm-3.8.0.src/cmake/modules/HandleLLVMOptions.cmake +Index: llvm-3.8.1.src/cmake/modules/HandleLLVMOptions.cmake =================================================================== ---- llvm-3.8.0.src.orig/cmake/modules/HandleLLVMOptions.cmake -+++ llvm-3.8.0.src/cmake/modules/HandleLLVMOptions.cmake +--- llvm-3.8.1.src.orig/cmake/modules/HandleLLVMOptions.cmake ++++ llvm-3.8.1.src/cmake/modules/HandleLLVMOptions.cmake @@ -417,7 +417,6 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE append_if(LLVM_ENABLE_PEDANTIC "-pedantic" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) diff --git a/llvm-rpmlintrc b/llvm-rpmlintrc index 4162323..5d34887 100644 --- a/llvm-rpmlintrc +++ b/llvm-rpmlintrc @@ -7,4 +7,3 @@ addFilter("devel-file-in-non-devel-package .*/usr/include/.*") addFilter("devel-file-in-non-devel-package .*/lib.*/*.a") addFilter("devel-file-in-non-devel-package .*/lib.*/*.so") -addFilter("llvm-clang.*shlib-policy-name-error") diff --git a/llvm.changes b/llvm.changes index 45235e8..b752aba 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,47 @@ +------------------------------------------------------------------- +Thu Aug 31 20:36:58 UTC 2016 - toddrme2178@gmail.com + +- Update to llvm 3.8.1 + * See http://llvm.org/releases/3.8.1/docs/ReleaseNotes.html and + http://llvm.org/releases/3.8.1/tools/docs/ReleaseNotes.html +- Use versioned libLLVM (to libLLVM3_8) and libclang (to libclang3_8) +- Change versioning of liblldb3_8 to liblldb-3_8 and use a variable + to control the name instead of hard-coding it. +- Use bcond_with and bcond_without to enable/disable build options + instead of hard-coding them. +- Put buildrequires as requires in -devel packages to avoid linker errors + when building packages against the -devel packages. +- Add ffi support (disabled by default). +- Add oprofile support (disabled by default). +- Add valgrind support (disabled by default). +- Link cmake files to the normal cmake file directory to allow autodetection + of cmake interfaces. +- Remove unused lldb components from main spec file. +- Split llvm python bindings into own subpackage. +- Split emacs plugin into own subpackage +- Move additional vim plugins into vim plugins package +- Split libc++, libLTO, LLVMgold, libomp, clang-chekers into own subpackages +- Make python-clang, llvm-vim-plugins, and llvm-emacs-plugins noarch since + they aren't architecture-specific. +- Make packages besides llvm, llvm-clang, and the shared libraries conflict + with other versions. This will be important when multiple LLVM versions + are supported. +- Various spec file cleanups +- Rebase patches: + * arm_suse_support.diff + * assume-opensuse.patch + * clang-resourcedirs.patch + * default-to-i586.patch + * glibc-2.23-libcxx.patch + * glibc-2.24-libcxx.patch + * lldb-add-pthread-dl-libs.patch + * lldb-cmake.patch + * llvm-fix-find-gcc5-install.patch + * llvm-nonvoid-return.patch + * llvm-remove-clang-only-flags.patch + * revert-cmake-soname.patch + * set-revision.patch + ------------------------------------------------------------------- Fri Aug 26 10:03:56 UTC 2016 - tchvatal@suse.com diff --git a/llvm.spec b/llvm.spec index 1c510ca..c146529 100644 --- a/llvm.spec +++ b/llvm.spec @@ -16,50 +16,53 @@ # -%define _revision 262553 -%define _release_version 3.8.0 +# Change this to 0 if this is not the latest version of LLVM +%define _latest 1 -%define build_lldb 0 -%define build_libcxx 0 -%define build_openmp 0 +%bcond_with ffi +%bcond_with oprofile +%bcond_with valgrind -%ifarch x86_64 -%define build_libcxx 1 -%define build_lldb 0 -%endif +%if !0%{?is_opensuse} || !0%{_latest} +%bcond_with libcxx +%bcond_with openmp +%else -%ifarch ppc64 ppc64le %{ix86} x86_64 -%define build_openmp 1 -%endif + %ifarch x86_64 +%bcond_without libcxx + %else +%bcond_with libcxx + %endif -%if !0%{?is_opensuse} -%define build_libcxx 0 -%define build_lldb 0 -%define build_openmp 0 + %ifarch ppc64 ppc64le %{ix86} x86_64 +%bcond_without openmp + %else +%bcond_with openmp + %endif %endif Name: llvm -Version: 3.8.0 +Version: 3.8.1 Release: 0 +%define _relver 3.8.1 +%define _minor 3.8 +%define _sonum 3_8 +%define _socxx 1 +%define _revsn 273405 Summary: Low Level Virtual Machine License: NCSA Group: Development/Languages/Other Url: http://www.llvm.org Source0: http://llvm.org/releases/%{version}/llvm-%{version}.src.tar.xz Source1: http://llvm.org/releases/%{version}/cfe-%{version}.src.tar.xz -Source2: http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.xz -Source3: http://llvm.org/releases/%{version}/libcxx-%{version}.src.tar.xz -Source4: http://llvm.org/releases/%{version}/libcxxabi-%{version}.src.tar.xz -Source5: http://llvm.org/releases/%{version}/openmp-%{version}.src.tar.xz -# Manually created docs -# cd docs -# make -f Makefile.sphinx man html -# cd .. -# tar cvJf llvm-docs-3.8.0.src.tar.xz llvm-3.8.0.src/docs/_build/{man,html} -Source6: llvm-docs-%{version}.src.tar.xz -Source7: cfe-docs-%{version}.src.tar.xz -Source8: http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.tar.xz -Source9: http://llvm.org/releases/%{version}/lldb-%{version}.src.tar.xz +Source2: http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.tar.xz +Source3: http://llvm.org/releases/%{version}/compiler-rt-%{version}.src.tar.xz +Source4: http://llvm.org/releases/%{version}/libcxx-%{version}.src.tar.xz +Source5: http://llvm.org/releases/%{version}/libcxxabi-%{version}.src.tar.xz +Source6: http://llvm.org/releases/%{version}/openmp-%{version}.src.tar.xz +# Docs are created manually, see below +Source50: llvm-docs-%{version}.src.tar.xz +Source51: cfe-docs-%{version}.src.tar.xz Source100: %{name}-rpmlintrc Source101: baselibs.conf # PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Allow us to set revision @@ -74,10 +77,9 @@ Patch5: clang-resourcedirs.patch Patch6: llvm-remove-clang-only-flags.patch Patch7: llvm-fix-find-gcc5-install.patch Patch8: revert-cmake-soname.patch -Patch9: lldb-cmake.patch -Patch10: glibc-2.23-libcxx.patch -Patch11: glibc-2.24-libcxx.patch -Patch12: llvm-nonvoid-return.patch +Patch9: llvm-nonvoid-return.patch +Patch20: glibc-2.23-libcxx.patch +Patch21: glibc-2.24-libcxx.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: binutils-devel >= 2.21.90 BuildRequires: bison @@ -87,7 +89,6 @@ BuildRequires: flex BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: groff -BuildRequires: libedit-devel BuildRequires: libstdc++-devel BuildRequires: libtool BuildRequires: ncurses-devel @@ -95,6 +96,18 @@ BuildRequires: ninja BuildRequires: procps BuildRequires: python-base BuildRequires: python-xml +BuildRequires: pkgconfig(libedit) +%if %{with ffi} +BuildRequires: pkgconfig(libffi) +%endif +%if %{with valgrind} +BuildRequires: pkgconfig(valgrind) +%endif +%if %{with oprofile} +BuildRequires: oprofile-devel +%endif +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} # llvm does not work on ppc or s390 ExcludeArch: ppc s390 @@ -106,82 +119,230 @@ arbitrary programming languages. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. -%package -n libLLVM + +%package -n libLLVM%{_sonum} Summary: Libraries for LLVM Group: Development/Libraries/C and C++ -%description -n libLLVM +%description -n libLLVM%{_sonum} This package contains the shared libraries needed for LLVM. + %package devel Summary: Header Files for LLVM Group: Development/Languages/Other +Conflicts: otherproviders(cmake(LLVM)) Requires: %{name} = %{version} +Requires: binutils-devel >= 2.21.90 +Requires: bison +Requires: cmake +Requires: flex +Requires: groff +Requires: libstdc++-devel +Requires: libtool +Requires: ncurses-devel +Requires: pkgconfig(libedit) +%if %{with ffi} +Requires: pkgconfig(libffi) +%endif +%if %{with valgrind} +Requires: pkgconfig(valgrind) +%endif +%if %{with oprofile} +Requires: oprofile-devel +%endif %description devel This package contains library and header files needed to develop new native programs that use the LLVM infrastructure. + %package clang Summary: CLANG frontend for LLVM Group: Development/Languages/Other -Requires: libstdc++-devel +Recommends: scan-build +Recommends: scan-view +Recommends: LLVMgold.so()(64bit) +%if %{with openmp} && %{_latest} +Recommends: libomp +%endif +# Avoid multiple provider errors +Requires: libLTO%{_sonum} +Requires: libc++%{_socxx} +Requires: libclang%{_sonum} %description clang This package contains the clang (C language) frontend for LLVM. -%package -n libclang + +%package clang-checker +Summary: Static code analyzer for CLANG +Group: Development/Languages/Other +Provides: scan-build +Provides: scan-view +Conflicts: otherproviders(scan-build) +Conflicts: otherproviders(scan-view) +# Avoid multiple provider errors +Requires: libclang%{_sonum} + +%description clang-checker +This package contains scan-build and scan-view, command line +static code analyzers for CLANG. + + +%package -n libclang%{_sonum} Summary: Library files needed for clang Group: Development/Libraries/C and C++ +Requires: libstdc++-devel +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} -%description -n libclang +%description -n libclang%{_sonum} This package contains the shared libraries needed for clang. + %package clang-devel Summary: CLANG frontend for LLVM (devel package) Group: Development/Languages/Other +Conflicts: otherproviders(cmake(Clang)) Requires: llvm-clang = %{version} -Requires: llvm-devel = %{version} +Requires: cmake(LLVM) = %{version} %description clang-devel This package contains the clang (C language) frontend for LLVM. (development files) + +%package -n libLTO%{_sonum} +Summary: Link-time optimizer for LLVM +Group: Development/Languages/Other +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} + +%description -n libLTO%{_sonum} +This package contains the link-time optimizer for LLVM. + + +%package LTO-devel +Summary: Link-time optimizer for LLVM (devel package) +Group: Development/Languages/Other +Provides: libLTO.so +Conflicts: otherproviders(libLTO.so) +Requires: cmake(LLVM) = %{version} +# Avoid multiple provider errors +Requires: libLTO%{_sonum} + +%description LTO-devel +This package contains the link-time optimizer for LLVM. +(development files) + + +%package gold +Summary: Gold linker plugin for LLVM +Group: Development/Languages/Other +Provides: LLVMgold.so()(64bit) +Conflicts: otherproviders(LLVMgold.so()(64bit)) +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} +Requires: cmake(LLVM) = %{version} + +%description gold +This package contains the Gold linker plugin for LLVM. + + +%package -n libomp +Summary: MPI plugin for LLVM +Group: Development/Languages/Other +Provides: libomp.so()(64bit) +Conflicts: otherproviders(libomp.so()(64bit)) +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} + +%description -n libomp +This package contains the OpenMP MPI plugin for LLVM. + + +%package -n libc++%{_socxx} +Summary: C++ standard library implementation +Group: Development/Libraries/C and C++ + +%description -n libc++%{_socxx} +This package contains libc++, a new implementation of the C++ +standard library, targeting C++11. + + +%package libc++-devel +Summary: C++ standard library implementation (devel package) +Group: Development/Languages/C and C++ +Provides: libc++.so +Conflicts: otherproviders(libc++.so) + +%description libc++-devel +This package contains libc++, a new implementation of the C++ +standard library, targeting C++11. (development files) + + +%package -n libc++abi%{_socxx} +Summary: C++ standard library ABI +Group: Development/Libraries/C and C++ + +%description -n libc++abi%{_socxx} +This package contains the ABI for libc++, a new implementation +of the C++ standard library, targeting C++11. + + +%package libc++abi-devel +Summary: C++ standard library ABI (devel package) +Group: Development/Languages/C and C++ +Provides: libc++abi.so +Conflicts: otherproviders(libc++abi.so) +# Avoid multiple provider errors +Requires: %{name}-libc++-devel + +%description libc++abi-devel +This package contains the ABI for libc++, a new implementation +of the C++ standard library, targeting C++11. +(development files) + + %package vim-plugins Summary: Vim plugins for LLVM Group: Productivity/Text/Editors +Provides: vim-plugin-llvm +Conflicts: otherproviders(vim-plugin-llvm) Requires: vim +BuildArch: noarch %description vim-plugins This package contains vim plugins for LLVM like syntax highlighting. + +%package emacs-plugins +Summary: Emacs plugins for LLVM +Group: Productivity/Text/Editors +Provides: emacs-llvm +Conflicts: otherproviders(emacs-llvm) +Requires: emacs +BuildArch: noarch + +%description emacs-plugins +This package contains Emacs plugins for LLVM like syntax highlighting. + + %package -n python-clang -Summary: Python bindings for libclang +Summary: Python 2 bindings for libclang Group: Development/Languages/Python -Requires: libclang = %{version} +Requires: %{name}-clang-devel = %{version} Requires: python +BuildArch: noarch %description -n python-clang -This package contains the Python bindings to clang (C language) frontend for LLVM. +This package contains the Python 2.x bindings to clang (C language) +frontend for LLVM. -%if %{build_lldb} -%package -n lldb -Summary: Next generation high-performance debugger -Group: Development/Languages -# We don't want to provide an unstable lldb-devel package now. -# Reconsider later when it has a stable API. -Provides: lldb-devel = %{version} -Obsoletes: lldb-devel < %{version} - -%description -n lldb -LLDB is a next generation, high-performance debugger. It is built as a set -of reusable components which highly leverage existing libraries in the -larger LLVM Project, such as the Clang expression parser and LLVM -disassembler. -%endif %prep -%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 7 -a 8 -a 9 -b 6 -n %{name}-%{version}.src +%setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -b 50 -a 51 -n llvm-%{version}.src %patch1 %patch2 %patch3 @@ -190,23 +351,22 @@ disassembler. %patch6 -p1 %patch7 %patch8 -p1 -%patch9 +%patch9 -p1 %if 0%{?suse_version} > 1320 -%patch10 -%patch11 +%patch20 +%patch21 %endif -%patch12 -p1 # Move into right place mv cfe-%{version}.src tools/clang mv compiler-rt-%{version}.src projects/compiler-rt mv clang-tools-extra-%{version}.src tools/clang/tools/extra -%if %{build_openmp} +%if %{with openmp} mv openmp-%{version}.src projects/openmp %endif -%if %{build_libcxx} +%if %{with libcxx} mv libcxx-%{version}.src projects/libcxx mv libcxxabi-%{version}.src projects/libcxxabi @@ -214,20 +374,12 @@ rm projects/libcxx/test/std/localization/locale.categories/category.time/locale. rm projects/libcxx/test/std/localization/locale.categories/category.time/locale.time.get.byname/get_monthname_wide.pass.cpp %endif -%if %{build_lldb} -mv lldb-%{version}.src tools/lldb -%endif - # We hardcode i586 rm tools/clang/test/Driver/x86_features.c rm tools/clang/test/Driver/nacl-direct.c -sed -i s,SVN_REVISION,\"%{_revision}\",g tools/clang/lib/Basic/Version.cpp -sed -i s,LLVM_REVISION,\"%{_revision}\",g tools/clang/lib/Basic/Version.cpp - -%if %{build_lldb} -sed -i s,LLDB_REVISION,\"%{_revision}\",g tools/lldb/source/lldb.cpp -%endif +sed -i s,SVN_REVISION,\"%{_revsn}\",g tools/clang/lib/Basic/Version.cpp +sed -i s,LLVM_REVISION,\"%{_revsn}\",g tools/clang/lib/Basic/Version.cpp # ARMv6 needs this exact host triple %ifarch armv6hl @@ -238,8 +390,8 @@ EOF %endif %build -# Disable c/xx/flags as the clang fails to build with hardening right now -#flags="%{optflags} -fno-strict-aliasing" +# Disable c/xx/flags as the clang fails to build with hardening right now +#flags="%%{optflags} -fno-strict-aliasing" flags="-fno-strict-aliasing" %ifarch armv6hl flags+=" -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" @@ -247,6 +399,12 @@ flags+=" -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp" %ifarch armv7hl flags+=" -mfloat-abi=hard -march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16" %endif +%ifarch %{ix86} x86_64 +TARGETS_TO_BUILD="all" +%else +TARGETS_TO_BUILD=host +%endif + # do not eat all memory ninjaproc="%{?jobs:%{jobs}}" echo "Available memory:" @@ -289,68 +447,65 @@ export CXX=${PWD}/stage1/bin/clang++ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PIC=ON \ -DLLVM_BINUTILS_INCDIR=/usr/include \ -%ifarch %{ix86} x86_64 - -DLLVM_TARGETS_TO_BUILD="all" \ -%else - -DLLVM_TARGETS_TO_BUILD=host \ -%endif + -DLLVM_TARGETS_TO_BUILD=${TARGETS_TO_BUILD} \ %if "%{_lib}" == "lib64" -DLLVM_LIBDIR_SUFFIX=64 \ %endif -%if %{build_lldb} - -DLLDB_DISABLE_PYTHON=ON \ +%if %{with ffi} + -DLLVM_ENABLE_FFI=ON \ +%endif +%if %{with oprofile} + -DLLVM_USE_OPROFILE=ON \ %endif -DCMAKE_SKIP_RPATH:BOOL=OFF \ -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed" \ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" ninja -v -j $ninjaproc - -%check -cd build -%ifnarch armv7hl armv7l -%if 0%{!?qemu_user_space_build:1} -# we just do not have enough memory with qemu emulation - -ninja -v %{?_smp_mflags} check -ninja -v %{?_smp_mflags} clang-test - -%if %{build_libcxx} -ninja -v %{?_smp_mflags} check-libcxx -ninja -v %{?_smp_mflags} check-libcxxabi -%endif - -%endif -%endif +cd .. %install %cmake_install -# Build man/html pages -cd docs -# Docs are prebuilt due to sphinx dependency -#make -f Makefile.sphinx html man -rm -rf %{buildroot}/usr/docs +# Docs are prebuilt due to sphinx dependency +# +# pushd llvm-3.8.1.src/docs +# make -f Makefile.sphinx man html +# popd +# pushd cfe-3.8.1.src/docs +# make -f Makefile.sphinx man html +# popd +# tar cvJf llvm-docs-3.8.1.src.tar.xz llvm-3.8.1.src/docs/_build/{man,html} +# tar cvJf cfe-docs-3.8.1.src.tar.xz cfe-3.8.1.src/docs/_build/{man,html} + +# Build man/html pages +pushd docs +rm -rf %{buildroot}/usr/docs mkdir -p %{buildroot}%{_docdir}/llvm/html mkdir -p %{buildroot}/usr/share/man/man1 cp -r _build/man/* %{buildroot}/usr/share/man/man1 cp -r _build/html/* %{buildroot}%{_docdir}/llvm/html +popd -cd ../tools/clang/docs +pushd tools/clang/docs mkdir -p %{buildroot}%{_docdir}/llvm-clang/html cp -r _build/man/* %{buildroot}/usr/share/man/man1 cp -r _build/html/* %{buildroot}%{_docdir}/llvm-clang/html -cd ../../.. +popd # install python bindings -install -d %{buildroot}%{py_sitedir}/clang +# The python bindings use the unversioned libclang.so, +# so it doesn't make sense to have multiple versions of it +%if %{_latest} +install -d %{buildroot}%{python_sitelib}/clang pushd tools/clang/bindings/python -cp clang/*.py %{buildroot}%{py_sitedir}/clang +cp clang/*.py %{buildroot}%{python_sitelib}/clang install -d %{buildroot}%{_docdir}/python-clang/examples/cindex cp -r examples %{buildroot}%{_docdir}/python-clang install -d %{buildroot}%{_docdir}/python-clang/tests/cindex/INPUTS cp -r tests %{buildroot}%{_docdir}/python-clang popd +%endif mkdir -p %{buildroot}%{_libdir}/bfd-plugins ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ @@ -362,40 +517,102 @@ done mv utils/vim/README utils/vim/README.vim mv %{buildroot}%{_prefix}/libexec/{c++,ccc}-analyzer %{buildroot}%{_bindir} +mv %{buildroot}%{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff +mv %{buildroot}%{_datadir}/clang/clang-tidy-diff.py %{buildroot}%{_bindir}/clang-tidy-diff +mv %{buildroot}%{_datadir}/clang/run-clang-tidy.py %{buildroot}%{_bindir}/run-clang-tidy chmod -x %{buildroot}%{_mandir}/man1/scan-build.1 # Stuff we don't want to include rm %{buildroot}%{_mandir}/man1/lit.1 -%if %{build_openmp} +# Put cmake files where they can be detected +mkdir -p %{buildroot}%{_libdir}/cmake/llvm/ +pushd %{buildroot}%{_datadir}/llvm/cmake/ +for f in * ; do +ln -s %{_datadir}/llvm/cmake/$f %{buildroot}%{_libdir}/cmake/llvm/$f +done +# This confuses the rpm cmake provides detection +rm %{buildroot}%{_libdir}/cmake/llvm/LLVM-Config.cmake + +mkdir -p %{buildroot}%{_libdir}/cmake/clang/ +pushd %{buildroot}%{_datadir}/clang/cmake/ +for f in * ; do +ln -s %{_datadir}/clang/cmake/$f %{buildroot}%{_libdir}/cmake/clang/$f +done + +%if %{with libcxx} +rm %{buildroot}%{_libdir}/libc++abi.a +%endif + +%if %{with openmp} rm %{buildroot}%{_libdir}/libgomp.so rm %{buildroot}%{_libdir}/libiomp*.so %endif -%if %{build_lldb} -rm %{buildroot}%{_libdir}/liblldb*.a -rm %{buildroot}%{_libdir}/liblldb.so -rm -r %{buildroot}%{_includedir}/lldb -%endif +# We don't care about applescript or sublime text +rm %{buildroot}%{_datadir}/clang/*.applescript +rm %{buildroot}%{_datadir}/clang/clang-format-sublime.py %fdupes -s %{buildroot}%{_docdir}/%{name} %fdupes -s %{buildroot}%{_docdir}/%{name}-doc -%post -n libLLVM -p /sbin/ldconfig -%postun -n libLLVM -p /sbin/ldconfig -%post clang -p /sbin/ldconfig -%postun clang -p /sbin/ldconfig +%check +cd build +%ifnarch armv7hl armv7l +%if !0%{?qemu_user_space_build:1} +# we just do not have enough memory with qemu emulation -%post -n libclang -p /sbin/ldconfig -%postun -n libclang -p /sbin/ldconfig +ninja -v %{?_smp_mflags} check +ninja -v %{?_smp_mflags} clang-test + +%if %{with libcxx} +ninja -v %{?_smp_mflags} check-libcxx +ninja -v %{?_smp_mflags} check-libcxxabi +%endif + +%endif +%endif + + +%post -n libLLVM%{_sonum} -p /sbin/ldconfig +%postun -n libLLVM%{_sonum} -p /sbin/ldconfig + +%post -n libclang%{_sonum} -p /sbin/ldconfig +%postun -n libclang%{_sonum} -p /sbin/ldconfig + +%post -n libLTO%{_sonum} -p /sbin/ldconfig +%postun -n libLTO%{_sonum} -p /sbin/ldconfig + +%post gold -p /sbin/ldconfig +%postun gold -p /sbin/ldconfig + +%post devel -p /sbin/ldconfig +%postun devel -p /sbin/ldconfig %post clang-devel -p /sbin/ldconfig %postun clang-devel -p /sbin/ldconfig -%if %{build_lldb} -%post -n lldb -p /sbin/ldconfig -%postun -n lldb -p /sbin/ldconfig +%post LTO-devel -p /sbin/ldconfig +%postun LTO-devel -p /sbin/ldconfig + +%if %{with openmp} +%post -n libomp -p /sbin/ldconfig +%postun -n libomp -p /sbin/ldconfig +%endif + +%if %{with libcxx} +%post -n libc++%{_socxx} -p /sbin/ldconfig +%postun -n libc++%{_socxx} -p /sbin/ldconfig + +%post -n libc++abi%{_socxx} -p /sbin/ldconfig +%postun -n libc++abi%{_socxx} -p /sbin/ldconfig + +%post libc++-devel -p /sbin/ldconfig +%postun libc++-devel -p /sbin/ldconfig + +%post libc++abi-devel -p /sbin/ldconfig +%postun libc++abi-devel -p /sbin/ldconfig %endif %files @@ -403,25 +620,21 @@ rm -r %{buildroot}%{_includedir}/lldb %{_bindir}/bugpoint %{_bindir}/llc %{_bindir}/lli -%exclude %{_bindir}/llvm-config -%{_bindir}/llvm* +%{_bindir}/llvm-* %{_bindir}/obj2yaml %{_bindir}/opt %{_bindir}/sancov %{_bindir}/verify-uselistorder %{_bindir}/yaml2obj -%exclude %{_mandir}/man1/llvm-config.1%{ext_man} +%{_mandir}/man1/FileCheck.1%{ext_man} %{_mandir}/man1/bugpoint.1%{ext_man} -%{_mandir}/man1/tblgen.1%{ext_man} %{_mandir}/man1/llc.1%{ext_man} %{_mandir}/man1/lli.1%{ext_man} -%{_mandir}/man1/llvm*.1%{ext_man} -%{_mandir}/man1/FileCheck.1%{ext_man} +%{_mandir}/man1/llvm-*.1%{ext_man} %{_mandir}/man1/opt.1%{ext_man} - -%files -n libLLVM -%defattr(-,root,root,-) -%{_libdir}/libLLVM*.so.* +%{_mandir}/man1/tblgen.1%{ext_man} +%exclude %{_bindir}/llvm-config +%exclude %{_mandir}/man1/llvm-config.1%{ext_man} %files clang %defattr(-,root,root) @@ -431,41 +644,64 @@ rm -r %{buildroot}%{_includedir}/lldb %{_bindir}/clang %{_bindir}/clang-* %{_bindir}/clang++ -%{_bindir}/clang-format %{_bindir}/git-clang-format %{_bindir}/modularize +%{_bindir}/run-clang-tidy +%{_mandir}/man1/clang.1%{ext_man} +%dir %{_libdir}/clang/ +%{_libdir}/clang/%{_relver}/ + +%files clang-checker +%defattr(-,root,root) %{_bindir}/scan-build %{_bindir}/scan-view -%{_datadir}/clang -%{_datadir}/scan-build -%{_datadir}/scan-view -%{_mandir}/man1/clang.1%{ext_man} +%{_datadir}/scan-build/ +%{_datadir}/scan-view/ %{_mandir}/man1/scan-build.1%{ext_man} -%{_libdir}/libLTO.* -%if %{build_openmp} -%{_libdir}/libomp.so -%endif -%if %{build_libcxx} -%{_libdir}/libc++* -%{_includedir}/c++/* -%endif -%{_libdir}/LLVMgold.so -%{_libdir}/bfd-plugins/ -%{_libdir}/clang -%ifnarch s390x -%{_libdir}/clang/%{_release_version}/lib/linux/ -%endif -%files -n libclang +%files -n libLLVM%{_sonum} +%defattr(-,root,root,-) +%{_libdir}/libLLVM*.so.* + +%files -n libclang%{_sonum} %defattr(-,root,root,-) %{_libdir}/libclang*.so.* -%files clang-devel +%files -n libLTO%{_sonum} %defattr(-,root,root) -%{_libdir}/libclang*.so -%{_includedir}/clang -%{_includedir}/clang-c -%doc %{_docdir}/llvm-clang +%{_libdir}/libLTO.so.* + +%files gold +%defattr(-,root,root) +%{_libdir}/LLVMgold.so +%dir %{_libdir}/bfd-plugins/ +%{_libdir}/bfd-plugins/LLVMgold.so + +%if %{with openmp} +%files -n libomp +%defattr(-,root,root) +%{_libdir}/libomp.so +%endif + +%if %{with libcxx} +%files -n libc++%{_socxx} +%defattr(-,root,root) +%{_libdir}/libc++.so.* + +%files -n libc++abi%{_socxx} +%defattr(-,root,root) +%{_libdir}/libc++abi.so.* + +%files libc++-devel +%defattr(-,root,root) +%{_libdir}/libc++.so +%{_libdir}/libc++abi.so +%{_includedir}/c++/ + +%files libc++abi-devel +%defattr(-,root,root) +%{_libdir}/libc++abi.so +%endif %files devel %defattr(-,root,root,-) @@ -473,31 +709,50 @@ rm -r %{buildroot}%{_includedir}/lldb %{_libdir}/libLLVM*.so %{_libdir}/BugpointPasses.* %{_libdir}/LLVMHello.* -%doc %{_mandir}/man1/llvm-config.1%{ext_man} %{_includedir}/llvm/ %{_includedir}/llvm-c/ -%dir %{_datadir}/llvm -%{_datadir}/llvm/cmake/ -%doc %{_docdir}/llvm +%dir %{_datadir}/llvm/ +%{_datadir}/llvm/cmake +%{_libdir}/cmake/llvm +%{_docdir}/llvm/ +%{_mandir}/man1/llvm-config.1%{ext_man} + +%files clang-devel +%defattr(-,root,root) +%{_libdir}/libclang*.so +%{_includedir}/clang/ +%{_includedir}/clang-c/ +%dir %{_datadir}/clang/ +%{_datadir}/clang/cmake +%{_libdir}/cmake/clang +%{_docdir}/llvm-clang/ + +%files LTO-devel +%defattr(-,root,root) +%{_libdir}/libLTO.so + +%files emacs-plugins +%defattr(-,root,root,-) +%dir %{_datadir}/clang/ +%{_datadir}/clang/clang-format.el %files vim-plugins %defattr(-,root,root,-) %doc utils/vim/README.vim %{_datadir}/vim/ +%dir %{_datadir}/clang/ +%{_datadir}/clang/clang-format.py +# The python bindings use the unversioned libclang.so, +# so it doesn't make sense to have multiple versions of it +%if %{_latest} %files -n python-clang %defattr(-,root,root) -%{py_sitedir}/clang -%{py_sitedir}/clang/__init__.py -%{py_sitedir}/clang/cindex.py -%{py_sitedir}/clang/enumerations.py -%doc %{_docdir}/python-clang - -%if %{build_lldb} -%files -n lldb -%defattr(-,root,root,-) -%{_libdir}/liblldb.so.* -%{_bindir}/lldb* +%{python_sitelib}/clang/ +%{python_sitelib}/clang/__init__.py +%{python_sitelib}/clang/cindex.py +%{python_sitelib}/clang/enumerations.py +%{_docdir}/python-clang/ %endif %changelog diff --git a/openmp-3.8.0.src.tar.xz b/openmp-3.8.0.src.tar.xz deleted file mode 100644 index 5773595..0000000 --- a/openmp-3.8.0.src.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:92510e3f62e3de955e3a0b6708cebee1ca344d92fb02369cba5fdd5c68f773a0 -size 2233144 diff --git a/openmp-3.8.1.src.tar.xz b/openmp-3.8.1.src.tar.xz new file mode 100644 index 0000000..3a11ae7 --- /dev/null +++ b/openmp-3.8.1.src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68fcde6ef34e0275884a2de3450a31e931caf1d6fda8606ef14f89c4123617dc +size 2009572 diff --git a/revert-cmake-soname.patch b/revert-cmake-soname.patch index 652e831..2049551 100644 --- a/revert-cmake-soname.patch +++ b/revert-cmake-soname.patch @@ -1,7 +1,7 @@ -Index: llvm-3.8.0.src/cmake/modules/AddLLVM.cmake +Index: llvm-3.8.1.src/cmake/modules/AddLLVM.cmake =================================================================== ---- llvm-3.8.0.src.orig/cmake/modules/AddLLVM.cmake -+++ llvm-3.8.0.src/cmake/modules/AddLLVM.cmake +--- llvm-3.8.1.src.orig/cmake/modules/AddLLVM.cmake ++++ llvm-3.8.1.src/cmake/modules/AddLLVM.cmake @@ -326,12 +326,10 @@ endfunction(set_windows_version_resource # Same semantics as target_link_libraries(). # ADDITIONAL_HEADERS @@ -95,10 +95,10 @@ Index: llvm-3.8.0.src/cmake/modules/AddLLVM.cmake function(llvm_install_symlink name dest) cmake_parse_arguments(ARG "ALWAYS_GENERATE" "" "" ${ARGN}) foreach(path ${CMAKE_MODULE_PATH}) -Index: llvm-3.8.0.src/tools/llvm-shlib/CMakeLists.txt +Index: llvm-3.8.1.src/tools/llvm-shlib/CMakeLists.txt =================================================================== ---- llvm-3.8.0.src.orig/tools/llvm-shlib/CMakeLists.txt -+++ llvm-3.8.0.src/tools/llvm-shlib/CMakeLists.txt +--- llvm-3.8.1.src.orig/tools/llvm-shlib/CMakeLists.txt ++++ llvm-3.8.1.src/tools/llvm-shlib/CMakeLists.txt @@ -38,7 +38,7 @@ if(LLVM_DYLIB_EXPORTED_SYMBOL_FILE) add_custom_target(libLLVMExports DEPENDS ${LLVM_EXPORTED_SYMBOL_FILE}) endif() diff --git a/set-revision.patch b/set-revision.patch index 4712c45..1ddeee4 100644 --- a/set-revision.patch +++ b/set-revision.patch @@ -1,7 +1,7 @@ -Index: cfe-3.8.0.src/lib/Basic/Version.cpp +Index: cfe-3.8.1.src/lib/Basic/Version.cpp =================================================================== ---- cfe-3.8.0.src/lib/Basic/Version.cpp.orig -+++ cfe-3.8.0.src/lib/Basic/Version.cpp +--- cfe-3.8.1.src/lib/Basic/Version.cpp.orig ++++ cfe-3.8.1.src/lib/Basic/Version.cpp @@ -72,19 +72,11 @@ std::string getLLVMRepositoryPath() { } From c7654261d81436b6d0155ad1fcad5ea7fae78e007ac19eed067a797d7cf6de39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 07:52:20 +0000 Subject: [PATCH 03/11] Small cleanup & update constraints OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=468 --- _constraints | 3 +++ llvm.spec | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/_constraints b/_constraints index da741c1..04fb88d 100644 --- a/_constraints +++ b/_constraints @@ -1,6 +1,9 @@ + + 30 + 4000 diff --git a/llvm.spec b/llvm.spec index c146529..3e4e915 100644 --- a/llvm.spec +++ b/llvm.spec @@ -135,7 +135,6 @@ Conflicts: otherproviders(cmake(LLVM)) Requires: %{name} = %{version} Requires: binutils-devel >= 2.21.90 Requires: bison -Requires: cmake Requires: flex Requires: groff Requires: libstdc++-devel @@ -462,7 +461,6 @@ export CXX=${PWD}/stage1/bin/clang++ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" ninja -v -j $ninjaproc -cd .. %install %cmake_install @@ -556,7 +554,6 @@ rm %{buildroot}%{_datadir}/clang/clang-format-sublime.py %fdupes -s %{buildroot}%{_docdir}/%{name} %fdupes -s %{buildroot}%{_docdir}/%{name}-doc - %check cd build %ifnarch armv7hl armv7l @@ -574,7 +571,6 @@ ninja -v %{?_smp_mflags} check-libcxxabi %endif %endif - %post -n libLLVM%{_sonum} -p /sbin/ldconfig %postun -n libLLVM%{_sonum} -p /sbin/ldconfig From c1dc23af674e80e453c9c239ff2685d33fb1020c4e0097a45372e0b8d99244cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 07:53:06 +0000 Subject: [PATCH 04/11] OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=469 --- _constraints | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_constraints b/_constraints index 04fb88d..13a8856 100644 --- a/_constraints +++ b/_constraints @@ -2,7 +2,7 @@ - 30 + 20 4000 From 602347572f94e9b989f53f5cba593683600189f5b23a445226e8769a230b8c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 11:28:21 +0000 Subject: [PATCH 05/11] Accepting request 425227 from home:scarabeus_iv:branches:devel:tools:compiler - Sort out with spec-cleaner - Sort a bit with spec-cleaner - Remove the latest switch for now, things should be either coinstallable or not, we don't need to bother around with compilation like this OBS-URL: https://build.opensuse.org/request/show/425227 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=470 --- lldb.changes | 5 ++ lldb.spec | 13 ++--- llvm.changes | 7 +++ llvm.spec | 153 ++++++++++++++++++--------------------------------- 4 files changed, 72 insertions(+), 106 deletions(-) diff --git a/lldb.changes b/lldb.changes index 7d62665..f4a05be 100644 --- a/lldb.changes +++ b/lldb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 7 10:01:47 UTC 2016 - tchvatal@suse.com + +- Sort out with spec-cleaner + ------------------------------------------------------------------- Thu Aug 31 20:36:58 UTC 2016 - toddrme2178@gmail.com diff --git a/lldb.spec b/lldb.spec index 6b284eb..4256df4 100644 --- a/lldb.spec +++ b/lldb.spec @@ -16,11 +16,11 @@ # +%define _sonum 3_8 +%define _revsn 273405 Name: lldb Version: 3.8.1 Release: 0 -%define _sonum 3_8 -%define _revsn 273405 Summary: Software debugger built using LLVM libraries License: NCSA Group: Development/Tools/Debuggers @@ -36,6 +36,7 @@ BuildRequires: cmake BuildRequires: fdupes BuildRequires: ncurses-devel BuildRequires: ninja +BuildRequires: pkgconfig BuildRequires: swig BuildRequires: cmake(Clang) = %{version} BuildRequires: cmake(LLVM) = %{version} @@ -44,10 +45,10 @@ BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(python2) BuildRequires: pkgconfig(zlib) -Requires: python -Requires: python-six # Avoid multiple provider errors Requires: liblldb%{_sonum} = %{version} +Requires: python +Requires: python-six ExclusiveArch: arm x86_64 %description @@ -56,7 +57,6 @@ of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler. - %package -n liblldb%{_sonum} Summary: LLDB software debugger runtime library Group: System/Libraries @@ -67,7 +67,6 @@ Requires: libclang%{_sonum} = %{version} %description -n liblldb%{_sonum} This subpackage contains the main LLDB component. - %package devel Summary: Development files for LLDB Group: Development/Languages/Other @@ -85,7 +84,6 @@ Requires: pkgconfig(zlib) %description devel This package contains the development files for LLDB. - %package -n python-lldb Summary: Python bindings for liblldb Group: Development/Languages/Python @@ -95,7 +93,6 @@ Requires: python %description -n python-lldb This package contains the Python bindings to clang (C language) frontend for LLVM. - %prep %setup -q -n %{name}-%{version}.src %patch0 -p1 diff --git a/llvm.changes b/llvm.changes index b752aba..b9e08cd 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Sep 7 10:05:32 UTC 2016 - tchvatal@suse.com + +- Sort a bit with spec-cleaner +- Remove the latest switch for now, things should be either coinstallable + or not, we don't need to bother around with compilation like this + ------------------------------------------------------------------- Thu Aug 31 20:36:58 UTC 2016 - toddrme2178@gmail.com diff --git a/llvm.spec b/llvm.spec index 3e4e915..c0e75cd 100644 --- a/llvm.spec +++ b/llvm.spec @@ -16,39 +16,27 @@ # -# Change this to 0 if this is not the latest version of LLVM -%define _latest 1 - -%bcond_with ffi -%bcond_with oprofile -%bcond_with valgrind - -%if !0%{?is_opensuse} || !0%{_latest} -%bcond_with libcxx -%bcond_with openmp -%else - - %ifarch x86_64 -%bcond_without libcxx - %else -%bcond_with libcxx - %endif - - %ifarch ppc64 ppc64le %{ix86} x86_64 -%bcond_without openmp - %else -%bcond_with openmp - %endif -%endif - -Name: llvm -Version: 3.8.1 -Release: 0 %define _relver 3.8.1 %define _minor 3.8 %define _sonum 3_8 %define _socxx 1 %define _revsn 273405 +%ifarch x86_64 +%bcond_without libcxx +%else +%bcond_with libcxx +%endif +%ifarch ppc64 ppc64le %{ix86} x86_64 +%bcond_without openmp +%else +%bcond_with openmp +%endif +%bcond_with ffi +%bcond_with oprofile +%bcond_with valgrind +Name: llvm +Version: 3.8.1 +Release: 0 Summary: Low Level Virtual Machine License: NCSA Group: Development/Languages/Other @@ -80,7 +68,6 @@ Patch8: revert-cmake-soname.patch Patch9: llvm-nonvoid-return.patch Patch20: glibc-2.23-libcxx.patch Patch21: glibc-2.24-libcxx.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: binutils-devel >= 2.21.90 BuildRequires: bison BuildRequires: cmake @@ -93,10 +80,16 @@ BuildRequires: libstdc++-devel BuildRequires: libtool BuildRequires: ncurses-devel BuildRequires: ninja +BuildRequires: pkgconfig BuildRequires: procps BuildRequires: python-base BuildRequires: python-xml BuildRequires: pkgconfig(libedit) +# Avoid multiple provider errors +Requires: libLLVM%{_sonum} +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# llvm does not work on ppc or s390 +ExcludeArch: ppc s390 %if %{with ffi} BuildRequires: pkgconfig(libffi) %endif @@ -106,10 +99,6 @@ BuildRequires: pkgconfig(valgrind) %if %{with oprofile} BuildRequires: oprofile-devel %endif -# Avoid multiple provider errors -Requires: libLLVM%{_sonum} -# llvm does not work on ppc or s390 -ExcludeArch: ppc s390 %description LLVM is a compiler infrastructure designed for compile-time, @@ -119,7 +108,6 @@ arbitrary programming languages. The compiler infrastructure includes mirror sets of programming tools as well as libraries with equivalent functionality. - %package -n libLLVM%{_sonum} Summary: Libraries for LLVM Group: Development/Libraries/C and C++ @@ -127,11 +115,9 @@ Group: Development/Libraries/C and C++ %description -n libLLVM%{_sonum} This package contains the shared libraries needed for LLVM. - %package devel Summary: Header Files for LLVM Group: Development/Languages/Other -Conflicts: otherproviders(cmake(LLVM)) Requires: %{name} = %{version} Requires: binutils-devel >= 2.21.90 Requires: bison @@ -140,7 +126,9 @@ Requires: groff Requires: libstdc++-devel Requires: libtool Requires: ncurses-devel +Requires: pkgconfig Requires: pkgconfig(libedit) +Conflicts: otherproviders(cmake(LLVM)) %if %{with ffi} Requires: pkgconfig(libffi) %endif @@ -155,63 +143,58 @@ Requires: oprofile-devel This package contains library and header files needed to develop new native programs that use the LLVM infrastructure. - %package clang Summary: CLANG frontend for LLVM Group: Development/Languages/Other -Recommends: scan-build -Recommends: scan-view -Recommends: LLVMgold.so()(64bit) -%if %{with openmp} && %{_latest} -Recommends: libomp -%endif # Avoid multiple provider errors Requires: libLTO%{_sonum} Requires: libc++%{_socxx} Requires: libclang%{_sonum} +Recommends: LLVMgold.so()(64bit) +Recommends: scan-build +Recommends: scan-view +%if %{with openmp} +Recommends: libomp +%endif %description clang This package contains the clang (C language) frontend for LLVM. - %package clang-checker Summary: Static code analyzer for CLANG Group: Development/Languages/Other -Provides: scan-build -Provides: scan-view -Conflicts: otherproviders(scan-build) -Conflicts: otherproviders(scan-view) # Avoid multiple provider errors Requires: libclang%{_sonum} +Conflicts: otherproviders(scan-build) +Conflicts: otherproviders(scan-view) +Provides: scan-build +Provides: scan-view %description clang-checker This package contains scan-build and scan-view, command line static code analyzers for CLANG. - %package -n libclang%{_sonum} Summary: Library files needed for clang Group: Development/Libraries/C and C++ -Requires: libstdc++-devel # Avoid multiple provider errors Requires: libLLVM%{_sonum} +Requires: libstdc++-devel %description -n libclang%{_sonum} This package contains the shared libraries needed for clang. - %package clang-devel Summary: CLANG frontend for LLVM (devel package) Group: Development/Languages/Other -Conflicts: otherproviders(cmake(Clang)) Requires: llvm-clang = %{version} Requires: cmake(LLVM) = %{version} +Conflicts: otherproviders(cmake(Clang)) %description clang-devel This package contains the clang (C language) frontend for LLVM. (development files) - %package -n libLTO%{_sonum} Summary: Link-time optimizer for LLVM Group: Development/Languages/Other @@ -221,46 +204,42 @@ Requires: libLLVM%{_sonum} %description -n libLTO%{_sonum} This package contains the link-time optimizer for LLVM. - %package LTO-devel Summary: Link-time optimizer for LLVM (devel package) Group: Development/Languages/Other -Provides: libLTO.so -Conflicts: otherproviders(libLTO.so) -Requires: cmake(LLVM) = %{version} # Avoid multiple provider errors Requires: libLTO%{_sonum} +Requires: cmake(LLVM) = %{version} +Conflicts: otherproviders(libLTO.so) +Provides: libLTO.so %description LTO-devel This package contains the link-time optimizer for LLVM. (development files) - %package gold Summary: Gold linker plugin for LLVM Group: Development/Languages/Other -Provides: LLVMgold.so()(64bit) -Conflicts: otherproviders(LLVMgold.so()(64bit)) # Avoid multiple provider errors Requires: libLLVM%{_sonum} Requires: cmake(LLVM) = %{version} +Conflicts: otherproviders(LLVMgold.so()(64bit)) +Provides: LLVMgold.so()(64bit) %description gold This package contains the Gold linker plugin for LLVM. - %package -n libomp Summary: MPI plugin for LLVM Group: Development/Languages/Other -Provides: libomp.so()(64bit) -Conflicts: otherproviders(libomp.so()(64bit)) # Avoid multiple provider errors Requires: libLLVM%{_sonum} +Conflicts: otherproviders(libomp.so()(64bit)) +Provides: libomp.so()(64bit) %description -n libomp This package contains the OpenMP MPI plugin for LLVM. - %package -n libc++%{_socxx} Summary: C++ standard library implementation Group: Development/Libraries/C and C++ @@ -269,18 +248,16 @@ Group: Development/Libraries/C and C++ This package contains libc++, a new implementation of the C++ standard library, targeting C++11. - %package libc++-devel Summary: C++ standard library implementation (devel package) Group: Development/Languages/C and C++ -Provides: libc++.so Conflicts: otherproviders(libc++.so) +Provides: libc++.so %description libc++-devel This package contains libc++, a new implementation of the C++ standard library, targeting C++11. (development files) - %package -n libc++abi%{_socxx} Summary: C++ standard library ABI Group: Development/Libraries/C and C++ @@ -289,45 +266,41 @@ Group: Development/Libraries/C and C++ This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. - %package libc++abi-devel Summary: C++ standard library ABI (devel package) Group: Development/Languages/C and C++ -Provides: libc++abi.so -Conflicts: otherproviders(libc++abi.so) # Avoid multiple provider errors Requires: %{name}-libc++-devel +Conflicts: otherproviders(libc++abi.so) +Provides: libc++abi.so %description libc++abi-devel This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. (development files) - %package vim-plugins Summary: Vim plugins for LLVM Group: Productivity/Text/Editors -Provides: vim-plugin-llvm -Conflicts: otherproviders(vim-plugin-llvm) Requires: vim +Conflicts: otherproviders(vim-plugin-llvm) +Provides: vim-plugin-llvm BuildArch: noarch %description vim-plugins This package contains vim plugins for LLVM like syntax highlighting. - %package emacs-plugins Summary: Emacs plugins for LLVM Group: Productivity/Text/Editors -Provides: emacs-llvm -Conflicts: otherproviders(emacs-llvm) Requires: emacs +Conflicts: otherproviders(emacs-llvm) +Provides: emacs-llvm BuildArch: noarch %description emacs-plugins This package contains Emacs plugins for LLVM like syntax highlighting. - %package -n python-clang Summary: Python 2 bindings for libclang Group: Development/Languages/Python @@ -339,7 +312,6 @@ BuildArch: noarch This package contains the Python 2.x bindings to clang (C language) frontend for LLVM. - %prep %setup -q -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -b 50 -a 51 -n llvm-%{version}.src %patch1 @@ -445,7 +417,7 @@ export CXX=${PWD}/stage1/bin/clang++ -DLLVM_ENABLE_TIMESTAMPS=OFF \ -DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PIC=ON \ - -DLLVM_BINUTILS_INCDIR=/usr/include \ + -DLLVM_BINUTILS_INCDIR=%{_includedir} \ -DLLVM_TARGETS_TO_BUILD=${TARGETS_TO_BUILD} \ %if "%{_lib}" == "lib64" -DLLVM_LIBDIR_SUFFIX=64 \ @@ -478,23 +450,22 @@ ninja -v -j $ninjaproc # Build man/html pages pushd docs -rm -rf %{buildroot}/usr/docs +rm -rf %{buildroot}%{_prefix}/docs mkdir -p %{buildroot}%{_docdir}/llvm/html -mkdir -p %{buildroot}/usr/share/man/man1 -cp -r _build/man/* %{buildroot}/usr/share/man/man1 +mkdir -p %{buildroot}%{_mandir}/man1 +cp -r _build/man/* %{buildroot}%{_mandir}/man1 cp -r _build/html/* %{buildroot}%{_docdir}/llvm/html popd pushd tools/clang/docs mkdir -p %{buildroot}%{_docdir}/llvm-clang/html -cp -r _build/man/* %{buildroot}/usr/share/man/man1 +cp -r _build/man/* %{buildroot}%{_mandir}/man1 cp -r _build/html/* %{buildroot}%{_docdir}/llvm-clang/html popd # install python bindings # The python bindings use the unversioned libclang.so, # so it doesn't make sense to have multiple versions of it -%if %{_latest} install -d %{buildroot}%{python_sitelib}/clang pushd tools/clang/bindings/python cp clang/*.py %{buildroot}%{python_sitelib}/clang @@ -503,7 +474,6 @@ cp -r examples %{buildroot}%{_docdir}/python-clang install -d %{buildroot}%{_docdir}/python-clang/tests/cindex/INPUTS cp -r tests %{buildroot}%{_docdir}/python-clang popd -%endif mkdir -p %{buildroot}%{_libdir}/bfd-plugins ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ @@ -573,22 +543,16 @@ ninja -v %{?_smp_mflags} check-libcxxabi %post -n libLLVM%{_sonum} -p /sbin/ldconfig %postun -n libLLVM%{_sonum} -p /sbin/ldconfig - %post -n libclang%{_sonum} -p /sbin/ldconfig %postun -n libclang%{_sonum} -p /sbin/ldconfig - %post -n libLTO%{_sonum} -p /sbin/ldconfig %postun -n libLTO%{_sonum} -p /sbin/ldconfig - %post gold -p /sbin/ldconfig %postun gold -p /sbin/ldconfig - %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig - %post clang-devel -p /sbin/ldconfig %postun clang-devel -p /sbin/ldconfig - %post LTO-devel -p /sbin/ldconfig %postun LTO-devel -p /sbin/ldconfig @@ -600,13 +564,10 @@ ninja -v %{?_smp_mflags} check-libcxxabi %if %{with libcxx} %post -n libc++%{_socxx} -p /sbin/ldconfig %postun -n libc++%{_socxx} -p /sbin/ldconfig - %post -n libc++abi%{_socxx} -p /sbin/ldconfig %postun -n libc++abi%{_socxx} -p /sbin/ldconfig - %post libc++-devel -p /sbin/ldconfig %postun libc++-devel -p /sbin/ldconfig - %post libc++abi-devel -p /sbin/ldconfig %postun libc++abi-devel -p /sbin/ldconfig %endif @@ -739,9 +700,6 @@ ninja -v %{?_smp_mflags} check-libcxxabi %dir %{_datadir}/clang/ %{_datadir}/clang/clang-format.py -# The python bindings use the unversioned libclang.so, -# so it doesn't make sense to have multiple versions of it -%if %{_latest} %files -n python-clang %defattr(-,root,root) %{python_sitelib}/clang/ @@ -749,6 +707,5 @@ ninja -v %{?_smp_mflags} check-libcxxabi %{python_sitelib}/clang/cindex.py %{python_sitelib}/clang/enumerations.py %{_docdir}/python-clang/ -%endif %changelog From 2e4c0cb60fe2d52f17d900cbc929e837b2005630a753fa6c90a61cccf993c0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 11:29:50 +0000 Subject: [PATCH 06/11] Make libc++/libc++abi packages named standalone OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=471 --- llvm.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/llvm.spec b/llvm.spec index c0e75cd..be19cce 100644 --- a/llvm.spec +++ b/llvm.spec @@ -248,13 +248,13 @@ Group: Development/Libraries/C and C++ This package contains libc++, a new implementation of the C++ standard library, targeting C++11. -%package libc++-devel +%package -n libc++-devel Summary: C++ standard library implementation (devel package) Group: Development/Languages/C and C++ Conflicts: otherproviders(libc++.so) Provides: libc++.so -%description libc++-devel +%description -n libc++-devel This package contains libc++, a new implementation of the C++ standard library, targeting C++11. (development files) @@ -266,7 +266,7 @@ Group: Development/Libraries/C and C++ This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. -%package libc++abi-devel +%package -n libc++abi-devel Summary: C++ standard library ABI (devel package) Group: Development/Languages/C and C++ # Avoid multiple provider errors @@ -274,7 +274,7 @@ Requires: %{name}-libc++-devel Conflicts: otherproviders(libc++abi.so) Provides: libc++abi.so -%description libc++abi-devel +%description -n libc++abi-devel This package contains the ABI for libc++, a new implementation of the C++ standard library, targeting C++11. (development files) @@ -566,10 +566,10 @@ ninja -v %{?_smp_mflags} check-libcxxabi %postun -n libc++%{_socxx} -p /sbin/ldconfig %post -n libc++abi%{_socxx} -p /sbin/ldconfig %postun -n libc++abi%{_socxx} -p /sbin/ldconfig -%post libc++-devel -p /sbin/ldconfig -%postun libc++-devel -p /sbin/ldconfig -%post libc++abi-devel -p /sbin/ldconfig -%postun libc++abi-devel -p /sbin/ldconfig +%post -n libc++-devel -p /sbin/ldconfig +%postun -n libc++-devel -p /sbin/ldconfig +%post -n libc++abi-devel -p /sbin/ldconfig +%postun -n libc++abi-devel -p /sbin/ldconfig %endif %files From 32426b786fa2450bb9b4fde604bdf0e3862e9c171e515c80bcb7035e2fcb7a42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 7 Sep 2016 11:31:12 +0000 Subject: [PATCH 07/11] Also fix %files OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=472 --- llvm.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm.spec b/llvm.spec index be19cce..a02c724 100644 --- a/llvm.spec +++ b/llvm.spec @@ -649,13 +649,13 @@ ninja -v %{?_smp_mflags} check-libcxxabi %defattr(-,root,root) %{_libdir}/libc++abi.so.* -%files libc++-devel +%files -n libc++-devel %defattr(-,root,root) %{_libdir}/libc++.so %{_libdir}/libc++abi.so %{_includedir}/c++/ -%files libc++abi-devel +%files -n libc++abi-devel %defattr(-,root,root) %{_libdir}/libc++abi.so %endif From 4c9c3d8dee3c8b6e20f6c5374208d2b73e666b117106bff61080b78e044d0605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Thu, 8 Sep 2016 09:16:14 +0000 Subject: [PATCH 08/11] More renames OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=473 --- baselibs.conf | 2 +- llvm.spec | 30 +++++++++++++++++++----------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/baselibs.conf b/baselibs.conf index f027300..61b8de7 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,4 +1,4 @@ libLLVM3_8 libclang3_8 llvm-devel -llvm-clang-devel +clang-devel diff --git a/llvm.spec b/llvm.spec index a02c724..8d656bc 100644 --- a/llvm.spec +++ b/llvm.spec @@ -143,7 +143,7 @@ Requires: oprofile-devel This package contains library and header files needed to develop new native programs that use the LLVM infrastructure. -%package clang +%package -n clang Summary: CLANG frontend for LLVM Group: Development/Languages/Other # Avoid multiple provider errors @@ -156,11 +156,17 @@ Recommends: scan-view %if %{with openmp} Recommends: libomp %endif +%if %{with libcxx} +Recommends: libc++ +Recommends: libc++-devel +%endif +Provides: llvm-clang = %{version} +Obsoletes: llvm-clang < %{version} -%description clang +%description -n clang This package contains the clang (C language) frontend for LLVM. -%package clang-checker +%package -n clang-checker Summary: Static code analyzer for CLANG Group: Development/Languages/Other # Avoid multiple provider errors @@ -170,7 +176,7 @@ Conflicts: otherproviders(scan-view) Provides: scan-build Provides: scan-view -%description clang-checker +%description -n clang-checker This package contains scan-build and scan-view, command line static code analyzers for CLANG. @@ -184,14 +190,16 @@ Requires: libstdc++-devel %description -n libclang%{_sonum} This package contains the shared libraries needed for clang. -%package clang-devel +%package -n clang-devel Summary: CLANG frontend for LLVM (devel package) Group: Development/Languages/Other Requires: llvm-clang = %{version} Requires: cmake(LLVM) = %{version} Conflicts: otherproviders(cmake(Clang)) +Provides: llvm-clang-devel = %{version} +Obsoletes: llvm-clang-devel < %{version} -%description clang-devel +%description -n clang-devel This package contains the clang (C language) frontend for LLVM. (development files) @@ -551,8 +559,8 @@ ninja -v %{?_smp_mflags} check-libcxxabi %postun gold -p /sbin/ldconfig %post devel -p /sbin/ldconfig %postun devel -p /sbin/ldconfig -%post clang-devel -p /sbin/ldconfig -%postun clang-devel -p /sbin/ldconfig +%post -n clang-devel -p /sbin/ldconfig +%postun -n clang-devel -p /sbin/ldconfig %post LTO-devel -p /sbin/ldconfig %postun LTO-devel -p /sbin/ldconfig @@ -593,7 +601,7 @@ ninja -v %{?_smp_mflags} check-libcxxabi %exclude %{_bindir}/llvm-config %exclude %{_mandir}/man1/llvm-config.1%{ext_man} -%files clang +%files -n clang %defattr(-,root,root) %{_bindir}/c-index-test %{_bindir}/c++-analyzer @@ -608,7 +616,7 @@ ninja -v %{?_smp_mflags} check-libcxxabi %dir %{_libdir}/clang/ %{_libdir}/clang/%{_relver}/ -%files clang-checker +%files -n clang-checker %defattr(-,root,root) %{_bindir}/scan-build %{_bindir}/scan-view @@ -674,7 +682,7 @@ ninja -v %{?_smp_mflags} check-libcxxabi %{_docdir}/llvm/ %{_mandir}/man1/llvm-config.1%{ext_man} -%files clang-devel +%files -n clang-devel %defattr(-,root,root) %{_libdir}/libclang*.so %{_includedir}/clang/ From 390c08af3aa8d223b7269861734ca9d6f6d3cbbe430e4e6416e63bcd2d1cb187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 9 Sep 2016 06:59:23 +0000 Subject: [PATCH 09/11] Fix libc++ requires OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=474 --- llvm.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm.spec b/llvm.spec index 8d656bc..01aa1b6 100644 --- a/llvm.spec +++ b/llvm.spec @@ -148,7 +148,6 @@ Summary: CLANG frontend for LLVM Group: Development/Languages/Other # Avoid multiple provider errors Requires: libLTO%{_sonum} -Requires: libc++%{_socxx} Requires: libclang%{_sonum} Recommends: LLVMgold.so()(64bit) Recommends: scan-build @@ -157,7 +156,7 @@ Recommends: scan-view Recommends: libomp %endif %if %{with libcxx} -Recommends: libc++ +Requires: libc++%{_socxx} Recommends: libc++-devel %endif Provides: llvm-clang = %{version} From 78da280f0ee1fa317d7f3a03448a8194460b7510f04eba63b8f6b11e562db12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 9 Sep 2016 07:15:42 +0000 Subject: [PATCH 10/11] Fix lldb build OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=475 --- lldb.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb.spec b/lldb.spec index 4256df4..8cd1f07 100644 --- a/lldb.spec +++ b/lldb.spec @@ -34,6 +34,7 @@ Patch1: D15067.id41365.diff Patch2: lldb-add-pthread-dl-libs.patch BuildRequires: cmake BuildRequires: fdupes +BuildRequires: llvm-gold BuildRequires: ncurses-devel BuildRequires: ninja BuildRequires: pkgconfig From 05bdbb690b2b9e311b65f53f532a0f215826268b591d4e0b18c452d927da710e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Mon, 12 Sep 2016 06:39:43 +0000 Subject: [PATCH 11/11] Fix libc++abi-devel requires OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=476 --- llvm.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm.spec b/llvm.spec index 01aa1b6..aa83870 100644 --- a/llvm.spec +++ b/llvm.spec @@ -277,7 +277,7 @@ of the C++ standard library, targeting C++11. Summary: C++ standard library ABI (devel package) Group: Development/Languages/C and C++ # Avoid multiple provider errors -Requires: %{name}-libc++-devel +Requires: libc++-devel Conflicts: otherproviders(libc++abi.so) Provides: libc++abi.so