diff -Nru llvm-toolchain-10-10.0.0/debian/changelog llvm-toolchain-10-10.0.0/debian/changelog
--- llvm-toolchain-10-10.0.0/debian/changelog	2020-04-10 08:27:41.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/changelog	2020-04-25 04:13:15.000000000 +0000
@@ -1,3 +1,41 @@
+llvm-toolchain-10 (1:10.0.0-4+rpi1) bullseye-staging; urgency=medium
+
+  [changes brought forward from llvm-toolchain-3.8 1:3.8-2+rpi1 by Peter Michael Green <plugwash@raspbian.org> at Sat, 14 May 2016 21:43:35 +0000]
+  * Cleanup .pyc files in clean target.
+  * Add a hack to the cmake based build to force armv6 (unfortunately the cmake
+    based build relies on config.guess which assumes you want to build for the
+    hardware you are running on).
+  * Add -DCOMPILER_RT_BUILD_BUILTINS=OFF to disable parts of compiler-rt that
+    are broken on lower arm architectures.
+
+  [changes introduced in llvm-toolchain-3.9 1:3.9.1-1 by Peter Michael Green]
+  * disable testsuite (using a method that is hopefully less likely to cause diff conflicts than previously).
+  * Remove -march=armv7-a in compiler-rt/cmake/config-ix-base.cmake
+  * Clean up debian/usr in clean target.
+  * Clean up clang/tools/*-3.9 in clean target.
+  * Clean up stray *3.9.vim files
+  * Clean up clang/tools/scan-build/man/scan-build-3.9.1 and utils/vim/llvm-3.9-vimrc
+  * Clean up debian/*.install
+
+  [changes introduced in llvm-toolchain-6.0 1:6.0-1+rpi1 by Peter michael green]
+  * create build-llvm/docs/ocamldoc/html/ so the install target doesn't complain
+    about it not existing.
+  * clean up more crap left behind by build process.
+
+  [changes introduced in llvm-toolchain-6.0 1:6.0-3+rpi1 by Peter Michael Green]
+  * Remove debian/man in clean target.
+
+  [changes introduced in llvm-toolchain-7 1:7-6+rpi1 by Peter Michael Green]
+  * Use libatomic on armhf
+  * Set cmake/config.guess.hack back to mode 644 in clean target to keep
+    git/dgit happy.
+  * Yet more clean target fixes.
+
+  [changes introduced in llvm-toolchain-7 1:7.0.1-1+rpi2 by Peter Michael Green]
+  * Change triplet in debian/rules to use armv6k rather than armv7l
+
+ -- Raspbian forward porter <root@raspbian.org>  Sat, 25 Apr 2020 04:13:15 +0000
+
 llvm-toolchain-10 (1:10.0.0-4) unstable; urgency=medium
 
   * Also ship polly libs in libclang-common-10-dev.
diff -Nru llvm-toolchain-10-10.0.0/debian/control llvm-toolchain-10-10.0.0/debian/control
--- llvm-toolchain-10-10.0.0/debian/control	2020-03-31 21:25:00.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/control	2020-04-25 04:13:15.000000000 +0000
@@ -19,7 +19,7 @@
     libctypes-ocaml-dev [amd64 arm64 armhf i386 ppc64el s390x],
     dh-exec, dh-ocaml [amd64 arm64 armhf i386 ppc64el s390x],
     libpfm4-dev [linux-any], python3-setuptools, libz3-dev
-Build-Conflicts: oprofile, ocaml
+Build-Conflicts: oprofile, ocaml, libllvm-3.8-ocaml-dev, libllvm-3.9-ocaml-dev
 Standards-Version: 4.2.1
 Homepage: https://www.llvm.org/
 Vcs-Git: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain.git -b 10
diff -Nru llvm-toolchain-10-10.0.0/debian/llvm-priv-dev.dirs llvm-toolchain-10-10.0.0/debian/llvm-priv-dev.dirs
--- llvm-toolchain-10-10.0.0/debian/llvm-priv-dev.dirs	2020-01-20 21:09:49.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/llvm-priv-dev.dirs	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-/usr/lib/llvm-3.1/build
diff -Nru llvm-toolchain-10-10.0.0/debian/morecraptoremove llvm-toolchain-10-10.0.0/debian/morecraptoremove
--- llvm-toolchain-10-10.0.0/debian/morecraptoremove	1970-01-01 00:00:00.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/morecraptoremove	2020-04-25 04:13:15.000000000 +0000
@@ -0,0 +1,103 @@
+clang/tools/scan-build-?/CMakeLists.txt
+clang/tools/scan-build-?/bin/scan-build
+clang/tools/scan-build-?/bin/scan-build.bat
+clang/tools/scan-build-?/bin/set-xcode-analyzer
+clang/tools/scan-build-?/libexec/c++-analyzer
+clang/tools/scan-build-?/libexec/c++-analyzer.bat
+clang/tools/scan-build-?/libexec/ccc-analyzer
+clang/tools/scan-build-?/libexec/ccc-analyzer.bat
+clang/tools/scan-build-?/man/scan-build-?*.1
+clang/tools/scan-build-?/man/scan-build.1
+clang/tools/scan-build-?/share/scan-build/scanview.css
+clang/tools/scan-build-?/share/scan-build/sorttable.js
+clang/tools/scan-build-py-?*/README.md
+clang/tools/scan-build-py-?*/bin/analyze-build
+clang/tools/scan-build-py-?*/bin/analyze-c++
+clang/tools/scan-build-py-?*/bin/analyze-cc
+clang/tools/scan-build-py-?*/bin/intercept-build
+clang/tools/scan-build-py-?*/bin/intercept-c++
+clang/tools/scan-build-py-?*/bin/intercept-cc
+clang/tools/scan-build-py-?*/bin/scan-build
+clang/tools/scan-build-py-?*/libear/__init__.py
+clang/tools/scan-build-py-?*/libear/config.h.in
+clang/tools/scan-build-py-?*/libear/ear.c
+clang/tools/scan-build-py-?*/libscanbuild/__init__.py
+clang/tools/scan-build-py-?*/libscanbuild/analyze.py
+clang/tools/scan-build-py-?*/libscanbuild/arguments.py
+clang/tools/scan-build-py-?*/libscanbuild/clang.py
+clang/tools/scan-build-py-?*/libscanbuild/compilation.py
+clang/tools/scan-build-py-?*/libscanbuild/intercept.py
+clang/tools/scan-build-py-?*/libscanbuild/report.py
+clang/tools/scan-build-py-?*/libscanbuild/resources/scanview.css
+clang/tools/scan-build-py-?*/libscanbuild/resources/selectable.js
+clang/tools/scan-build-py-?*/libscanbuild/resources/sorttable.js
+clang/tools/scan-build-py-?*/libscanbuild/shell.py
+clang/tools/scan-build-py-?*/tests/__init__.py
+clang/tools/scan-build-py-?*/tests/functional/cases/__init__.py
+clang/tools/scan-build-py-?*/tests/functional/cases/test_create_cdb.py
+clang/tools/scan-build-py-?*/tests/functional/cases/test_exec_anatomy.py
+clang/tools/scan-build-py-?*/tests/functional/cases/test_from_cdb.py
+clang/tools/scan-build-py-?*/tests/functional/cases/test_from_cmd.py
+clang/tools/scan-build-py-?*/tests/functional/exec/CMakeLists.txt
+clang/tools/scan-build-py-?*/tests/functional/exec/config.h.in
+clang/tools/scan-build-py-?*/tests/functional/exec/main.c
+clang/tools/scan-build-py-?*/tests/functional/src/broken-one.c
+clang/tools/scan-build-py-?*/tests/functional/src/broken-two.c
+clang/tools/scan-build-py-?*/tests/functional/src/build/Makefile
+clang/tools/scan-build-py-?*/tests/functional/src/clean-one.c
+clang/tools/scan-build-py-?*/tests/functional/src/clean-two.c
+clang/tools/scan-build-py-?*/tests/functional/src/compilation_database/build_broken.json.in
+clang/tools/scan-build-py-?*/tests/functional/src/compilation_database/build_clean.json.in
+clang/tools/scan-build-py-?*/tests/functional/src/compilation_database/build_regular.json.in
+clang/tools/scan-build-py-?*/tests/functional/src/emit-one.c
+clang/tools/scan-build-py-?*/tests/functional/src/emit-two.c
+clang/tools/scan-build-py-?*/tests/functional/src/include/clean-one.h
+clang/tools/scan-build-py-?*/tests/functional/src/main.c
+clang/tools/scan-build-py-?*/tests/unit/__init__.py
+clang/tools/scan-build-py-?*/tests/unit/test_analyze.py
+clang/tools/scan-build-py-?*/tests/unit/test_clang.py
+clang/tools/scan-build-py-?*/tests/unit/test_compilation.py
+clang/tools/scan-build-py-?*/tests/unit/test_intercept.py
+clang/tools/scan-build-py-?*/tests/unit/test_libear.py
+clang/tools/scan-build-py-?*/tests/unit/test_report.py
+clang/tools/scan-build-py-?*/tests/unit/test_shell.py
+clang/tools/scan-build/man/scan-build-?*.1
+clang/tools/scan-view-?*/CMakeLists.txt
+clang/tools/scan-view-?*/bin/scan-view
+clang/tools/scan-view-?*/share/Reporter.py
+clang/tools/scan-view-?*/share/ScanView.py
+clang/tools/scan-view-?*/share/startfile.py
+utils/vim/ftdetect/llvm-?.vim
+utils/vim/ftdetect/tablegen-?*.vim
+utils/vim/ftplugin/llvm-?*.vim
+utils/vim/ftplugin/tablegen-?*.vim
+utils/vim/indent/llvm-?*.vim
+utils/vim/llvm-?*-vimrc
+utils/vim/syntax/llvm-?*.vim
+utils/vim/syntax/tablegen-?*.vim
+debian/clang-?-doc.docs
+debian/clang-?-examples.examples
+debian/clang-?.links
+debian/clang-?.lintian-overrides
+debian/clang-?.manpages
+debian/clang-format-?.lintian-overrides
+debian/clang-format-?.manpages
+debian/clang-tidy-?.links
+debian/clang-tidy-?.lintian-overrides
+debian/clang-tidy-?.manpages
+debian/clang-tools-?.links
+debian/clang-tools-?.lintian-overrides
+debian/clang-tools-?.manpages
+debian/libc++-?-dev.links
+debian/libc++-?-dev.lintian-overrides
+debian/libc++1-?.links
+debian/libc++1-?.lintian-overrides
+debian/libc++abi-?-dev.links
+debian/libc++abi-?-dev.lintian-overrides
+debian/libc++abi1-?.links
+debian/libc++abi1-?.lintian-overrides
+debian/libclang-?-dev.links
+debian/libclang-common-?-dev.links
+debian/libclang1-?.links
+debian/libclang1-?.lintian-overrides
+debian/libclang1-?.symbols
diff -Nru llvm-toolchain-10-10.0.0/debian/patches/raspbian-triplet.patch llvm-toolchain-10-10.0.0/debian/patches/raspbian-triplet.patch
--- llvm-toolchain-10-10.0.0/debian/patches/raspbian-triplet.patch	1970-01-01 00:00:00.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/patches/raspbian-triplet.patch	2020-04-25 04:13:15.000000000 +0000
@@ -0,0 +1,32 @@
+hack to replace arm version in triplet returned by config.guess
+with the one we want for raspbian.
+
+--- /dev/null
++++ llvm-toolchain-9-9/llvm/cmake/config.guess.hack
+@@ -0,0 +1,2 @@
++#!/bin/bash -e
++$(dirname "$0")/config.guess | sed -r s/arm[a-zA-Z0-9]*/armv6/
+--- llvm-toolchain-9-9.orig/llvm/cmake/modules/GetHostTriple.cmake
++++ llvm-toolchain-9-9/llvm/cmake/modules/GetHostTriple.cmake
+@@ -18,7 +18,7 @@ function( get_host_triple var )
+     if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows AND NOT MSYS)
+       message(WARNING "unable to determine host target triple")
+     else()
+-      set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess)
++      set(config_guess ${LLVM_MAIN_SRC_DIR}/cmake/config.guess.hack)
+       execute_process(COMMAND sh ${config_guess}
+         RESULT_VARIABLE TT_RV
+         OUTPUT_VARIABLE TT_OUT
+--- llvm-toolchain-9-9.orig/compiler-rt/cmake/base-config-ix.cmake
++++ llvm-toolchain-9-9/compiler-rt/cmake/base-config-ix.cmake
+@@ -203,8 +203,8 @@ macro(test_targets)
+       if(WIN32)
+         test_target_arch(arm "" "" "")
+       else()
+-        test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft")
+-        test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard")
++        test_target_arch(arm "" "" "-mfloat-abi=soft")
++        test_target_arch(armhf "" "" "-mfloat-abi=hard")
+         test_target_arch(armv6m "" "-march=armv6m" "-mfloat-abi=soft")
+       endif()
+     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch32")
diff -Nru llvm-toolchain-10-10.0.0/debian/patches/series llvm-toolchain-10-10.0.0/debian/patches/series
--- llvm-toolchain-10-10.0.0/debian/patches/series	2020-04-09 12:01:36.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/patches/series	2020-04-25 04:13:15.000000000 +0000
@@ -6,11 +6,9 @@
 
 # Disabling features
 23-strlcpy_strlcat_warning_removed.diff
-
 declare_clear_cache.diff
 unwind-chain-inclusion.diff
 atomic_library_1.diff
-
 # Path updates
 python-clangpath.diff
 fix-clang-path-and-build.diff
@@ -19,23 +17,18 @@
 clang-tidy-run-bin.diff
 0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
 debug-jit-path.diff
-
 # commented because of bug 903709
 #force-gcc-header-obj.diff
-
 do-not-fail-on-unexpected-pass.diff
 disable-display-PASS-UNSUPPORTED-XFAIL.diff
-
 # llvm-config
 fix-llvm-config-obj-src-root.patch
 0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
-
 # Lib names
 0044-soname.diff
 lldb-soname.diff
 #lldb-libname.diff
 openmp-soname.diff
-
 # Disable some tests
 silent-gold-test.diff
 silent-more-tests.diff
@@ -48,30 +41,24 @@
 remove-test-freezing.diff
 disable-llvm-symbolizer-test.diff
 disable-path-test-failing.diff
-
 # Decrease the freq for the keep alive
 test-keep-alive.diff
-
 # scan-build
 scan-build-clang-path.diff
 install-scan-build-py.diff
 scan-view-fix-path.diff
 fix-scan-view-path.diff
-
 # lldb
 lldb/lldb-link-atomic-cmake.patch
 lldb/lldb-addversion-suffix-to-llvm-server-exec.patch
 lldb/lldb-missing-install.diff
 lldb/lldb-disable-swig-error.diff
-
 # Fix arch issue
 disable-error-xray.diff
-
 # OpenMP
 openmp/openmp-check-execstack.diff
 openmp/openmp-mips-affinity.patch
 openmp/bootstrap-with-openmp-version-export-missing.diff
-
 # libcxx
 libcxx/libcxxabi-test-don-t-fail-extended-long-double.patch
 libcxx/libcxx-test-fix-lockfree-test-for-i386.patch
@@ -80,31 +67,25 @@
 libcxx/libcxx-silent-test-libcxx.diff
 libcxx/libcxx-silent-failure-ppc64el.diff
 libcxx/libcxx-silent-failure-arm64.diff
-
 # Change default optims
 mips-fpxx-enable.diff
 26-set-correct-float-abi.diff
 clang-baseline-fix-i386.patch
 disable-sse2-old-x86.diff
 clang-arm-default-vfp3-on-armv7a.patch
-
 # For the bootstrap
 clangd-atomic-cmake.patch
-
 # Fix docs
 #  https://reviews.llvm.org/D60380
 remove-apple-clang-manpage.diff
 0049-Use-Debian-provided-MathJax-everywhere.patch
-
 # Hurd port
 hurd/hurd-cxx-paths.diff
 hurd/hurd-pathmax.diff
-
 # powerpcspe
 #powerpcspe/D49754-powerpcspe-clang.diff
 #powerpcspe/D54583-powerpcspe-double-parameter.diff
 #powerpcspe/D56703-powerpcspe-register-spilling.diff
-
 # kfreebsd
 # kfreebsd/clang_lib_Basic_Targets.diff
 # kfreebsd/CMakeLists.txt.diff
@@ -120,29 +101,23 @@
 # kfreebsd/lldb_source_Host_freebsd_Host.cpp.diff
 # kfreebsd/lldb_source_Plugins_Process_FreeBSD.diff
 # kfreebsd/tools_llvm-shlib_CMakeLists.txt.diff
-
 930008-arm.diff
 bootstrap-fix-include-next.diff
-
 # riscv64
 clang-riscv64-multiarch.diff
 D74453-riscv-atomic_cmp_xchg.diff
-
 # Compiler-rt - workaround
 workaround-bug-42994-use-linker.diff
-
 # bug 939472
 #try-to-unbreak-thinlto.diff
 D67877.patch
 disable-fuzzer-compiler-rt-x86.diff
 no-z3.patch
-
 python3-shebang.patch
 print-lldb-path.patch
 no-cgi.patch
 d21664cce1db8debe2528f36b1fbd2b8af9c9401.patch
-
 0001-systemz-allow-configuring-default-SYSTEMZ_DEFAULT_AR.patch
-
 D76596.diff
 riscv64-multilib-empty.patch
+raspbian-triplet.patch
diff -Nru llvm-toolchain-10-10.0.0/debian/rules llvm-toolchain-10-10.0.0/debian/rules
--- llvm-toolchain-10-10.0.0/debian/rules	2020-04-10 08:27:41.000000000 +0000
+++ llvm-toolchain-10-10.0.0/debian/rules	2020-04-25 04:13:15.000000000 +0000
@@ -40,7 +40,7 @@
 CXXFLAGS_EXTRA =
 CFLAGS_EXTRA =
 CONFIGURE_EXTRA =
-CMAKE_EXTRA = -DPYTHON_EXECUTABLE=/usr/bin/python3
+CMAKE_EXTRA = -DPYTHON_EXECUTABLE=/usr/bin/python3 -DCOMPILER_RT_BUILD_BUILTINS=OFF
 
 BASE_PATH	:= $(CURDIR)
 LIBCXX_EXCEPTIONS :=ON
@@ -49,7 +49,7 @@
 	LIBCXX_EXCEPTIONS :=OFF
 endif
 
-ifneq (,$(filter $(DEB_HOST_ARCH),i386 armel mips mipsel powerpc powerpcspe riscv64))
+ifneq (,$(filter $(DEB_HOST_ARCH),i386 armhf armel mips mipsel powerpc powerpcspe riscv64))
 CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-latomic" -DCMAKE_SHARED_LINKER_FLAGS="-latomic"
 endif
 
@@ -102,7 +102,7 @@
 
 ifneq (,$(findstring $(DEB_HOST_ARCH),armhf))
 # avoid an issue with openmp on armhf
-  CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=armv7l-unknown-linux-gnueabihf
+  CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=armv6k-unknown-linux-gnueabihf
 endif
 
 ifneq (,$(filter $(DEB_HOST_ARCH),mips64el))
@@ -293,6 +293,12 @@
 	@echo "GCC_VERSION=$(GCC_VERSION)"
 	@echo 'PROJECTS=$(PROJECTS_LIST)'
 
+	# add executable flag to script we added as part of triplet hack
+	# --plugwash
+	chmod 755 llvm/cmake/config.guess.hack
+	# also make sure config.guess is executable
+	chmod 755 llvm/cmake/config.guess
+	
 	for f in debian/*.in; do \
 		f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \
 		echo "$$f => $$f2"; \
@@ -533,6 +539,7 @@
 	fi
 
 override_dh_auto_install:
+	mkdir -p build-llvm/docs/ocamldoc/html/
 	# Clean up temporary files to make sure the install works
 	rm -rf $(find $(TARGET_BUILD) -wholename '*CMakeFiles*' -not -name CMakeLists.txt -a -name "*.dir" -type d)
 	# install/fast enables a make install without recompiling temporary files
@@ -770,7 +777,7 @@
 # Remove auto generated python pyc
 	find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f
 
-ifeq (${RUN_TEST},yes)
+ifeq (false,true)
 # List of the archs we know we have 100 % tests working
 ARCH_LLVM_TEST_OK := i386 amd64
 
@@ -865,6 +872,19 @@
 	rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION)
 	rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py
 	rm -rf libcxx/build libcxxabi/build
+	rm -f `find . -name '*.pyc'`
+	rm -rf debian/usr
+	rm -rf clang/tools/*-3.9
+	rm -f `find . -name '*3.9.vim'`
+	rm -f clang/tools/scan-build/man/scan-build-3.9.1 utils/vim/llvm-3.9-vimrc
+	rm -f debian/*.install
+	rm -f clang/tools/scan-view-7.0/share/FileRadar.scpt clang/tools/scan-view-7.0/share/bugcatcher.ico
+	rm -f `cat debian/morecraptoremove`
+	rm -rf debian/man
+	rm -f debian/*.links debian/c*.lintian-overrides debian/l*.lintian-overrides debian/*.META debian/*.dirs debian/*.docs debian/*.symbols debian/*.postinst debian/*.manpages debian/*.examples debian/*.binfmt debian/*.prerm
+	-rmdir clang/include/clang/Debian/
+	-rmdir lldb/docs/doc/
+	chmod 644 llvm/cmake/config.guess.hack
 	if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \
 		mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \
 	fi