diff -Nru clang-3.1/debian/changelog clang-3.1/debian/changelog
--- clang-3.1/debian/changelog	2012-07-13 22:03:37.000000000 +0000
+++ clang-3.1/debian/changelog	2012-12-03 18:08:13.000000000 +0000
@@ -1,8 +1,43 @@
-clang (3.1-8~precise1) precise; urgency=low
+clang (3.1-8ubuntu2~precise2) precise; urgency=low
+
+  * Build using gcc-4.6.
+
+ -- Bradley M. Froehle <brad.froehle@gmail.com>  Mon, 03 Dec 2012 10:07:56 -0800
+
+clang (3.1-8ubuntu2~precise1) precise; urgency=low
 
   * No-change backport to precise
 
- -- Bradley M. Froehle <brad.froehle@gmail.com>  Fri, 13 Jul 2012 15:03:37 -0700
+ -- Bradley M. Froehle <brad.froehle@gmail.com>  Mon, 03 Dec 2012 10:06:52 -0800
+
+clang (3.1-8ubuntu2) raring; urgency=low
+
+  * Build-depend on python.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sat, 17 Nov 2012 19:24:30 +0100
+
+clang (3.1-8ubuntu1) raring; urgency=low
+
+  * Merge with Debian; remaining changes:
+    - Set Ubuntu as vendor name instead of Debian.
+    - Update linker flags for `precise'.
+    - debian/patches/23-ubuntu-name.diff: Assume unknown Ubuntu releases
+      behave like precise, until we know otherwise.
+    - debian/patches/25-armhf-linker-name.diff: set armhf linker path
+      to the recently agreed-upon /lib/ld-linux-armhf.so.3,
+      recognize arm-linux-gnueabihf triplet.
+    - debian/patches/26-armv7-not-neon.patch: make sure that none of the
+      non-NEON FPU options enable NEON by default, as well as stopping
+      the broken assumption that all armv7/cortex cores support NEON,
+      as they really don't.
+    - debian/patches/27-armhf-is-armv7.patch: Make armhf builds
+      default to cortex-a8 with vfpv3-d16, to agree with glibc/gcc.
+    - 28-powerpc-no-altivec.patch: Don't enable altivec on powerpc by
+      default, as not all powerpc-compatible CPUs support altivec.
+  * Build using gcc-4.7.
+  * Make the `quantal' and `raring' code names known.
+
+ -- Matthias Klose <doko@ubuntu.com>  Wed, 14 Nov 2012 15:12:59 +0100
 
 clang (3.1-8) unstable; urgency=low
 
@@ -94,6 +129,39 @@
 
  -- Sylvestre Ledru <sylvestre@debian.org>  Thu, 12 Apr 2012 21:08:42 +0200
 
+clang (3.0-6ubuntu3) precise; urgency=low
+
+  * debian/patches/26-armv7-not-neon.patch: adds a d16 FPU target,
+    and makes sure that none of the non-NEON FPU options enable
+    NEON by default, as well as stopping the broken assumption that
+    all armv7/cortex cores support NEON, as they really don't.
+  * debian/patches/27-armhf-is-armv7.patch: Make armhf builds
+    default to cortex-a8 with vfpv3-d16, to agree with glibc/gcc.
+  * 28-powerpc-no-altivec.patch: Don't enable altivec on powerpc by
+    default, as not all powerpc-compatible CPUs support altivec.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 24 Apr 2012 03:23:07 -0600
+
+clang (3.0-6ubuntu2) precise; urgency=low
+
+  * debian/patches/25-armhf-linker-name.diff: update armhf linker
+    path to the recently agreed-upon /lib/ld-linux-armhf.so.3
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Sun, 15 Apr 2012 04:12:53 -0600
+
+clang (3.0-6ubuntu1) precise; urgency=low
+
+  * Merge with Debian (LP: #903509); remaining changes:
+    - Set Ubuntu as vendor name instead of Debian.
+    - Make the `precise' code name known.
+    - Update linker flags for `precise'.
+    - Set dynamic linker name for armhf, recognize arm-linux-gnueabihf triplet.
+    - Remove auto-generated debian_path.h.
+  * debian/patches/23-ubuntu-name.diff: Assume unknown Ubuntu releases
+    behave like precise, until we know otherwise.
+
+ -- Anders Kaseorg <andersk@mit.edu>  Fri, 02 Mar 2012 02:14:00 -0500
+
 clang (3.0-6) unstable; urgency=low
 
   * Improve the soname patch
@@ -124,6 +192,17 @@
 
  -- Sylvestre Ledru <sylvestre@debian.org>  Tue, 20 Dec 2011 15:41:35 +0100
 
+clang (3.0-3ubuntu1) precise; urgency=low
+
+  * Merge with Debian; remaining changes:
+    - Set Ubuntu as vendor name instead of Debian.
+  * Make the `precise' code name known.
+  * Update linker flags for `precise'.
+  * Set dynamic linker name for armhf, recognize arm-linux-gnueabihf triplet.
+  * Remove auto-generated debian_path.h.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 12 Dec 2011 08:52:00 +0100
+
 clang (3.0-3) unstable; urgency=low
 
   * 23-strlcpy_strlcat_warning_removed.diff: strlcat and strlcpy does not exist
diff -Nru clang-3.1/debian/control clang-3.1/debian/control
--- clang-3.1/debian/control	2012-06-27 22:12:08.000000000 +0000
+++ clang-3.1/debian/control	2012-12-03 18:36:43.000000000 +0000
@@ -1,14 +1,15 @@
 Source: clang
 Section: devel
 Priority: optional
-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
 Uploaders: Arthur Loiret <aloiret@debian.org>,
  Sylvestre Ledru <sylvestre@debian.org>
 Build-Depends: debhelper (>= 6.0.0), flex, bison, dejagnu, tcl8.5, expect,
     autoconf, automake1.9, perl, libtool, doxygen, chrpath, texinfo,
     sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9),
     lsb-release, patchutils, diffstat, xz-utils, llvm-3.1-dev (>= 3.1), llvm-3.1-source (>= 3.1),
-    gcc-4.6, g++-4.6
+    gcc-4.6, g++-4.6, python
 Build-Conflicts: oprofile, ocaml
 Standards-Version: 3.9.3
 Homepage: http://www.llvm.org/
diff -Nru clang-3.1/debian/control.in/source clang-3.1/debian/control.in/source
--- clang-3.1/debian/control.in/source	2012-06-21 09:03:51.000000000 +0000
+++ clang-3.1/debian/control.in/source	2012-12-03 18:09:29.000000000 +0000
@@ -1,14 +1,15 @@
 Source: @PKGSOURCE@
 Section: devel
 Priority: optional
-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: LLVM Packaging Team <pkg-llvm-team@lists.alioth.debian.org>
 Uploaders: Arthur Loiret <aloiret@debian.org>,
  Sylvestre Ledru <sylvestre@debian.org>
 Build-Depends: debhelper (>= 6.0.0), flex, bison, dejagnu, tcl8.5, expect,
     autoconf, automake1.9, perl, libtool, doxygen, chrpath, texinfo,
     sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9),
     lsb-release, patchutils, diffstat, xz-utils @BUILDDEPS@,
-    gcc-4.6, g++-4.6
+    gcc-4.6, g++-4.6, python
 Build-Conflicts: oprofile @BUILDCONFLICTS@
 Standards-Version: 3.9.3
 Homepage: http://www.llvm.org/
diff -Nru clang-3.1/debian/patches/20-vendor-ubuntu.patch clang-3.1/debian/patches/20-vendor-ubuntu.patch
--- clang-3.1/debian/patches/20-vendor-ubuntu.patch	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/20-vendor-ubuntu.patch	2012-11-14 14:15:49.000000000 +0000
@@ -0,0 +1,15 @@
+Index: clang-3.0/tools/clang/Makefile
+===================================================================
+--- clang-3.0.orig/tools/clang/Makefile	2011-12-05 01:00:56.742977627 +0100
++++ clang-3.0/tools/clang/Makefile	2011-12-05 01:01:07.266977393 +0100
+@@ -43,9 +43,7 @@
+ 
+ # Set common Clang build flags.
+ CPP.Flags += -I$(PROJ_SRC_DIR)/$(CLANG_LEVEL)/include -I$(PROJ_OBJ_DIR)/$(CLANG_LEVEL)/include
+-ifdef CLANG_VENDOR
+-CPP.Flags += -DCLANG_VENDOR='"$(CLANG_VENDOR) "'
+-endif
++CPP.Flags += -DCLANG_VENDOR='"Ubuntu "'
+ ifdef CLANG_REPOSITORY_STRING
+ CPP.Flags += -DCLANG_REPOSITORY_STRING='"$(CLANG_REPOSITORY_STRING)"'
+ endif
diff -Nru clang-3.1/debian/patches/23-ubuntu-name.diff clang-3.1/debian/patches/23-ubuntu-name.diff
--- clang-3.1/debian/patches/23-ubuntu-name.diff	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/23-ubuntu-name.diff	2012-11-14 14:36:38.000000000 +0000
@@ -0,0 +1,59 @@
+Index: b/tools/clang/lib/Driver/ToolChains.cpp
+===================================================================
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -1840,6 +1840,8 @@
+   UbuntuNatty,
+   UbuntuOneiric,
+   UbuntuPrecise,
++  UbuntuQuantal,
++  UbuntuRaring,
+   UnknownDistro
+ };
+ 
+@@ -1857,7 +1859,7 @@
+ }
+ 
+ static bool IsUbuntu(enum LinuxDistro Distro) {
+-  return Distro >= UbuntuHardy && Distro <= UbuntuPrecise;
++  return Distro >= UbuntuHardy && Distro <= UbuntuRaring;
+ }
+ 
+ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
+@@ -1866,6 +1868,7 @@
+     StringRef Data = File.get()->getBuffer();
+     SmallVector<StringRef, 8> Lines;
+     Data.split(Lines, "\n");
++    bool ubuntu = false;
+     LinuxDistro Version = UnknownDistro;
+     for (unsigned i = 0, s = Lines.size(); i != s; ++i)
+       if (Version == UnknownDistro && Lines[i].startswith("DISTRIB_CODENAME="))
+@@ -1879,7 +1882,15 @@
+           .Case("natty", UbuntuNatty)
+           .Case("oneiric", UbuntuOneiric)
+           .Case("precise", UbuntuPrecise)
++          .Case("quantal", UbuntuQuantal)
++          .Case("raring", UbuntuRaring)
+           .Default(UnknownDistro);
++      else if (Version == UnknownDistro && Lines[i].startswith("DISTRIB_ID=Ubuntu"))
++        ubuntu = true;
++    if (ubuntu)
++      // Assume unknown Ubuntu releases behave like raring, until we
++      // know otherwise.
++      return UbuntuRaring;
+     return Version;
+   }
+ 
+@@ -2036,6 +2047,12 @@
+   if (IsRedhat(Distro))
+     ExtraOpts.push_back("--no-add-needed");
+ 
++  if (Distro == UbuntuOneiric)
++    ExtraOpts.push_back("--no-copy-dt-needed-entries");
++
++  if (IsUbuntu(Distro) && Distro >= UbuntuOneiric)
++    ExtraOpts.push_back("--as-needed");
++
+   if (Distro == DebianSqueeze || Distro == DebianWheezy ||
+       IsOpenSuse(Distro) ||
+       (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
diff -Nru clang-3.1/debian/patches/24-linkerflags.patch clang-3.1/debian/patches/24-linkerflags.patch
--- clang-3.1/debian/patches/24-linkerflags.patch	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/24-linkerflags.patch	2012-11-14 14:15:49.000000000 +0000
@@ -0,0 +1,16 @@
+Index: tools/clang/lib/Driver/ToolChains.cpp
+===================================================================
+--- tools/clang/lib/Driver/ToolChains.cpp	(révision 144213)
++++ tools/clang/lib/Driver/ToolChains.cpp	(copie de travail)
+@@ -1818,6 +1818,11 @@
+   if (IsRedhat(Distro))
+     ExtraOpts.push_back("--no-add-needed");
+ 
++  /* See: http://wiki.debian.org/ToolChain/DSOLinking */
++  if (IsDebian(Distro))
++    ExtraOpts.push_back("--no-copy-dt-needed-entries");
++
++
+   if (Distro == DebianSqueeze || Distro == DebianWheezy ||
+       IsOpenSuse(Distro) ||
+       (IsRedhat(Distro) && Distro != RHEL4 && Distro != RHEL5) ||
diff -Nru clang-3.1/debian/patches/25-armhf-linker-name.diff clang-3.1/debian/patches/25-armhf-linker-name.diff
--- clang-3.1/debian/patches/25-armhf-linker-name.diff	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/25-armhf-linker-name.diff	2012-11-14 15:23:46.000000000 +0000
@@ -0,0 +1,77 @@
+Index: b/tools/clang/lib/Driver/Tools.cpp
+===================================================================
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -615,11 +615,18 @@
+         FloatABI = "softfp";
+         break;
+       }
++      else if (Triple.getEnvironment() == llvm::Triple::GNUEABIHF) {
++	FloatABI = "hard";
++	break;
++      }
+     }
+     // fall through
+ 
+     default:
+       switch(Triple.getEnvironment()) {
++      case llvm::Triple::GNUEABIHF:
++        FloatABI = "hard";
++        break;
+       case llvm::Triple::GNUEABI:
+         FloatABI = "softfp";
+         break;
+@@ -666,6 +673,7 @@
+     switch(Triple.getEnvironment()) {
+     case llvm::Triple::ANDROIDEABI:
+     case llvm::Triple::GNUEABI:
++    case llvm::Triple::GNUEABIHF:
+       ABIName = "aapcs-linux";
+       break;
+     case llvm::Triple::EABI:
+@@ -5214,8 +5222,14 @@
+     if (ToolChain.getArch() == llvm::Triple::x86)
+       CmdArgs.push_back("/lib/ld-linux.so.2");
+     else if (ToolChain.getArch() == llvm::Triple::arm ||
+-             ToolChain.getArch() == llvm::Triple::thumb)
++             ToolChain.getArch() == llvm::Triple::thumb) {
++      // FIXME: default triplet and command line args
++#if defined(__ARM_PCS_VFP)
++      CmdArgs.push_back("/lib/ld-linux-armhf.so.3");
++#else
+       CmdArgs.push_back("/lib/ld-linux.so.3");
++#endif
++    }
+     else if (ToolChain.getArch() == llvm::Triple::mips ||
+              ToolChain.getArch() == llvm::Triple::mipsel)
+       CmdArgs.push_back("/lib/ld.so.1");
+Index: b/tools/clang/lib/CodeGen/TargetInfo.cpp
+===================================================================
+--- a/tools/clang/lib/CodeGen/TargetInfo.cpp
++++ b/tools/clang/lib/CodeGen/TargetInfo.cpp
+@@ -2435,7 +2435,7 @@
+   bool isEABI() const {
+     StringRef Env =
+       getContext().getTargetInfo().getTriple().getEnvironmentName();
+-    return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi");
++    return (Env == "gnueabihf" || Env == "gnueabi" || Env == "eabi" || Env == "androideabi");
+   }
+ 
+ private:
+Index: b/tools/clang/lib/Driver/ToolChains.cpp
+===================================================================
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -1184,7 +1184,12 @@
+   // lifetime or initialization issues.
+   static const char *const ARMLibDirs[] = { "/lib" };
+   static const char *const ARMTriples[] = {
++    // FIXME: default triplet and command line args
++#if defined(__ARM_PCS_VFP)
++    "arm-linux-gnueabihf",
++#else
+     "arm-linux-gnueabi",
++#endif
+     "arm-linux-androideabi"
+   };
+ 
diff -Nru clang-3.1/debian/patches/26-armv7-not-neon.patch clang-3.1/debian/patches/26-armv7-not-neon.patch
--- clang-3.1/debian/patches/26-armv7-not-neon.patch	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/26-armv7-not-neon.patch	2012-11-14 15:07:43.000000000 +0000
@@ -0,0 +1,49 @@
+Description: Sort out VFP and NEON issues on armel/armhf
+ This patch adds a d16 FPU target, and makes sure that none
+ of the non-NEON FPU options enable NEON by default, as well
+ as stopping the broken assumption that all armv7/cortex-a8
+ cores support NEON.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Forwarded: no
+Reviewed-By: Colin Watson <cjwatson@ubuntu.com>
+Last-Update: 2012-04-24
+
+Index: b/tools/clang/lib/Driver/Tools.cpp
+===================================================================
+--- a/tools/clang/lib/Driver/Tools.cpp
++++ b/tools/clang/lib/Driver/Tools.cpp
+@@ -743,6 +743,16 @@
+     CmdArgs.push_back("-neon");
+   }
+ 
++  // FIXME: hideous hack for precise, REMOVE THIS AND FIX PROPERLY OH GOD
++  if (FloatABI == "hard") {
++    CmdArgs.push_back("-target-feature");
++    CmdArgs.push_back("+vfp3");
++    CmdArgs.push_back("-target-feature");
++    CmdArgs.push_back("+d16");
++    CmdArgs.push_back("-target-feature");
++    CmdArgs.push_back("-neon");
++  }
++
+   // Kernel code has more strict alignment requirements.
+   if (KernelOrKext) {
+     CmdArgs.push_back("-backend-option");
+Index: b/tools/clang/lib/Basic/Targets.cpp
+===================================================================
+--- a/tools/clang/lib/Basic/Targets.cpp
++++ b/tools/clang/lib/Basic/Targets.cpp
+@@ -2722,8 +2722,11 @@
+   void getDefaultFeatures(llvm::StringMap<bool> &Features) const {
+     if (CPU == "arm1136jf-s" || CPU == "arm1176jzf-s" || CPU == "mpcore")
+       Features["vfp2"] = true;
+-    else if (CPU == "cortex-a8" || CPU == "cortex-a9")
+-      Features["neon"] = true;
++    else if (CPU == "cortex-a8" || CPU == "cortex-a9") {
++      Features["vfp3"] = true;
++      Features["d16"] = true;
++      Features["neon"] = false;
++    }
+   }
+ 
+   virtual bool setFeatureEnabled(llvm::StringMap<bool> &Features,
diff -Nru clang-3.1/debian/patches/27-armhf-is-armv7.patch clang-3.1/debian/patches/27-armhf-is-armv7.patch
--- clang-3.1/debian/patches/27-armhf-is-armv7.patch	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/27-armhf-is-armv7.patch	2012-11-14 14:15:49.000000000 +0000
@@ -0,0 +1,19 @@
+Description: Always build armhf for cortex-a8 CPUs, never lower
+Author: Adam Conrad <adconrad@ubuntu.com>
+Forwarded: no
+Reviewed-By: Colin Watson <cjwatson@ubuntu.com>
+Last-Update: 2012-04-24
+
+--- clang-3.0.orig/tools/clang/lib/Driver/Tools.cpp
++++ clang-3.0/tools/clang/lib/Driver/Tools.cpp
+@@ -434,6 +434,10 @@ static const char *getARMTargetCPU(const
+                                    const llvm::Triple &Triple) {
+   // FIXME: Warn on inconsistent use of -mcpu and -march.
+ 
++  // always return armv7-a for GNUEABIHF
++  if (Triple.getEnvironment() == llvm::Triple::GNUEABIHF)
++    return "cortex-a8";
++
+   // If we have -mcpu=, use that.
+   if (Arg *A = Args.getLastArg(options::OPT_mcpu_EQ))
+     return A->getValue(Args);
diff -Nru clang-3.1/debian/patches/28-powerpc-no-altivec.patch clang-3.1/debian/patches/28-powerpc-no-altivec.patch
--- clang-3.1/debian/patches/28-powerpc-no-altivec.patch	1970-01-01 00:00:00.000000000 +0000
+++ clang-3.1/debian/patches/28-powerpc-no-altivec.patch	2012-11-14 14:15:49.000000000 +0000
@@ -0,0 +1,20 @@
+Description: Make sure PowerPC doesn't default to altivec on
+Author: Adam Conrad <adconrad@ubuntu.com>
+Forwarded: no
+Reviewed-By: Colin Watson <cjwatson@ubuntu.com>
+Last-Update: 2012-04-24
+
+Index: b/tools/clang/lib/Lex/Makefile
+===================================================================
+--- a/tools/clang/lib/Lex/Makefile
++++ b/tools/clang/lib/Lex/Makefile
+@@ -16,9 +16,5 @@
+ 
+ LIBRARYNAME := clangLex
+ 
+-ifeq ($(ARCH),PowerPC)
+-CXX.Flags += -maltivec
+-endif
+-
+ include $(CLANG_LEVEL)/Makefile
+ 
diff -Nru clang-3.1/debian/patches/series clang-3.1/debian/patches/series
--- clang-3.1/debian/patches/series	2012-06-25 21:31:47.000000000 +0000
+++ clang-3.1/debian/patches/series	2012-11-14 14:15:12.000000000 +0000
@@ -1,6 +1,13 @@
 18-soname.patch
 19-clang_debian_version.patch
-20-vendor.patch
+#20-vendor.patch
+20-vendor-ubuntu.patch
 21-searchPathHeaders.diff
 23-strlcpy_strlcat_warning_removed.diff
 26-disable_SplitsOnSpaces.diff
+23-ubuntu-name.diff
+25-armhf-linker-name.diff
+#24-linkerflags.patch
+26-armv7-not-neon.patch
+27-armhf-is-armv7.patch
+28-powerpc-no-altivec.patch
diff -Nru clang-3.1/debian/rules clang-3.1/debian/rules
--- clang-3.1/debian/rules	2012-06-01 12:50:18.000000000 +0000
+++ clang-3.1/debian/rules	2012-11-14 14:15:49.000000000 +0000
@@ -36,5 +36,6 @@
 endif
 	$(RM) -r $(D)/debian/ccache
 	find utils -name '*.py[co]' | xargs rm -f
+	rm -f tools/clang/include/clang/Debian/debian_path.h
 
 .PHONY: clean