From 6b104584bab31988818b6b9d1f5a0649c08545af Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 5 Oct 2019 14:58:48 -0700 Subject: clang: Fix openmp build on armv7ve Refresh patches on latest release/9.x branch Signed-off-by: Khem Raj --- ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 25 ----- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 2 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 2 +- ...er-rt-support-a-new-embedded-linux-target.patch | 2 +- ...-Simplify-cross-compilation.-Don-t-use-na.patch | 2 +- ...0005-compiler-rt-Disable-tsan-on-OE-glibc.patch | 2 +- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 2 +- .../0007-llvm-allow-env-override-of-exe-path.patch | 2 +- .../0008-llvm-Enhance-path-prefix-mapping.patch | 2 +- .../0009-clang-Enable-SSP-and-PIE-by-default.patch | 2 +- .../0010-clang-driver-Use-lib-for-ldso-on-OE.patch | 2 +- ...iver-tools.cpp-Add-lssp_nonshared-on-musl.patch | 2 +- ...-ppc-does-not-support-128-bit-long-double.patch | 2 +- .../0013-clang-Prepend-trailing-to-sysroot.patch | 2 +- ...inside-the-target-sysroot-for-compiler-ru.patch | 2 +- ...ang-Define-releative-gcc-installation-dir.patch | 2 +- ...dso-for-musl-on-x86-and-x32-architectures.patch | 2 +- .../0017-clang-scan-view-needs-python-2.x.patch | 2 +- ...al-implementation-of-fmacro-prefix-map-an.patch | 12 +-- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 2 +- ...clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch | 6 +- ...ritize-SYSROOT-usr-include-over-RESOURCE_.patch | 115 +++++++++++++++++++++ ...ritize-SYSROOT-usr-include-over-RESOURCE_.patch | 115 --------------------- ...upport-for-floating-point-registers-in-in.patch | 103 ++++++++++++++++++ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 22 ++++ ...upport-for-floating-point-registers-in-in.patch | 103 ------------------ ...024-openmp-Recognise-ARMv7ve-machine-arch.patch | 28 +++++ recipes-devtools/clang/common.inc | 7 +- 28 files changed, 299 insertions(+), 273 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch create mode 100644 recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch delete mode 100644 recipes-devtools/clang/clang/0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch create mode 100644 recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch create mode 100644 recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0023-RISCV-Add-support-for-floating-point-registers-in-in.patch create mode 100644 recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch (limited to 'recipes-devtools') diff --git a/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch deleted file mode 100644 index ab3c837..0000000 --- a/recipes-devtools/clang/clang/0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 112a89e845333ae98e9802c5ac5a4761032e08de Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Wed, 18 Sep 2019 12:56:58 +0800 -Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build - -Signed-off-by: Anuj Mittal ---- - llvm/cmake/modules/CrossCompile.cmake | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake -index d6b4161..7fae108 100644 ---- a/llvm/cmake/modules/CrossCompile.cmake -+++ b/llvm/cmake/modules/CrossCompile.cmake -@@ -62,6 +62,7 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype) - -DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}" - -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" - -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" -+ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" - ${build_type_flags} ${linker_flag} ${external_clang_dir} - WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} - DEPENDS CREATE_LLVM_${target_name} --- -2.7.4 - diff --git a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch index 830679d..db200b4 100644 --- a/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch +++ b/recipes-devtools/clang/clang/0001-lldb-Add-lxml2-to-linker-cmdline-of-xml-is-found.patch @@ -1,4 +1,4 @@ -From b0c9e7f42b975ee028726972a3c1298dda1a9e5d Mon Sep 17 00:00:00 2001 +From 71040ed1f04234ddb7498f834780a7dcaee1fbf1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 22 May 2017 17:36:16 -0700 Subject: [PATCH] lldb: Add -lxml2 to linker cmdline of xml is found diff --git a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch index 6d7588c..32b0d39 100644 --- a/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch +++ b/recipes-devtools/clang/clang/0002-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch @@ -1,4 +1,4 @@ -From 90be1a0713994d6ca8885e1424950217472dfda8 Mon Sep 17 00:00:00 2001 +From aa5d4a3e2c24b5229d8170e518aa91623d15f197 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 27 Aug 2017 10:37:49 -0700 Subject: [PATCH] libcxxabi: Find libunwind headers when diff --git a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch index 716ac9a..796b965 100644 --- a/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch +++ b/recipes-devtools/clang/clang/0003-compiler-rt-support-a-new-embedded-linux-target.patch @@ -1,4 +1,4 @@ -From 640c60ad80ab9c2d577e3ac2288f8e9939b795d1 Mon Sep 17 00:00:00 2001 +From f0ae2066cccbe1095eb60bd41f53444fd01c2434 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 19 Apr 2015 15:16:23 -0700 Subject: [PATCH] compiler-rt: support a new embedded linux target diff --git a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch index a44524a..8bccb02 100644 --- a/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch +++ b/recipes-devtools/clang/clang/0004-compiler-rt-Simplify-cross-compilation.-Don-t-use-na.patch @@ -1,4 +1,4 @@ -From a4ba0165332198f7a2fc5401d8ecc2b020b48187 Mon Sep 17 00:00:00 2001 +From 785464a219c4d37ef9542e3674dcafdaa945a472 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:11:45 -0700 Subject: [PATCH] compiler-rt: Simplify cross-compilation. Don't use diff --git a/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch b/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch index cf72939..60ee7fb 100644 --- a/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch +++ b/recipes-devtools/clang/clang/0005-compiler-rt-Disable-tsan-on-OE-glibc.patch @@ -1,4 +1,4 @@ -From e290face40ffc3076d438e7808604974b04658bb Mon Sep 17 00:00:00 2001 +From 085fe7fd35c5f6b801c4a3aff1df6007259668fa Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Jul 2016 08:05:02 +0000 Subject: [PATCH] compiler-rt: Disable tsan on OE/glibc diff --git a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index 7167faa..b09b8ef 100644 --- a/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0006-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,4 +1,4 @@ -From dbeecdb307be8b783b42cbc89dcb9c5e7f528989 Mon Sep 17 00:00:00 2001 +From 187ca963c2d6faa84ea9f33c1c895e0b2702f116 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 Subject: [PATCH] llvm: TargetLibraryInfo: Undefine libc functions if they are diff --git a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch index 58dce51..40aedfd 100644 --- a/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch +++ b/recipes-devtools/clang/clang/0007-llvm-allow-env-override-of-exe-path.patch @@ -1,4 +1,4 @@ -From 61b00e1e051e367f5483d7b5253b6c85a9e8a90f Mon Sep 17 00:00:00 2001 +From a5cfe77db04dcab424dfbc5cb98d9566228cf9b5 Mon Sep 17 00:00:00 2001 From: Martin Kelly Date: Fri, 19 May 2017 00:22:57 -0700 Subject: [PATCH] llvm: allow env override of exe path diff --git a/recipes-devtools/clang/clang/0008-llvm-Enhance-path-prefix-mapping.patch b/recipes-devtools/clang/clang/0008-llvm-Enhance-path-prefix-mapping.patch index a59fe4c..7ad9d6b 100644 --- a/recipes-devtools/clang/clang/0008-llvm-Enhance-path-prefix-mapping.patch +++ b/recipes-devtools/clang/clang/0008-llvm-Enhance-path-prefix-mapping.patch @@ -1,4 +1,4 @@ -From 1bff6786db082e020179cc14d2aa993244351ac0 Mon Sep 17 00:00:00 2001 +From ccb11131c6a82b4fcdeb777015b74dff55abcd1a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 15 Feb 2019 11:32:09 -0800 Subject: [PATCH] llvm: Enhance path prefix mapping diff --git a/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch b/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch index e9672c1..a732a5e 100644 --- a/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch +++ b/recipes-devtools/clang/clang/0009-clang-Enable-SSP-and-PIE-by-default.patch @@ -1,4 +1,4 @@ -From 549a201d29521e8c5dd2b21cc12df0ef1e33aa72 Mon Sep 17 00:00:00 2001 +From fa7c046b11dc21b613ec7033b0f5e7b0658f7c70 Mon Sep 17 00:00:00 2001 From: Evangelos Foutras Date: Thu, 20 Sep 2018 06:20:28 +0300 Subject: [PATCH] clang: Enable SSP and PIE by default diff --git a/recipes-devtools/clang/clang/0010-clang-driver-Use-lib-for-ldso-on-OE.patch b/recipes-devtools/clang/clang/0010-clang-driver-Use-lib-for-ldso-on-OE.patch index 43df539..a169e0a 100644 --- a/recipes-devtools/clang/clang/0010-clang-driver-Use-lib-for-ldso-on-OE.patch +++ b/recipes-devtools/clang/clang/0010-clang-driver-Use-lib-for-ldso-on-OE.patch @@ -1,4 +1,4 @@ -From 9ed63a91328af8723094198e6d0280794f5f55ab Mon Sep 17 00:00:00 2001 +From 75628b5ab0ea3e4d633f15dbab6dd16cf2e35ee2 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 21:52:36 -0700 Subject: [PATCH] clang: driver: Use /lib for ldso on OE diff --git a/recipes-devtools/clang/clang/0011-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch b/recipes-devtools/clang/clang/0011-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch index 1ea3b29..149c71d 100644 --- a/recipes-devtools/clang/clang/0011-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch +++ b/recipes-devtools/clang/clang/0011-clang-Driver-tools.cpp-Add-lssp_nonshared-on-musl.patch @@ -1,4 +1,4 @@ -From e233d35f2ec7c5c4a6a957e9c29cd2663dd297df Mon Sep 17 00:00:00 2001 +From 9a11a10ae400b590a9465e16e9019f33facf9d22 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 21:11:06 -0700 Subject: [PATCH] clang: Driver/tools.cpp: Add -lssp_nonshared on musl diff --git a/recipes-devtools/clang/clang/0012-clang-musl-ppc-does-not-support-128-bit-long-double.patch b/recipes-devtools/clang/clang/0012-clang-musl-ppc-does-not-support-128-bit-long-double.patch index c8258d7..939af8a 100644 --- a/recipes-devtools/clang/clang/0012-clang-musl-ppc-does-not-support-128-bit-long-double.patch +++ b/recipes-devtools/clang/clang/0012-clang-musl-ppc-does-not-support-128-bit-long-double.patch @@ -1,4 +1,4 @@ -From b3018df63c758b97774f03873a9e5fed2d6a3db7 Mon Sep 17 00:00:00 2001 +From 6d7d4ac713e3ab01e09cf61dd62d6c663a63dd4e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 May 2016 02:00:11 -0700 Subject: [PATCH] clang: musl/ppc does not support 128-bit long double diff --git a/recipes-devtools/clang/clang/0013-clang-Prepend-trailing-to-sysroot.patch b/recipes-devtools/clang/clang/0013-clang-Prepend-trailing-to-sysroot.patch index f86adf5..89cc5be 100644 --- a/recipes-devtools/clang/clang/0013-clang-Prepend-trailing-to-sysroot.patch +++ b/recipes-devtools/clang/clang/0013-clang-Prepend-trailing-to-sysroot.patch @@ -1,4 +1,4 @@ -From 1e461b2dccddf36ec436fd8535441248bde41603 Mon Sep 17 00:00:00 2001 +From dcbb050659b37f397238754ac005fec806aca558 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 09:02:13 -0700 Subject: [PATCH] clang: Prepend trailing '/' to sysroot diff --git a/recipes-devtools/clang/clang/0014-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch b/recipes-devtools/clang/clang/0014-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch index 8262bfd..aa23abf 100644 --- a/recipes-devtools/clang/clang/0014-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch +++ b/recipes-devtools/clang/clang/0014-clang-Look-inside-the-target-sysroot-for-compiler-ru.patch @@ -1,4 +1,4 @@ -From d4b1a6b0a4dd8921fb90cf542599405027c74441 Mon Sep 17 00:00:00 2001 +From 0e247141b80454d248c51a3139ed7e3cc3d149f3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 16 Mar 2017 19:06:26 -0700 Subject: [PATCH] clang: Look inside the target sysroot for compiler runtime diff --git a/recipes-devtools/clang/clang/0015-clang-Define-releative-gcc-installation-dir.patch b/recipes-devtools/clang/clang/0015-clang-Define-releative-gcc-installation-dir.patch index 5c84ddb..d6ee1bb 100644 --- a/recipes-devtools/clang/clang/0015-clang-Define-releative-gcc-installation-dir.patch +++ b/recipes-devtools/clang/clang/0015-clang-Define-releative-gcc-installation-dir.patch @@ -1,4 +1,4 @@ -From 5be8337e8c28fc45c4b33ffcabe6d46a9f018cf5 Mon Sep 17 00:00:00 2001 +From 59debafd7650bf0af1e88ed6a461f14590f39b26 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 21 May 2017 15:38:25 -0700 Subject: [PATCH] clang: Define / releative gcc installation dir diff --git a/recipes-devtools/clang/clang/0016-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch b/recipes-devtools/clang/clang/0016-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch index b35fec1..3410d2f 100644 --- a/recipes-devtools/clang/clang/0016-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch +++ b/recipes-devtools/clang/clang/0016-clang-Fix-ldso-for-musl-on-x86-and-x32-architectures.patch @@ -1,4 +1,4 @@ -From f569a8c2b723d0a1e70e8e45e275636789eeb6e1 Mon Sep 17 00:00:00 2001 +From a105a76862d92ad15520671971e333222618d275 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 16 Aug 2017 15:16:15 -0700 Subject: [PATCH] clang: Fix ldso for musl on x86 and x32 architectures diff --git a/recipes-devtools/clang/clang/0017-clang-scan-view-needs-python-2.x.patch b/recipes-devtools/clang/clang/0017-clang-scan-view-needs-python-2.x.patch index 8d24325..a063925 100644 --- a/recipes-devtools/clang/clang/0017-clang-scan-view-needs-python-2.x.patch +++ b/recipes-devtools/clang/clang/0017-clang-scan-view-needs-python-2.x.patch @@ -1,4 +1,4 @@ -From 4a4a3cc72b59e82e6d14679bfa07c0c5afec96d1 Mon Sep 17 00:00:00 2001 +From b95744a9edf853fa4d8a4ed813760d8b2d8595b6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 15 May 2018 10:28:43 -0700 Subject: [PATCH] clang: scan-view needs python 2.x diff --git a/recipes-devtools/clang/clang/0018-clang-Initial-implementation-of-fmacro-prefix-map-an.patch b/recipes-devtools/clang/clang/0018-clang-Initial-implementation-of-fmacro-prefix-map-an.patch index facef80..b570ac2 100644 --- a/recipes-devtools/clang/clang/0018-clang-Initial-implementation-of-fmacro-prefix-map-an.patch +++ b/recipes-devtools/clang/clang/0018-clang-Initial-implementation-of-fmacro-prefix-map-an.patch @@ -1,4 +1,4 @@ -From 6c8fcbbcce2003de4c7df649c01fbe0479405cf0 Mon Sep 17 00:00:00 2001 +From ba1d096576732493155834256698bfd3020790b3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 15 Feb 2019 10:02:52 -0800 Subject: [PATCH] clang: Initial implementation of -fmacro-prefix-map and @@ -27,10 +27,10 @@ Signed-off-by: Khem Raj create mode 100644 clang/test/Preprocessor/file_test.h diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td -index eab453ee20e..adee339938e 100644 +index 12f1a7f6c48..0f8e94dad66 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td -@@ -143,8 +143,8 @@ def err_drv_missing_arg_mtp : Error< +@@ -141,8 +141,8 @@ def err_drv_missing_arg_mtp : Error< "missing argument to '%0'">; def err_drv_invalid_libcxx_deployment : Error< "invalid deployment target for -stdlib=libc++ (requires %0 or later)">; @@ -111,10 +111,10 @@ index 7edbea86633..7077d0f043c 100644 /// Cache that maps VLA types to size expressions for that type, /// represented by instantiated Metadata nodes. diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp -index 2508178423b..38970814432 100644 +index dd461a1976d..08165a60206 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp -@@ -617,16 +617,30 @@ static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs, +@@ -618,16 +618,30 @@ static void addDebugCompDirArg(const ArgList &Args, ArgStringList &CmdArgs) { /// Add a CC1 and CC1AS option to specify the debug file path prefix map. static void addDebugPrefixMapArg(const Driver &D, const ArgList &Args, ArgStringList &CmdArgs) { @@ -147,7 +147,7 @@ index 2508178423b..38970814432 100644 /// Vectorize at all optimization levels greater than 1 except for -Oz. /// For -Oz the loop vectorizer is disabled, while the slp vectorizer is /// enabled. -@@ -1311,6 +1325,8 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, +@@ -1317,6 +1331,8 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, // For IAMCU add special include arguments. getToolChain().AddIAMCUIncludeArgs(Args, CmdArgs); } diff --git a/recipes-devtools/clang/clang/0019-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch b/recipes-devtools/clang/clang/0019-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch index f1026c3..aa4ad22 100644 --- a/recipes-devtools/clang/clang/0019-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch +++ b/recipes-devtools/clang/clang/0019-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch @@ -1,4 +1,4 @@ -From 52ce78a53a6fd63547a2e2d2977784711b10377e Mon Sep 17 00:00:00 2001 +From 743e7a4f6e2f74e846151f07e498b3124ae73e71 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Jul 2019 22:51:39 -0700 Subject: [PATCH] clang: Add -lpthread and -ldl along with -lunwind for static diff --git a/recipes-devtools/clang/clang/0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch b/recipes-devtools/clang/clang/0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch index cc20795..735a8cb 100644 --- a/recipes-devtools/clang/clang/0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch +++ b/recipes-devtools/clang/clang/0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch @@ -1,4 +1,4 @@ -From 84e077c32b919c358b6c94cffe425acfdaddfa6a Mon Sep 17 00:00:00 2001 +From 084a896c2032cec87d6ef073ca1ee562cf3d3b95 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 12 Aug 2019 08:59:28 -0700 Subject: [PATCH] clang: default to lp64d ABI and rv64gc ISA @@ -35,10 +35,10 @@ index b6768de4d29..9671ea270ef 100644 + return Triple.getArch() == llvm::Triple::riscv32 ? "ilp32" : "lp64d"; } diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp -index 38970814432..29db0ea218a 100644 +index 08165a60206..c6882f74e93 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp -@@ -1872,7 +1872,7 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args, +@@ -1878,7 +1878,7 @@ void Clang::AddRISCVTargetArgs(const ArgList &Args, else if (Triple.getArch() == llvm::Triple::riscv32) ABIName = "ilp32"; else if (Triple.getArch() == llvm::Triple::riscv64) diff --git a/recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch b/recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch new file mode 100644 index 0000000..848aaf6 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch @@ -0,0 +1,115 @@ +From 71f2e313d9000b6b96d0277e45d3afe44c5b6bfb Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Tue, 6 Aug 2019 06:25:32 +0000 +Subject: [PATCH] [Driver] Prioritize SYSROOT/usr/include over + RESOURCE_DIR/include on linux-musl + +On a musl-based Linux distribution, stdalign.h stdarg.h stdbool.h stddef.h stdint.h stdnoreturn.h are expected to be provided by musl (/usr/include), instead of RESOURCE_DIR/include. +Reorder RESOURCE_DIR/include to fix the search order problem. +(Currently musl doesn't provide stdatomic.h. stdatomic.h is still found in RESOURCE_DIR/include.) + +gcc on musl has a similar search order: + +``` + /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0 + /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/x86_64-alpine-linux-musl + /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/backward + /usr/local/include + /usr/include/fortify + /usr/include + /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/include +``` + +This is different from a glibc-based distribution where RESOURCE_DIR/include is placed before SYSROOT/usr/include. + +According to the maintainer of musl: + +> musl does not support use/mixing of compiler-provided std headers with its headers, and intentionally has no mechanism for communicating with such headers as to which types have already been defined or still need to be defined. If the current include order, with clang's headers before the libc ones, works in some situations, it's only by accident. + +Reviewed by: phosek + +Differential Revision: https://reviews.llvm.org/D65699 + +llvm-svn: 367981 +--- + clang/lib/Driver/ToolChains/Linux.cpp | 13 ++++--- + .../test/Driver/linux-musl-header-search.cpp | 39 +++++++++++++++++++ + 2 files changed, 47 insertions(+), 5 deletions(-) + create mode 100644 clang/test/Driver/linux-musl-header-search.cpp + +diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp +index fc7d6c17484..ff671fe27d2 100644 +--- a/clang/lib/Driver/ToolChains/Linux.cpp ++++ b/clang/lib/Driver/ToolChains/Linux.cpp +@@ -668,11 +668,11 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs, + if (!DriverArgs.hasArg(options::OPT_nostdlibinc)) + addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include"); + +- if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { +- SmallString<128> P(D.ResourceDir); +- llvm::sys::path::append(P, "include"); +- addSystemInclude(DriverArgs, CC1Args, P); +- } ++ SmallString<128> ResourceDirInclude(D.ResourceDir); ++ llvm::sys::path::append(ResourceDirInclude, "include"); ++ if (!DriverArgs.hasArg(options::OPT_nobuiltininc) && ++ (!getTriple().isMusl() || DriverArgs.hasArg(options::OPT_nostdlibinc))) ++ addSystemInclude(DriverArgs, CC1Args, ResourceDirInclude); + + if (DriverArgs.hasArg(options::OPT_nostdlibinc)) + return; +@@ -870,6 +870,9 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs, + addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); + + addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); ++ ++ if (!DriverArgs.hasArg(options::OPT_nobuiltininc) && getTriple().isMusl()) ++ addSystemInclude(DriverArgs, CC1Args, ResourceDirInclude); + } + + static std::string DetectLibcxxIncludePath(llvm::vfs::FileSystem &vfs, +diff --git a/clang/test/Driver/linux-musl-header-search.cpp b/clang/test/Driver/linux-musl-header-search.cpp +new file mode 100644 +index 00000000000..9fee0360068 +--- /dev/null ++++ b/clang/test/Driver/linux-musl-header-search.cpp +@@ -0,0 +1,39 @@ ++// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ ++// RUN: -target x86_64-linux-musl -stdlib=libc++ \ ++// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ ++// RUN: -resource-dir=%S/Inputs/resource_dir \ ++// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ ++// RUN: | FileCheck --check-prefix=CHECK-X86-64-LIBCXX %s ++ ++// RESOURCE_DIR/include comes after /usr/include on linux-musl. ++// This is different from a glibc-based distribution. ++// CHECK-X86-64-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" ++// CHECK-X86-64-LIBCXX: "-isysroot" "[[SYSROOT:[^"]+]]" ++// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1" ++// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/local/include" ++// CHECK-X86-64-LIBCXX: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" ++// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" ++ ++// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nobuiltininc 2>&1 \ ++// RUN: -target x86_64-linux-musl \ ++// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ ++// RUN: -resource-dir=%S/Inputs/resource_dir \ ++// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ ++// RUN: | FileCheck --check-prefix=CHECK-NOBUILTININC %s ++ ++// CHECK-NOBUILTININC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" ++// CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" ++ ++// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nostdlibinc 2>&1 \ ++// RUN: -target x86_64-linux-musl \ ++// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ ++// RUN: -resource-dir=%S/Inputs/resource_dir \ ++// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ ++// RUN: | FileCheck --check-prefix=CHECK-NOSTDLIBINC %s ++ ++// CHECK-NOSTDLIBINC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" ++// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" ++// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" ++// CHECK-NOSTDLIBINC: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" ++// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" ++// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" diff --git a/recipes-devtools/clang/clang/0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch b/recipes-devtools/clang/clang/0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch deleted file mode 100644 index df2d496..0000000 --- a/recipes-devtools/clang/clang/0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch +++ /dev/null @@ -1,115 +0,0 @@ -From c2a7db3073f1991ee3be8e61acb750b40bbd71f3 Mon Sep 17 00:00:00 2001 -From: Fangrui Song -Date: Tue, 6 Aug 2019 06:25:32 +0000 -Subject: [PATCH] [Driver] Prioritize SYSROOT/usr/include over - RESOURCE_DIR/include on linux-musl - -On a musl-based Linux distribution, stdalign.h stdarg.h stdbool.h stddef.h stdint.h stdnoreturn.h are expected to be provided by musl (/usr/include), instead of RESOURCE_DIR/include. -Reorder RESOURCE_DIR/include to fix the search order problem. -(Currently musl doesn't provide stdatomic.h. stdatomic.h is still found in RESOURCE_DIR/include.) - -gcc on musl has a similar search order: - -``` - /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0 - /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/x86_64-alpine-linux-musl - /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../include/c++/8.3.0/backward - /usr/local/include - /usr/include/fortify - /usr/include - /usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/include -``` - -This is different from a glibc-based distribution where RESOURCE_DIR/include is placed before SYSROOT/usr/include. - -According to the maintainer of musl: - -> musl does not support use/mixing of compiler-provided std headers with its headers, and intentionally has no mechanism for communicating with such headers as to which types have already been defined or still need to be defined. If the current include order, with clang's headers before the libc ones, works in some situations, it's only by accident. - -Reviewed by: phosek - -Differential Revision: https://reviews.llvm.org/D65699 - -llvm-svn: 367981 ---- - clang/lib/Driver/ToolChains/Linux.cpp | 13 ++++--- - .../test/Driver/linux-musl-header-search.cpp | 39 +++++++++++++++++++ - 2 files changed, 47 insertions(+), 5 deletions(-) - create mode 100644 clang/test/Driver/linux-musl-header-search.cpp - -diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index fc7d6c17484..ff671fe27d2 100644 ---- a/clang/lib/Driver/ToolChains/Linux.cpp -+++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -668,11 +668,11 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs, - if (!DriverArgs.hasArg(options::OPT_nostdlibinc)) - addSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/local/include"); - -- if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { -- SmallString<128> P(D.ResourceDir); -- llvm::sys::path::append(P, "include"); -- addSystemInclude(DriverArgs, CC1Args, P); -- } -+ SmallString<128> ResourceDirInclude(D.ResourceDir); -+ llvm::sys::path::append(ResourceDirInclude, "include"); -+ if (!DriverArgs.hasArg(options::OPT_nobuiltininc) && -+ (!getTriple().isMusl() || DriverArgs.hasArg(options::OPT_nostdlibinc))) -+ addSystemInclude(DriverArgs, CC1Args, ResourceDirInclude); - - if (DriverArgs.hasArg(options::OPT_nostdlibinc)) - return; -@@ -870,6 +870,9 @@ void Linux::AddClangSystemIncludeArgs(const ArgList &DriverArgs, - addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); - - addExternCSystemInclude(DriverArgs, CC1Args, SysRoot + "/usr/include"); -+ -+ if (!DriverArgs.hasArg(options::OPT_nobuiltininc) && getTriple().isMusl()) -+ addSystemInclude(DriverArgs, CC1Args, ResourceDirInclude); - } - - static std::string DetectLibcxxIncludePath(llvm::vfs::FileSystem &vfs, -diff --git a/clang/test/Driver/linux-musl-header-search.cpp b/clang/test/Driver/linux-musl-header-search.cpp -new file mode 100644 -index 00000000000..9fee0360068 ---- /dev/null -+++ b/clang/test/Driver/linux-musl-header-search.cpp -@@ -0,0 +1,39 @@ -+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \ -+// RUN: -target x86_64-linux-musl -stdlib=libc++ \ -+// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ -+// RUN: -resource-dir=%S/Inputs/resource_dir \ -+// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ -+// RUN: | FileCheck --check-prefix=CHECK-X86-64-LIBCXX %s -+ -+// RESOURCE_DIR/include comes after /usr/include on linux-musl. -+// This is different from a glibc-based distribution. -+// CHECK-X86-64-LIBCXX: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -+// CHECK-X86-64-LIBCXX: "-isysroot" "[[SYSROOT:[^"]+]]" -+// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1" -+// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[SYSROOT]]/usr/local/include" -+// CHECK-X86-64-LIBCXX: "-internal-externc-isystem" "[[SYSROOT]]/usr/include" -+// CHECK-X86-64-LIBCXX: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" -+ -+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nobuiltininc 2>&1 \ -+// RUN: -target x86_64-linux-musl \ -+// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ -+// RUN: -resource-dir=%S/Inputs/resource_dir \ -+// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ -+// RUN: | FileCheck --check-prefix=CHECK-NOBUILTININC %s -+ -+// CHECK-NOBUILTININC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -+// CHECK-NOBUILTININC-NOT: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" -+ -+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only -nostdlibinc 2>&1 \ -+// RUN: -target x86_64-linux-musl \ -+// RUN: -ccc-install-dir %S/Inputs/basic_linux_tree/usr/bin \ -+// RUN: -resource-dir=%S/Inputs/resource_dir \ -+// RUN: --sysroot=%S/Inputs/basic_linux_libcxx_tree --gcc-toolchain= \ -+// RUN: | FileCheck --check-prefix=CHECK-NOSTDLIBINC %s -+ -+// CHECK-NOSTDLIBINC: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]" -+// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" -+// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" -+// CHECK-NOSTDLIBINC: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include" -+// CHECK-NOSTDLIBINC-NOT: "-internal-externc-isystem" -+// CHECK-NOSTDLIBINC-NOT: "-internal-isystem" diff --git a/recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch b/recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch new file mode 100644 index 0000000..ba7d901 --- /dev/null +++ b/recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch @@ -0,0 +1,103 @@ +From 3169f6e41fa8f3a25fabfa905cb902ae555bf21b Mon Sep 17 00:00:00 2001 +From: Simon Cook +Date: Wed, 31 Jul 2019 09:12:00 +0000 +Subject: [PATCH] [RISCV] Add support for floating point registers in inlineasm + +This adds support for parsing/emitting in IR the floating-point RISC-V +registers in inline assembly clobber lists. + +Differential Revision: https://reviews.llvm.org/D64737 + +llvm-svn: 367399 +--- + clang/lib/Basic/Targets/RISCV.cpp | 33 ++++++++++++++++++++++--------- + clang/test/Sema/riscv-asm.c | 28 ++++++++++++++++++++++++++ + 2 files changed, 52 insertions(+), 9 deletions(-) + create mode 100644 clang/test/Sema/riscv-asm.c + +diff --git a/clang/lib/Basic/Targets/RISCV.cpp b/clang/lib/Basic/Targets/RISCV.cpp +index 930b825e94d..d1166d90df4 100644 +--- a/clang/lib/Basic/Targets/RISCV.cpp ++++ b/clang/lib/Basic/Targets/RISCV.cpp +@@ -19,23 +19,38 @@ using namespace clang::targets; + + ArrayRef RISCVTargetInfo::getGCCRegNames() const { + static const char *const GCCRegNames[] = { ++ // Integer registers + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", +- "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31"}; ++ "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", ++ ++ // Floating point registers ++ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", ++ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", ++ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", ++ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"}; + return llvm::makeArrayRef(GCCRegNames); + } + + ArrayRef RISCVTargetInfo::getGCCRegAliases() const { + static const TargetInfo::GCCRegAlias GCCRegAliases[] = { +- {{"zero"}, "x0"}, {{"ra"}, "x1"}, {{"sp"}, "x2"}, {{"gp"}, "x3"}, +- {{"tp"}, "x4"}, {{"t0"}, "x5"}, {{"t1"}, "x6"}, {{"t2"}, "x7"}, +- {{"s0"}, "x8"}, {{"s1"}, "x9"}, {{"a0"}, "x10"}, {{"a1"}, "x11"}, +- {{"a2"}, "x12"}, {{"a3"}, "x13"}, {{"a4"}, "x14"}, {{"a5"}, "x15"}, +- {{"a6"}, "x16"}, {{"a7"}, "x17"}, {{"s2"}, "x18"}, {{"s3"}, "x19"}, +- {{"s4"}, "x20"}, {{"s5"}, "x21"}, {{"s6"}, "x22"}, {{"s7"}, "x23"}, +- {{"s8"}, "x24"}, {{"s9"}, "x25"}, {{"s10"}, "x26"}, {{"s11"}, "x27"}, +- {{"t3"}, "x28"}, {{"t4"}, "x29"}, {{"t5"}, "x30"}, {{"t6"}, "x31"}}; ++ {{"zero"}, "x0"}, {{"ra"}, "x1"}, {{"sp"}, "x2"}, {{"gp"}, "x3"}, ++ {{"tp"}, "x4"}, {{"t0"}, "x5"}, {{"t1"}, "x6"}, {{"t2"}, "x7"}, ++ {{"s0"}, "x8"}, {{"s1"}, "x9"}, {{"a0"}, "x10"}, {{"a1"}, "x11"}, ++ {{"a2"}, "x12"}, {{"a3"}, "x13"}, {{"a4"}, "x14"}, {{"a5"}, "x15"}, ++ {{"a6"}, "x16"}, {{"a7"}, "x17"}, {{"s2"}, "x18"}, {{"s3"}, "x19"}, ++ {{"s4"}, "x20"}, {{"s5"}, "x21"}, {{"s6"}, "x22"}, {{"s7"}, "x23"}, ++ {{"s8"}, "x24"}, {{"s9"}, "x25"}, {{"s10"}, "x26"}, {{"s11"}, "x27"}, ++ {{"t3"}, "x28"}, {{"t4"}, "x29"}, {{"t5"}, "x30"}, {{"t6"}, "x31"}, ++ {{"ft0"}, "f0"}, {{"ft1"}, "f1"}, {{"ft2"}, "f2"}, {{"ft3"}, "f3"}, ++ {{"ft4"}, "f4"}, {{"ft5"}, "f5"}, {{"ft6"}, "f6"}, {{"ft7"}, "f7"}, ++ {{"fs0"}, "f8"}, {{"fs1"}, "f9"}, {{"fa0"}, "f10"}, {{"fa1"}, "f11"}, ++ {{"fa2"}, "f12"}, {{"fa3"}, "f13"}, {{"fa4"}, "f14"}, {{"fa5"}, "f15"}, ++ {{"fa6"}, "f16"}, {{"fa7"}, "f17"}, {{"fs2"}, "f18"}, {{"fs3"}, "f19"}, ++ {{"fs4"}, "f20"}, {{"fs5"}, "f21"}, {{"fs6"}, "f22"}, {{"fs7"}, "f23"}, ++ {{"fs8"}, "f24"}, {{"fs9"}, "f25"}, {{"fs10"}, "f26"}, {{"fs11"}, "f27"}, ++ {{"ft8"}, "f28"}, {{"ft9"}, "f29"}, {{"ft10"}, "f30"}, {{"ft11"}, "f31"}}; + return llvm::makeArrayRef(GCCRegAliases); + } + +diff --git a/clang/test/Sema/riscv-asm.c b/clang/test/Sema/riscv-asm.c +new file mode 100644 +index 00000000000..82664c01317 +--- /dev/null ++++ b/clang/test/Sema/riscv-asm.c +@@ -0,0 +1,28 @@ ++// RUN: %clang_cc1 %s -triple riscv32 -verify -fsyntax-only ++// RUN: %clang_cc1 %s -triple riscv64 -verify -fsyntax-only ++ ++// expected-no-diagnostics ++ ++void i (void) { ++ asm volatile ("" ::: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7"); ++ asm volatile ("" ::: "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15"); ++ asm volatile ("" ::: "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23"); ++ asm volatile ("" ::: "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31"); ++ ++ asm volatile ("" ::: "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2"); ++ asm volatile ("" ::: "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5"); ++ asm volatile ("" ::: "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7"); ++ asm volatile ("" ::: "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6"); ++} ++ ++void f (void) { ++ asm volatile ("" ::: "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7"); ++ asm volatile ("" ::: "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15"); ++ asm volatile ("" ::: "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23"); ++ asm volatile ("" ::: "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"); ++ ++ asm volatile ("" ::: "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7"); ++ asm volatile ("" ::: "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5"); ++ asm volatile ("" ::: "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7"); ++ asm volatile ("" ::: "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11"); ++} diff --git a/recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000..08d8516 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,22 @@ +From 098bc556770cc158a207fcb312e2cd79b4e7d8c4 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Wed, 18 Sep 2019 12:56:58 +0800 +Subject: [PATCH] Pass PYTHON_EXECUTABLE when cross compiling for native build + +Signed-off-by: Anuj Mittal +--- + llvm/cmake/modules/CrossCompile.cmake | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake +index d6b416131fe..7fae1080df7 100644 +--- a/llvm/cmake/modules/CrossCompile.cmake ++++ b/llvm/cmake/modules/CrossCompile.cmake +@@ -62,6 +62,7 @@ function(llvm_create_cross_target_internal target_name toolchain buildtype) + -DLLVM_ENABLE_PROJECTS="${llvm_enable_projects_arg}" + -DLLVM_EXTERNAL_PROJECTS="${llvm_external_projects_arg}" + -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN="${LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN}" ++ -DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" + ${build_type_flags} ${linker_flag} ${external_clang_dir} + WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} + DEPENDS CREATE_LLVM_${target_name} diff --git a/recipes-devtools/clang/clang/0023-RISCV-Add-support-for-floating-point-registers-in-in.patch b/recipes-devtools/clang/clang/0023-RISCV-Add-support-for-floating-point-registers-in-in.patch deleted file mode 100644 index 040980b..0000000 --- a/recipes-devtools/clang/clang/0023-RISCV-Add-support-for-floating-point-registers-in-in.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 373a9051a614acd24d6fb1257001414aa50e95f2 Mon Sep 17 00:00:00 2001 -From: Simon Cook -Date: Wed, 31 Jul 2019 09:12:00 +0000 -Subject: [PATCH] [RISCV] Add support for floating point registers in inlineasm - -This adds support for parsing/emitting in IR the floating-point RISC-V -registers in inline assembly clobber lists. - -Differential Revision: https://reviews.llvm.org/D64737 - -llvm-svn: 367399 ---- - clang/lib/Basic/Targets/RISCV.cpp | 33 ++++++++++++++++++++++--------- - clang/test/Sema/riscv-asm.c | 28 ++++++++++++++++++++++++++ - 2 files changed, 52 insertions(+), 9 deletions(-) - create mode 100644 clang/test/Sema/riscv-asm.c - -diff --git a/clang/lib/Basic/Targets/RISCV.cpp b/clang/lib/Basic/Targets/RISCV.cpp -index 930b825e94d..d1166d90df4 100644 ---- a/clang/lib/Basic/Targets/RISCV.cpp -+++ b/clang/lib/Basic/Targets/RISCV.cpp -@@ -19,23 +19,38 @@ using namespace clang::targets; - - ArrayRef RISCVTargetInfo::getGCCRegNames() const { - static const char *const GCCRegNames[] = { -+ // Integer registers - "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", - "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", - "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23", -- "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31"}; -+ "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31", -+ -+ // Floating point registers -+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", -+ "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", -+ "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", -+ "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"}; - return llvm::makeArrayRef(GCCRegNames); - } - - ArrayRef RISCVTargetInfo::getGCCRegAliases() const { - static const TargetInfo::GCCRegAlias GCCRegAliases[] = { -- {{"zero"}, "x0"}, {{"ra"}, "x1"}, {{"sp"}, "x2"}, {{"gp"}, "x3"}, -- {{"tp"}, "x4"}, {{"t0"}, "x5"}, {{"t1"}, "x6"}, {{"t2"}, "x7"}, -- {{"s0"}, "x8"}, {{"s1"}, "x9"}, {{"a0"}, "x10"}, {{"a1"}, "x11"}, -- {{"a2"}, "x12"}, {{"a3"}, "x13"}, {{"a4"}, "x14"}, {{"a5"}, "x15"}, -- {{"a6"}, "x16"}, {{"a7"}, "x17"}, {{"s2"}, "x18"}, {{"s3"}, "x19"}, -- {{"s4"}, "x20"}, {{"s5"}, "x21"}, {{"s6"}, "x22"}, {{"s7"}, "x23"}, -- {{"s8"}, "x24"}, {{"s9"}, "x25"}, {{"s10"}, "x26"}, {{"s11"}, "x27"}, -- {{"t3"}, "x28"}, {{"t4"}, "x29"}, {{"t5"}, "x30"}, {{"t6"}, "x31"}}; -+ {{"zero"}, "x0"}, {{"ra"}, "x1"}, {{"sp"}, "x2"}, {{"gp"}, "x3"}, -+ {{"tp"}, "x4"}, {{"t0"}, "x5"}, {{"t1"}, "x6"}, {{"t2"}, "x7"}, -+ {{"s0"}, "x8"}, {{"s1"}, "x9"}, {{"a0"}, "x10"}, {{"a1"}, "x11"}, -+ {{"a2"}, "x12"}, {{"a3"}, "x13"}, {{"a4"}, "x14"}, {{"a5"}, "x15"}, -+ {{"a6"}, "x16"}, {{"a7"}, "x17"}, {{"s2"}, "x18"}, {{"s3"}, "x19"}, -+ {{"s4"}, "x20"}, {{"s5"}, "x21"}, {{"s6"}, "x22"}, {{"s7"}, "x23"}, -+ {{"s8"}, "x24"}, {{"s9"}, "x25"}, {{"s10"}, "x26"}, {{"s11"}, "x27"}, -+ {{"t3"}, "x28"}, {{"t4"}, "x29"}, {{"t5"}, "x30"}, {{"t6"}, "x31"}, -+ {{"ft0"}, "f0"}, {{"ft1"}, "f1"}, {{"ft2"}, "f2"}, {{"ft3"}, "f3"}, -+ {{"ft4"}, "f4"}, {{"ft5"}, "f5"}, {{"ft6"}, "f6"}, {{"ft7"}, "f7"}, -+ {{"fs0"}, "f8"}, {{"fs1"}, "f9"}, {{"fa0"}, "f10"}, {{"fa1"}, "f11"}, -+ {{"fa2"}, "f12"}, {{"fa3"}, "f13"}, {{"fa4"}, "f14"}, {{"fa5"}, "f15"}, -+ {{"fa6"}, "f16"}, {{"fa7"}, "f17"}, {{"fs2"}, "f18"}, {{"fs3"}, "f19"}, -+ {{"fs4"}, "f20"}, {{"fs5"}, "f21"}, {{"fs6"}, "f22"}, {{"fs7"}, "f23"}, -+ {{"fs8"}, "f24"}, {{"fs9"}, "f25"}, {{"fs10"}, "f26"}, {{"fs11"}, "f27"}, -+ {{"ft8"}, "f28"}, {{"ft9"}, "f29"}, {{"ft10"}, "f30"}, {{"ft11"}, "f31"}}; - return llvm::makeArrayRef(GCCRegAliases); - } - -diff --git a/clang/test/Sema/riscv-asm.c b/clang/test/Sema/riscv-asm.c -new file mode 100644 -index 00000000000..82664c01317 ---- /dev/null -+++ b/clang/test/Sema/riscv-asm.c -@@ -0,0 +1,28 @@ -+// RUN: %clang_cc1 %s -triple riscv32 -verify -fsyntax-only -+// RUN: %clang_cc1 %s -triple riscv64 -verify -fsyntax-only -+ -+// expected-no-diagnostics -+ -+void i (void) { -+ asm volatile ("" ::: "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7"); -+ asm volatile ("" ::: "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15"); -+ asm volatile ("" ::: "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23"); -+ asm volatile ("" ::: "x24", "x25", "x26", "x27", "x28", "x29", "x30", "x31"); -+ -+ asm volatile ("" ::: "zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2"); -+ asm volatile ("" ::: "s0", "s1", "a0", "a1", "a2", "a3", "a4", "a5"); -+ asm volatile ("" ::: "a6", "a7", "s2", "s3", "s4", "s5", "s6", "s7"); -+ asm volatile ("" ::: "s8", "s9", "s10", "s11", "t3", "t4", "t5", "t6"); -+} -+ -+void f (void) { -+ asm volatile ("" ::: "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7"); -+ asm volatile ("" ::: "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15"); -+ asm volatile ("" ::: "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23"); -+ asm volatile ("" ::: "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"); -+ -+ asm volatile ("" ::: "ft0", "ft1", "ft2", "ft3", "ft4", "ft5", "ft6", "ft7"); -+ asm volatile ("" ::: "fs0", "fs1", "fa0", "fa1", "fa2", "fa3", "fa4", "fa5"); -+ asm volatile ("" ::: "fa6", "fa7", "fs2", "fs3", "fs4", "fs5", "fs6", "fs7"); -+ asm volatile ("" ::: "fs8", "fs9", "fs10", "fs11", "ft8", "ft9", "ft10", "ft11"); -+} diff --git a/recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch b/recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch new file mode 100644 index 0000000..ec476fc --- /dev/null +++ b/recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch @@ -0,0 +1,28 @@ +From cc64b30dd9ca1d39a3807a412d2e6ce1038cc406 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 5 Oct 2019 14:47:37 -0700 +Subject: [PATCH] openmp: Recognise ARMv7ve machine arch + +-march in clang when set to armv7ve emits __ARM_ARCH_7VE__ internal +define and not __ARM_ARCH_7A__, hence the condition fails and openmp can +not be compiled, this makes sure that __ARM_ARCH_7VE__ is taken into +consideration as KMP_ARCH_ARMV7 as well + +Signed-off-by: Khem Raj +--- + openmp/runtime/src/kmp_platform.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/openmp/runtime/src/kmp_platform.h b/openmp/runtime/src/kmp_platform.h +index e4f2e06b962..335b91f3575 100644 +--- a/openmp/runtime/src/kmp_platform.h ++++ b/openmp/runtime/src/kmp_platform.h +@@ -139,7 +139,7 @@ + #endif + + #if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7R__) || \ +- defined(__ARM_ARCH_7A__) ++ defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7VE__) + #define KMP_ARCH_ARMV7 1 + #endif + diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 955c3cc..99b1e43 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -28,9 +28,10 @@ SRC_URI = "\ file://0018-clang-Initial-implementation-of-fmacro-prefix-map-an.patch \ file://0019-clang-Add-lpthread-and-ldl-along-with-lunwind-for-st.patch \ file://0020-clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch \ - file://0022-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch \ - file://0023-RISCV-Add-support-for-floating-point-registers-in-in.patch \ - file://0001-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch \ + file://0022-RISCV-Add-support-for-floating-point-registers-in-in.patch \ + file://0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0024-openmp-Recognise-ARMv7ve-machine-arch.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf