From 930a88b69d5caa1b867ed46f11f00d3575f43aa83c69674ea5b0d62f13f85d5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Tue, 17 Apr 2012 09:02:19 +0000 Subject: [PATCH 1/3] - Update to svn revision 154914 from 3.1 branch OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=131 --- assume-opensuse.patch | 11 +-- clang-fix-mips-test.patch | 21 ++++++ clang-glibc2.14.patch | 134 ---------------------------------- clang-pr11642.patch | 31 -------- llvm-3.0.99+svn154914.tar.bz2 | 3 + llvm-3.0.tar.bz2 | 3 - llvm.changes | 5 ++ llvm.spec | 45 ++++++------ set-revision.patch | 16 +++- 9 files changed, 71 insertions(+), 198 deletions(-) create mode 100644 clang-fix-mips-test.patch delete mode 100644 clang-glibc2.14.patch delete mode 100644 clang-pr11642.patch create mode 100644 llvm-3.0.99+svn154914.tar.bz2 delete mode 100644 llvm-3.0.tar.bz2 diff --git a/assume-opensuse.patch b/assume-opensuse.patch index fed5e0b..6cebd9b 100644 --- a/assume-opensuse.patch +++ b/assume-opensuse.patch @@ -1,11 +1,12 @@ ---- tools/clang/lib/Driver/ToolChains.cpp 2011-08-12 11:19:35.000000000 +0200 -+++ tools/clang/lib/Driver/ToolChains.cpp 2011-08-12 12:10:47.733446958 +0200 -@@ -1346,8 +1346,7 @@ +Index: llvm/tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- llvm.orig/tools/clang/lib/Driver/ToolChains.cpp ++++ llvm/tools/clang/lib/Driver/ToolChains.cpp +@@ -1840,7 +1840,7 @@ static bool IsRedhat(enum LinuxDistro Di } static bool IsOpenSuse(enum LinuxDistro Distro) { -- return Distro == OpenSuse11_3 || Distro == OpenSuse11_4 || -- Distro == OpenSuse12_1; +- return Distro >= OpenSuse11_3 && Distro <= OpenSuse12_1; + return true; } diff --git a/clang-fix-mips-test.patch b/clang-fix-mips-test.patch new file mode 100644 index 0000000..55ef9ca --- /dev/null +++ b/clang-fix-mips-test.patch @@ -0,0 +1,21 @@ +Index: llvm/tools/clang/test/Driver/linux-ld.c +=================================================================== +--- llvm.orig/tools/clang/test/Driver/linux-ld.c ++++ llvm/tools/clang/test/Driver/linux-ld.c +@@ -194,14 +194,14 @@ + // RUN: | FileCheck --check-prefix=CHECK-MIPS %s + // CHECK-MIPS: "{{.*}}ld{{(.exe)?}}" + // CHECK-MIPS: "-m" "elf32btsmip" +-// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib/ld.so.1" ++// CHECK-MIPS: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" + // CHECK-MIPS-NOT: "--hash-style={{gnu|both}}" + // RUN: %clang %s -### -o %t.o 2>&1 \ + // RUN: -target mipsel-linux-gnu -ccc-clang-archs mipsel \ + // RUN: | FileCheck --check-prefix=CHECK-MIPSEL %s + // CHECK-MIPSEL: "{{.*}}ld{{(.exe)?}}" + // CHECK-MIPSEL: "-m" "elf32ltsmip" +-// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib/ld.so.1" ++// CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/lib64/ld.so.1" + // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}" + // RUN: %clang %s -### -o %t.o 2>&1 \ + // RUN: -target mips64-linux-gnu -ccc-clang-archs mips64 \ diff --git a/clang-glibc2.14.patch b/clang-glibc2.14.patch deleted file mode 100644 index c782ea4..0000000 --- a/clang-glibc2.14.patch +++ /dev/null @@ -1,134 +0,0 @@ -Index: test/CodeGen/pr9614.c -=================================================================== ---- test/CodeGen/pr9614.c (revision 146866) -+++ test/CodeGen/pr9614.c (revision 146867) -@@ -1,4 +1,4 @@ --// RUN: %clang_cc1 -emit-llvm %s -O1 -o - | FileCheck %s -+// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s - - extern void foo_alias (void) __asm ("foo"); - inline void foo (void) { -@@ -8,15 +8,22 @@ - inline __attribute__ ((__always_inline__)) void bar (void) { - return bar_alias (); - } -+extern char *strrchr_foo (const char *__s, int __c) __asm ("strrchr"); -+extern inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr_foo (const char *__s, int __c) { -+ return __builtin_strrchr (__s, __c); -+} - void f(void) { - foo(); - bar(); -+ strrchr_foo("", '.'); - } - - // CHECK: define void @f() - // CHECK: call void @foo() - // CHECK-NEXT: call void @bar() -+// CHECK-NEXT: call i8* @strrchr( - // CHECK-NEXT: ret void - - // CHECK: declare void @foo() - // CHECK: declare void @bar() -+// CHECK: declare i8* @strrchr(i8*, i32) -Index: lib/CodeGen/CodeGenModule.h -=================================================================== ---- lib/CodeGen/CodeGenModule.h (revision 146866) -+++ lib/CodeGen/CodeGenModule.h (revision 146867) -@@ -323,7 +323,7 @@ - void createOpenCLRuntime(); - void createCUDARuntime(); - -- bool isTriviallyRecursiveViaAsm(const FunctionDecl *F); -+ bool isTriviallyRecursive(const FunctionDecl *F); - bool shouldEmitFunction(const FunctionDecl *F); - llvm::LLVMContext &VMContext; - -Index: lib/CodeGen/CodeGenModule.cpp -=================================================================== ---- lib/CodeGen/CodeGenModule.cpp (revision 146866) -+++ lib/CodeGen/CodeGenModule.cpp (revision 146867) -@@ -30,6 +30,7 @@ - #include "clang/AST/Mangle.h" - #include "clang/AST/RecordLayout.h" - #include "clang/AST/RecursiveASTVisitor.h" -+#include "clang/Basic/Builtins.h" - #include "clang/Basic/Diagnostic.h" - #include "clang/Basic/SourceManager.h" - #include "clang/Basic/TargetInfo.h" -@@ -863,20 +864,27 @@ - struct FunctionIsDirectlyRecursive : - public RecursiveASTVisitor { - const StringRef Name; -+ const Builtin::Context &BI; - bool Result; -- FunctionIsDirectlyRecursive(const FunctionDecl *F) : -- Name(F->getName()), Result(false) { -+ FunctionIsDirectlyRecursive(StringRef N, const Builtin::Context &C) : -+ Name(N), BI(C), Result(false) { - } - typedef RecursiveASTVisitor Base; - - bool TraverseCallExpr(CallExpr *E) { -- const Decl *D = E->getCalleeDecl(); -- if (!D) -+ const FunctionDecl *FD = E->getDirectCallee(); -+ if (!FD) - return true; -- AsmLabelAttr *Attr = D->getAttr(); -- if (!Attr) -+ AsmLabelAttr *Attr = FD->getAttr(); -+ if (Attr && Name == Attr->getLabel()) { -+ Result = true; -+ return false; -+ } -+ unsigned BuiltinID = FD->getBuiltinID(); -+ if (!BuiltinID) - return true; -- if (Name == Attr->getLabel()) { -+ const char *BuiltinName = BI.GetName(BuiltinID) + strlen("__builtin_"); -+ if (Name == BuiltinName) { - Result = true; - return false; - } -@@ -885,15 +893,24 @@ - }; - } - --// isTriviallyRecursiveViaAsm - Check if this function calls another --// decl that, because of the asm attribute, ends up pointing to itself. -+// isTriviallyRecursive - Check if this function calls another -+// decl that, because of the asm attribute or the other decl being a builtin, -+// ends up pointing to itself. - bool --CodeGenModule::isTriviallyRecursiveViaAsm(const FunctionDecl *F) { -- if (getCXXABI().getMangleContext().shouldMangleDeclName(F)) -- return false; -+CodeGenModule::isTriviallyRecursive(const FunctionDecl *FD) { -+ StringRef Name; -+ if (getCXXABI().getMangleContext().shouldMangleDeclName(FD)) { -+ // asm labels are a special king of mangling we have to support. -+ AsmLabelAttr *Attr = FD->getAttr(); -+ if (!Attr) -+ return false; -+ Name = Attr->getLabel(); -+ } else { -+ Name = FD->getName(); -+ } - -- FunctionIsDirectlyRecursive Walker(F); -- Walker.TraverseFunctionDecl(const_cast(F)); -+ FunctionIsDirectlyRecursive Walker(Name, Context.BuiltinInfo); -+ Walker.TraverseFunctionDecl(const_cast(FD)); - return Walker.Result; - } - -@@ -909,7 +926,7 @@ - // but a function that calls itself is clearly not equivalent to the real - // implementation. - // This happens in glibc's btowc and in some configure checks. -- return !isTriviallyRecursiveViaAsm(F); -+ return !isTriviallyRecursive(F); - } - - void CodeGenModule::EmitGlobalDefinition(GlobalDecl GD) { diff --git a/clang-pr11642.patch b/clang-pr11642.patch deleted file mode 100644 index 5c202c9..0000000 --- a/clang-pr11642.patch +++ /dev/null @@ -1,31 +0,0 @@ -Index: test/CodeGenCXX/visibility-inlines-hidden.cpp -=================================================================== ---- test/CodeGenCXX/visibility-inlines-hidden.cpp (revision 147294) -+++ test/CodeGenCXX/visibility-inlines-hidden.cpp (revision 147295) -@@ -97,3 +97,14 @@ - - // CHECK: define available_externally void @_ZN5test22ns3fooINS_1BINS_1AEEEEEvv() - } -+ -+namespace PR11642 { -+ template -+ class Foo { -+ public: -+ T foo(T x) { return x; } -+ }; -+ extern template class Foo; -+ template class Foo; -+ // CHECK: define weak_odr i32 @_ZN7PR116423FooIiE3fooEi -+} -Index: lib/AST/Decl.cpp -=================================================================== ---- lib/AST/Decl.cpp (revision 147294) -+++ lib/AST/Decl.cpp (revision 147295) -@@ -568,6 +568,7 @@ - // about whether containing classes have visibility attributes, - // and that's intentional. - if (TSK != TSK_ExplicitInstantiationDeclaration && -+ TSK != TSK_ExplicitInstantiationDefinition && - F.ConsiderGlobalVisibility && - MD->getASTContext().getLangOptions().InlineVisibilityHidden) { - // InlineVisibilityHidden only applies to definitions, and diff --git a/llvm-3.0.99+svn154914.tar.bz2 b/llvm-3.0.99+svn154914.tar.bz2 new file mode 100644 index 0000000..d8702c3 --- /dev/null +++ b/llvm-3.0.99+svn154914.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af9ae518982b9385f4bceae48eafcf1ffb309bbd2422a5a95aa1df00f0d216aa +size 16144645 diff --git a/llvm-3.0.tar.bz2 b/llvm-3.0.tar.bz2 deleted file mode 100644 index 53b3cdf..0000000 --- a/llvm-3.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d9486d9f956ceb8002377406368ad871f41ce01e95ba3b735757df4beaaa3374 -size 13988408 diff --git a/llvm.changes b/llvm.changes index b8adf08..c0dc274 100644 --- a/llvm.changes +++ b/llvm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 17 07:48:50 UTC 2012 - idonmez@suse.com + +- Update to svn revision 154914 from 3.1 branch + ------------------------------------------------------------------- Tue Mar 20 12:40:27 UTC 2012 - idonmez@suse.com diff --git a/llvm.spec b/llvm.spec index c076605..f51e1b4 100644 --- a/llvm.spec +++ b/llvm.spec @@ -16,12 +16,12 @@ # -%define _revision 145598 -%define _release_version 3.0 +%define _revision 154914 +%define _release_version 3.1 %define _supported_archs "arm,x86" Name: llvm -Version: 3.0 +Version: 3.0.99+svn154914 Release: 0 Summary: Low Level Virtual Machine License: NCSA @@ -32,15 +32,12 @@ Source100: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Allow us to set revision Patch1: set-revision.patch # PATCH-FIX-OPENSUSE assume-opensuse.patch idoenmez@suse.de -- Always enable openSUSE/SUSE features -Patch3: assume-opensuse.patch -# PATCH-FIX-UPSTREAM clang-glibc2.14.patch idoenmez@suse.de -- Support glibc 2.14 headers -Patch4: clang-glibc2.14.patch +Patch2: assume-opensuse.patch # PATCH-FIX-OPENSUSE clang-disable-ada-extension.patch idoenmez@suse.de -- Don't run gcc for ada files -Patch5: clang-disable-ada-extension.patch -# PATCH-FIX-UPSTREAM http://llvm.org/viewvc/llvm-project?view=rev&revision=147295 -Patch6: clang-pr11642.patch +Patch3: clang-disable-ada-extension.patch # PATCH-FIX-OPENSUSE default-to-i586.patch -- Use i586 as default target for 32bit -Patch7: default-to-i586.patch +Patch4: default-to-i586.patch +Patch5: clang-fix-mips-test.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf BuildRequires: automake @@ -49,15 +46,16 @@ BuildRequires: binutils-devel >= 2.21.90 %endif BuildRequires: bison BuildRequires: chrpath -BuildRequires: dejagnu BuildRequires: fdupes BuildRequires: flex BuildRequires: gcc BuildRequires: gcc-c++ +%ifarch x86_64 +# For tests +BuildRequires: glibc-devel-32bit +%endif BuildRequires: libtool -BuildRequires: python-devel -BuildRequires: tcl-devel -BuildRequires: tk-devel +BuildRequires: python # Code10 does not have libffi %if 0%{?suse_version} > 1100 @@ -130,20 +128,23 @@ Requires: vim This package contains vim plugins for LLVM like syntax highlighting. %prep -%setup -q -%patch1 -%patch3 -cd tools/clang -%patch4 -%patch6 -cd ../.. +%setup -q -n %{name} +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%ifarch x86_64 %patch5 -p1 -%patch7 -p1 +%endif # We hardcode i586 rm tools/clang/test/Driver/x86_features.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 + +# FIXME +rm -rf projects/compiler_rt # Nasty hardcoded path sed -i s,/lib/,/%{_lib}/,g tools/clang/lib/Driver/Tools.cpp diff --git a/set-revision.patch b/set-revision.patch index 12fec31..66cbf2e 100644 --- a/set-revision.patch +++ b/set-revision.patch @@ -1,6 +1,8 @@ ---- tools/clang/lib/Basic/Version.cpp (revision 131788) -+++ tools/clang/lib/Basic/Version.cpp (working copy) -@@ -50,11 +50,7 @@ +Index: llvm/tools/clang/lib/Basic/Version.cpp +=================================================================== +--- llvm.orig/tools/clang/lib/Basic/Version.cpp ++++ llvm/tools/clang/lib/Basic/Version.cpp +@@ -66,19 +66,11 @@ std::string getLLVMRepositoryPath() { } std::string getClangRevision() { @@ -11,4 +13,12 @@ -#endif } + std::string getLLVMRevision() { +-#ifdef LLVM_REVISION + return LLVM_REVISION; +-#else +- return ""; +-#endif + } + std::string getClangFullRepositoryVersion() { From a41466936b826e80f6a5a61c81a21451c65ca755bde5eae03b4515ab3e82a393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Tue, 17 Apr 2012 13:11:13 +0000 Subject: [PATCH 2/3] filelist fix OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=132 --- llvm.spec | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/llvm.spec b/llvm.spec index f51e1b4..554f4b1 100644 --- a/llvm.spec +++ b/llvm.spec @@ -348,31 +348,8 @@ rm -f %{buildroot}%{_libdir}/libEnhancedDisassembly.* %dir %{_libdir}/clang %dir %{_libdir}/clang/* %dir %{_libdir}/clang/*/include -%{_libdir}/clang/*/include/altivec.h -%{_libdir}/clang/*/include/arm_neon.h -%{_libdir}/clang/*/include/avxintrin.h -%{_libdir}/clang/*/include/emmintrin.h -%{_libdir}/clang/*/include/float.h -%{_libdir}/clang/*/include/immintrin.h -%{_libdir}/clang/*/include/iso646.h -%{_libdir}/clang/*/include/limits.h -%{_libdir}/clang/*/include/mm_malloc.h -%{_libdir}/clang/*/include/mmintrin.h -%{_libdir}/clang/*/include/nmmintrin.h -%{_libdir}/clang/*/include/pmmintrin.h -%{_libdir}/clang/*/include/smmintrin.h -%{_libdir}/clang/*/include/stdalign.h -%{_libdir}/clang/*/include/stdarg.h -%{_libdir}/clang/*/include/stdbool.h -%{_libdir}/clang/*/include/stddef.h -%{_libdir}/clang/*/include/stdint.h -%{_libdir}/clang/*/include/tgmath.h -%{_libdir}/clang/*/include/tmmintrin.h -%{_libdir}/clang/*/include/varargs.h -%{_libdir}/clang/*/include/wmmintrin.h -%{_libdir}/clang/*/include/x86intrin.h -%{_libdir}/clang/*/include/xmmintrin.h -%{_libdir}/clang/*/include/mm3dnow.h +%{_libdir}/clang/*/include/*.h +%{_libdir}/clang/*/include/module.map %files clang-devel %defattr(-,root,root) From 080df248c47585895fb0233d902c566f893e4550c7cbdc3cd44df0a357ebc81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Wed, 18 Apr 2012 08:37:42 +0000 Subject: [PATCH 3/3] Major new features: * AddressSanitizer, a fast memory error detector. * MachineInstr Bundles, Support to model instruction bundling / packing. * ARM Integrated Assembler, A full featured assembler and direct-to-object support for ARM. * Basic Block Placement Probability driven basic block placement. LLVM IR and Core Improvements * IR support for half float * IR support for vectors of pointers, including vector GEPs. * Module flags have been introduced. * Loads can now have range metadata attached to them to describe the possible values being loaded. * Inline cost heuristics have been completely overhauled and now closely model constant propagation through call sites, disregard trivially dead code costs, and can model C++ STL iterator patterns. Optimizer Improvements * The loop unroll pass now is able to unroll loops with run-time trip counts. This feature is turned off by default, and is enabled with the -unroll-runtime flag. * A new basic-block autovectorization pass is available. Pass -vectorize to run this pass along with some associated post-vectorization cleanup passes. X86-32 and X86-64 Target Improvements * Bug fixes and improved support for AVX1 * Support for AVX2 (still incomplete at this point) OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/llvm?expand=0&rev=133 --- llvm.changes | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/llvm.changes b/llvm.changes index c0dc274..9d10c13 100644 --- a/llvm.changes +++ b/llvm.changes @@ -3,6 +3,66 @@ Tue Apr 17 07:48:50 UTC 2012 - idonmez@suse.com - Update to svn revision 154914 from 3.1 branch + Major new features: + + * AddressSanitizer, a fast memory error detector. + * MachineInstr Bundles, Support to model instruction + bundling / packing. + * ARM Integrated Assembler, A full featured assembler + and direct-to-object support for ARM. + * Basic Block Placement Probability driven basic block placement. + + LLVM IR and Core Improvements + + * IR support for half float + * IR support for vectors of pointers, including vector GEPs. + * Module flags have been introduced. + * Loads can now have range metadata attached to them to + describe the possible values being loaded. + * Inline cost heuristics have been completely overhauled + and now closely model constant propagation through call sites, + disregard trivially dead code costs, and + can model C++ STL iterator patterns. + + Optimizer Improvements + + * The loop unroll pass now is able to unroll loops with + run-time trip counts. This feature is turned off by default, + and is enabled with the -unroll-runtime flag. + * A new basic-block autovectorization pass is available. + Pass -vectorize to run this pass along with some associated + post-vectorization cleanup passes. + + X86-32 and X86-64 Target Improvements + + * Bug fixes and improved support for AVX1 + * Support for AVX2 (still incomplete at this point) + + ARM Target Improvements + + * The constant island pass now supports basic block and + constant pool entry alignments greater than 4 bytes. + + Clang Changes + + * New: -Wdangling-else, -Wstrncat-size + * Improved: -Wformat, -Wempty-body, -Wliteral-conversion + * Clang 3.1 adds support for anonymous structs and anonymous unions, + added in the latest ISO C standard. Use -std=c11 or -std=gnu11 + to enable support for the new language standard. + The new C11 features are backwards-compatible and are available + as an extension in all language modes. + * All warning and language selection flags which previously accepted + c1x have been updated to accept c11. The old c1x forms have been removed. + * Generalized constant expressions + * Lambda expressions + * Generalized initializers + * Unrestricted unions + * User-defined literals + * Forward-declared enumerations + * Atomics (both libc++'s and libstdc++4.7's are supported) + + ------------------------------------------------------------------- Tue Mar 20 12:40:27 UTC 2012 - idonmez@suse.com