summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-03-18 22:07:45 +0000
committerdim <dim@FreeBSD.org>2014-03-18 22:07:45 +0000
commitce0b21596585c6ddd828c54e5077ba0aecfae8fc (patch)
tree67bb26dee066c422ad2e624408df89bdc262af76 /contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff
parentf931c3355875cf6371ab8fbad62d0f35958db4a0 (diff)
downloadFreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.zip
FreeBSD-src-ce0b21596585c6ddd828c54e5077ba0aecfae8fc.tar.gz
Add separate patch files for all the customizations we have currently
applied to our copy of llvm/clang. These can be applied in alphabetical order to a pristine llvm/clang 3.4 release source tree, to result in the same version used in FreeBSD. This is intended to clearly document all the changes until now, which mostly consist of cherry pickings from the respective upstream trunks, plus a number of hand-written FreeBSD-specific ones. Hopefully those can eventually be cleaned up and sent upstream too. MFC after: 1 week X-MFC-With: r263313
Diffstat (limited to 'contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff')
-rw-r--r--contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff84
1 files changed, 84 insertions, 0 deletions
diff --git a/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff b/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff
new file mode 100644
index 0000000..00514eb
--- /dev/null
+++ b/contrib/llvm/patches/patch-r262535-clang-r202177-sparc.diff
@@ -0,0 +1,84 @@
+Pull in r202177 from upstream clang trunk (by Roman Divacky):
+
+ Give sparcv9 the ability to set the target cpu. Change it from accepting
+ -march which doesnt exist on sparc gcc to -mcpu. While here adjust a
+ few tests to not write an unused temporary file.
+
+Introduced here: http://svn.freebsd.org/changeset/base/262535
+
+Index: tools/clang/lib/Basic/Targets.cpp
+===================================================================
+--- tools/clang/lib/Basic/Targets.cpp
++++ tools/clang/lib/Basic/Targets.cpp
+@@ -4552,6 +4552,22 @@ class SparcV9TargetInfo : public SparcTargetInfo {
+ Builder.defineMacro("__sparcv9__");
+ }
+ }
++
++ virtual bool setCPU(const std::string &Name) {
++ bool CPUKnown = llvm::StringSwitch<bool>(Name)
++ .Case("v9", true)
++ .Case("ultrasparc", true)
++ .Case("ultrasparc3", true)
++ .Case("niagara", true)
++ .Case("niagara2", true)
++ .Case("niagara3", true)
++ .Case("niagara4", true)
++ .Default(false);
++
++ // No need to store the CPU yet. There aren't any CPU-specific
++ // macros to define.
++ return CPUKnown;
++ }
+ };
+
+ } // end anonymous namespace.
+Index: tools/clang/lib/Driver/Tools.cpp
+===================================================================
+--- tools/clang/lib/Driver/Tools.cpp
++++ tools/clang/lib/Driver/Tools.cpp
+@@ -1373,7 +1373,8 @@ static std::string getCPUName(const ArgList &Args,
+ }
+
+ case llvm::Triple::sparc:
+- if (const Arg *A = Args.getLastArg(options::OPT_march_EQ))
++ case llvm::Triple::sparcv9:
++ if (const Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
+ return A->getValue();
+ return "";
+
+Index: tools/clang/test/Driver/freebsd.c
+===================================================================
+--- tools/clang/test/Driver/freebsd.c
++++ tools/clang/test/Driver/freebsd.c
+@@ -59,13 +59,13 @@
+ // CHECK-MIPSEL: "{{[^" ]*}}ld{{[^" ]*}}"
+ // CHECK-MIPSEL: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
+ // CHECK-MIPSEL-NOT: "--hash-style={{gnu|both}}"
+-// RUN: %clang %s -### -o %t.o 2>&1 \
++// RUN: %clang %s -### 2>&1 \
+ // RUN: -target mips64-unknown-freebsd10.0 \
+ // RUN: | FileCheck --check-prefix=CHECK-MIPS64 %s
+ // CHECK-MIPS64: "{{[^" ]*}}ld{{[^" ]*}}"
+ // CHECK-MIPS64: "-dynamic-linker" "{{.*}}/libexec/ld-elf.so.1"
+ // CHECK-MIPS64-NOT: "--hash-style={{gnu|both}}"
+-// RUN: %clang %s -### -o %t.o 2>&1 \
++// RUN: %clang %s -### 2>&1 \
+ // RUN: -target mips64el-unknown-freebsd10.0 \
+ // RUN: | FileCheck --check-prefix=CHECK-MIPS64EL %s
+ // CHECK-MIPS64EL: "{{[^" ]*}}ld{{[^" ]*}}"
+@@ -97,12 +97,12 @@
+ // CHECK-NORMAL: crt1.o
+ // CHECK-NORMAL: crtbegin.o
+
+-// RUN: %clang %s -### -o %t.o -target arm-unknown-freebsd10.0 2>&1 \
++// RUN: %clang %s -### -target arm-unknown-freebsd10.0 2>&1 \
+ // RUN: | FileCheck --check-prefix=CHECK-ARM %s
+ // CHECK-ARM: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions"
+ // CHECK-ARM: as{{.*}}" "-mfpu=softvfp"{{.*}}"-matpcs"
+
+-// RUN: %clang %s -### -o %t.o -target arm-gnueabi-freebsd10.0 2>&1 \
++// RUN: %clang %s -### -target arm-gnueabi-freebsd10.0 2>&1 \
+ // RUN: | FileCheck --check-prefix=CHECK-ARM-EABI %s
+ // CHECK-ARM-EABI-NOT: clang{{.*}}" "-cc1"{{.*}}" "-fsjlj-exceptions"
+ // CHECK-ARM-EABI: as{{.*}}" "-mfpu=softvfp" "-meabi=5"
OpenPOWER on IntegriCloud