From 79ec62fd457fd41585e23affd5fa82959b33b043 Mon Sep 17 00:00:00 2001 From: "Yong, Jonathan" Date: Wed, 9 Oct 2019 02:09:51 +0000 Subject: clang: make libedit optional Allows libedit to dependency to be disabled via PACKAGECONFIG_remove. add libedit to native and nativesdk packageconfigs Signed-off-by: Yong, Jonathan Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 63592dd..86d8ddd 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -52,10 +52,10 @@ def get_clang_experimental_target_arch(bb, d): PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto full-lto', d)} \ - rtti eh \ + rtti eh libedit \ " -PACKAGECONFIG_class-native = "rtti eh" -PACKAGECONFIG_class-nativesdk = "rtti eh thin-lto" +PACKAGECONFIG_class-native = "rtti eh libedit" +PACKAGECONFIG_class-nativesdk = "rtti eh libedit thin-lto" PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,libcxx,compiler-rt" PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" @@ -68,6 +68,7 @@ PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCH PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," +PACKAGECONFIG[libedit] = "-DLLVM_ENABLE_LIBEDIT=ON -DLLDB_DISABLE_LIBEDIT=0,-DLLVM_ENABLE_LIBEDIT=OFF -DLLDB_DISABLE_LIBEDIT=1,libedit libedit-native" BUILDTARGET = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2', '', d)}" BINPATHPREFIX = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', '/tools/clang/stage2-bins/NATIVE', '', d)}" @@ -81,6 +82,7 @@ LLVM_ENABLE_RTTI;LLVM_ENABLE_EH;LLVM_BUILD_EXTERNAL_COMPILER_RT;CMAKE_SYSTEM_NAM CMAKE_BUILD_TYPE;BUILD_SHARED_LIBS;LLVM_ENABLE_PROJECTS;LLVM_BINUTILS_INCDIR;\ LLVM_TARGETS_TO_BUILD;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;PYTHON_EXECUTABLE;\ PYTHON_LIBRARY;PYTHON_INCLUDE_DIR;LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN;LLDB_EDITLINE_USE_WCHAR;\ +LLVM_ENABLE_LIBEDIT;LLDB_DISABLE_LIBEDIT; \ " # # Default to build all OE-Core supported target arches (user overridable). @@ -110,7 +112,6 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DBUILD_SHARED_LIBS=OFF \ -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;lldb' \ -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR} \ - -DLLVM_ENABLE_LIBEDIT=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ -G Ninja ${S}/llvm \ " @@ -151,7 +152,7 @@ EXTRA_OECMAKE_append_class-target = "\ -DPYTHON_EXECUTABLE='${PYTHON}' \ " -DEPENDS = "binutils zlib libffi libedit libedit-native libxml2 libxml2-native ninja-native swig-native" +DEPENDS = "binutils zlib libffi libxml2 libxml2-native ninja-native swig-native" DEPENDS_append_class-nativesdk = " clang-crosssdk-${SDK_ARCH} virtual/${TARGET_PREFIX}binutils-crosssdk nativesdk-python3" DEPENDS_append_class-target = " clang-cross-${TARGET_ARCH} python3" -- cgit v1.2.3-54-g00ecf From dfafa71e0fd466d5c01bf06989fc12d47b4b3120 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Nov 2019 17:32:13 -0800 Subject: clang: Do not lock clang as only cross compiler option clang might be used for more than just static compiler on target and therefore lock-stepping it with needing clang cross-compiler is not right thing Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 86d8ddd..eef043c 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -238,6 +238,5 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" -TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 92446432834b99bbd5001b0083d10c53710a2a02 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Nov 2019 22:55:40 -0800 Subject: tinymembench: Disable internal assembler on mips Fixes mips-32.S:108:15: error: invalid reassignment of non-absolute variable 'DST' | .set DST, $a0 | ^ Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 57b156d..428eacf 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -184,6 +184,7 @@ CC_append_pn-kexec-tools-klibc_toolchain-clang_x86 = " -no-integrated-as" #| ^~~~ CFLAGS_append_pn-tinymembench_toolchain-clang_x86-64 = " -no-integrated-as" CFLAGS_append_pn-tinymembench_toolchain-clang_x86 = " -no-integrated-as" +CFLAGS_append_pn-tinymembench_toolchain-clang_mipsarch = " -no-integrated-as" CFLAGS_append_pn-ne10_toolchain-clang_arm = " -no-integrated-as" -- cgit v1.2.3-54-g00ecf From 152241a657dbdd16ba72d3652000fd3446bc2f36 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 10:46:31 -0800 Subject: Revert "clang: Do not lock clang as only cross compiler option" This reverts commit cb86d1f837f8f8c40e8b00c9c29d136ed6a16a08. Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index eef043c..86d8ddd 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -238,5 +238,6 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" +TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 6e1b6459ce5a85622fd24d7df4cee06afff76297 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 16:32:24 -0800 Subject: clang.bbclass: Define RUNTIME variable to select compiler runtime RUNTIME can be 'llvm' or 'gnu' defaults to 'gnu' Use this variable for selecting stdc++ and c runtime Signed-off-by: Khem Raj --- classes/clang.bbclass | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 3ca3ae5..7b662bd 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -8,17 +8,15 @@ RANLIB_toolchain-clang = "${HOST_PREFIX}llvm-ranlib" AR_toolchain-clang = "${HOST_PREFIX}llvm-ar" NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" -COMPILER_RT ??= "--rtlib=compiler-rt ${UNWINDLIB}" -COMPILER_RT_toolchain-gcc = "" +COMPILER_RT ??= "${@bb.utils.contains("RUNTIME", "llvm", "-rtlib=compiler-rt ${UNWINDLIB}", "", d)}" COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}" -UNWINDLIB ??= "--unwindlib=libgcc" +UNWINDLIB ??= "${@bb.utils.contains("RUNTIME", "llvm", "--unwindlib=libgcc", "", d)}" UNWINDLIB_riscv64 = "--unwindlib=libgcc" UNWINDLIB_riscv32 = "--unwindlib=libgcc" UNWINDLIB_powerpc = "--unwindlib=libgcc" -LIBCPLUSPLUS ??= "--stdlib=libc++" -LIBCPLUSPLUS_toolchain-gcc = "" +LIBCPLUSPLUS ??= "${@bb.utils.contains("RUNTIME", "llvm", "--stdlib=libc++", "", d)}" TARGET_CXXFLAGS_append_toolchain-clang = " ${LIBCPLUSPLUS}" TUNE_CCARGS_append_toolchain-clang = " ${COMPILER_RT} ${LIBCPLUSPLUS}" @@ -46,6 +44,9 @@ LDFLAGS_append_toolchain-clang = "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is # choose between 'gcc' 'clang' an empty '' can be used as well TOOLCHAIN ??= "gcc" +# choose between 'gnu' 'llvm' +RUNTIME ??= "gnu" +RUNTIME_toolchain-gcc = "gnu" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "gcc" @@ -54,7 +55,8 @@ TOOLCHAIN_class-crosssdk = "gcc" TOOLCHAIN_class-cross = "gcc" OVERRIDES =. "${@['', 'toolchain-${TOOLCHAIN}:']['${TOOLCHAIN}' != '']}" -OVERRIDES[vardepsexclude] += "TOOLCHAIN" +OVERRIDES =. "${@['', 'runtime-${RUNTIME}:']['${RUNTIME}' != '']}" +OVERRIDES[vardepsexclude] += "TOOLCHAIN RUNTIME" #DEPENDS_append_toolchain-clang_class-target = " clang-cross-${TARGET_ARCH} " #DEPENDS_remove_toolchain-clang_allarch = "clang-cross-${TARGET_ARCH}" -- cgit v1.2.3-54-g00ecf From c17278ad7bbe91be0d1aa34da069d73aeafd60af Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 16:33:49 -0800 Subject: clangd: Always link with libatomic Since it uses double atomics which are not available yet as intrinsics Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 38 insertions(+) create mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch new file mode 100644 index 0000000..1122d6a --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch @@ -0,0 +1,37 @@ +From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 17 Nov 2019 16:26:07 -0800 +Subject: [PATCH] clangd: Always link with libatomic + +Trace.cpp uses atomic which is not available as instrinsic +its only added in c++20, until then link with libatomic + +Another solution would be to not use double atomics something like below + +- std::atomic EndTime; // Filled in by markEnded(). ++ std::atomic EndTime; // Filled in by markEnded(). + +but I don't know if this would be just the change needed or more is +required + +Signed-off-by: Khem Raj +--- + clang-tools-extra/clangd/CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt +index f617f7931de..2be738c6097 100644 +--- a/clang-tools-extra/clangd/CMakeLists.txt ++++ b/clang-tools-extra/clangd/CMakeLists.txt +@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) + include(CheckAtomic) + endif() + +-set(CLANGD_ATOMIC_LIB "") +-if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) +- list(APPEND CLANGD_ATOMIC_LIB "atomic") +-endif() ++list(APPEND CLANGD_ATOMIC_LIB "atomic") + + add_clang_library(clangDaemon + AST.cpp diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 99b1e43..6149a2f 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -32,6 +32,7 @@ SRC_URI = "\ 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 \ + file://0025-clangd-Always-link-with-libatomic.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From f331ea3283c9c06814cd9ca549345f27bdcebc3a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 20:48:00 -0800 Subject: m4,ruby: Set COMPILER_RT instead of playing with LDFLAGS Signed-off-by: Khem Raj --- conf/nonclangable.conf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 428eacf..8282782 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -211,8 +211,9 @@ TUNE_CCARGS_remove_pn-omxplayer_toolchain-clang = "-no-integrated-as" #| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' #| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) LDFLAGS_append_pn-ruby_toolchain-clang = "${@bb.utils.contains('COMPILER_RT', '--rtlib=compiler-rt', ' -rtlib=compiler-rt', '', d)}" -LDFLAGS_append_pn-m4_toolchain-clang = "${@bb.utils.contains('COMPILER_RT', '--rtlib=compiler-rt', ' -rtlib=compiler-rt', '', d)}" -LDFLAGS_remove_pn-m4_powerpc = "-rtlib=compiler-rt" +COMPILER_RT_pn-ruby_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT_pn-m4_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT_remove_pn-m4_powerpc = "--rtlib=compiler-rt" LDFLAGS_append_pn-gnutls_toolchain-clang_riscv64 = " -latomic" LDFLAGS_append_pn-harfbuzz_toolchain-clang_riscv64 = " -latomic" -- cgit v1.2.3-54-g00ecf From 6942af5c675f73bd689f9db7ad2d2dfca38f58b7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 07:51:13 -0800 Subject: webkitgtk: Use compiler-rt runtime when using clang Fixes | /usr/src/debug/webkitgtk/2.26.2-r0/webkitgtk-2.26.2/Source/WTF/wtf/CheckedArithmetic.h:365: error: undefined reference to '__mulodi4' Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 8282782..bec69f7 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -213,6 +213,7 @@ TUNE_CCARGS_remove_pn-omxplayer_toolchain-clang = "-no-integrated-as" LDFLAGS_append_pn-ruby_toolchain-clang = "${@bb.utils.contains('COMPILER_RT', '--rtlib=compiler-rt', ' -rtlib=compiler-rt', '', d)}" COMPILER_RT_pn-ruby_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-m4_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT_pn-webkitgtk_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_remove_pn-m4_powerpc = "--rtlib=compiler-rt" LDFLAGS_append_pn-gnutls_toolchain-clang_riscv64 = " -latomic" -- cgit v1.2.3-54-g00ecf From 656891ef643a2df0d8308df5226e22eb75e3df3e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 08:17:33 -0800 Subject: ruby: Drop linking with compiler-rt is not needed anymore Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index bec69f7..658f570 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -210,7 +210,6 @@ TUNE_CCARGS_remove_pn-omxplayer_toolchain-clang = "-no-integrated-as" #| /usr/src/debug/ruby/2.5.1-r0/build/../ruby-2.5.1/process.c:7073: undefined reference to `__mulodi4' #| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) -LDFLAGS_append_pn-ruby_toolchain-clang = "${@bb.utils.contains('COMPILER_RT', '--rtlib=compiler-rt', ' -rtlib=compiler-rt', '', d)}" COMPILER_RT_pn-ruby_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-m4_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-webkitgtk_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" -- cgit v1.2.3-54-g00ecf From 8fc1f6a2ae98c014801f14276ebc4d61a61d350e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 08:42:11 -0800 Subject: gerbera: Always use llvm runtime with clang It expects libc++ with clang Fixes | CMake Error at CMakeLists.txt:316 (message): | gerbera requires C++17 Optional to be available. Check your compiler is | >=GCC 7.1 or >=libc++ 5 Signed-off-by: Khem Raj --- conf/nonclangable.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 658f570..68303b5 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -236,3 +236,5 @@ COMPILER_RT_pn-tsocks_libc-glibc_toolchain-clang_x86-64 = "--rtlib=libgcc" COMPILER_RT_pn-libc-bench_libc-glibc_toolchain-clang_arm = "--rtlib=libgcc" COMPILER_RT_pn-aufs-util_libc-glibc_toolchain-clang_arm = "--rtlib=libgcc" COMPILER_RT_pn-libhugetlbfs_libc-glibc_toolchain-clang_arm = "--rtlib=libgcc" + +RUNTIME_pn-gerbera_toolchain-clang = "llvm" -- cgit v1.2.3-54-g00ecf From b9d691765f6d829803e743cc864c1768f098eb39 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 16:42:17 -0800 Subject: Revert "clangd: Always link with libatomic" This reverts commit 2fdb19c4f8b025d4465d78cdf1bc05d786f5e087. Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ---------------------- recipes-devtools/clang/common.inc | 1 - 2 files changed, 38 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch deleted file mode 100644 index 1122d6a..0000000 --- a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 17 Nov 2019 16:26:07 -0800 -Subject: [PATCH] clangd: Always link with libatomic - -Trace.cpp uses atomic which is not available as instrinsic -its only added in c++20, until then link with libatomic - -Another solution would be to not use double atomics something like below - -- std::atomic EndTime; // Filled in by markEnded(). -+ std::atomic EndTime; // Filled in by markEnded(). - -but I don't know if this would be just the change needed or more is -required - -Signed-off-by: Khem Raj ---- - clang-tools-extra/clangd/CMakeLists.txt | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt -index f617f7931de..2be738c6097 100644 ---- a/clang-tools-extra/clangd/CMakeLists.txt -+++ b/clang-tools-extra/clangd/CMakeLists.txt -@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) - include(CheckAtomic) - endif() - --set(CLANGD_ATOMIC_LIB "") --if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) -- list(APPEND CLANGD_ATOMIC_LIB "atomic") --endif() -+list(APPEND CLANGD_ATOMIC_LIB "atomic") - - add_clang_library(clangDaemon - AST.cpp diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 6149a2f..99b1e43 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -32,7 +32,6 @@ SRC_URI = "\ 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 \ - file://0025-clangd-Always-link-with-libatomic.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From 4ec9b68787ddc163c3dc014fcb10b01d05257892 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 17:06:06 -0800 Subject: llvm: Check for built-in atomic during configure This helps in deciding on linking libatomic, therefore its important to check for atomic because on x86, clang decides to not use built-in whereas gcc does, so clangd e.g. links ok when using gcc but fails when using clang with gcc-runtime on x86 Signed-off-by: Khem Raj --- .../0025-Check-for-atomic-double-intrinsics.patch | 33 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 34 insertions(+) create mode 100644 recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch diff --git a/recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 0000000..04a5b93 --- /dev/null +++ b/recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,33 @@ +From a580e8fcf17fb9cb9056debdd342ac4eabef4762 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Nov 2019 17:00:29 -0800 +Subject: [PATCH] Check for atomic intrinsics + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index 9a4cdf12a62..e70ce924df9 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -26,9 +26,10 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 99b1e43..a21bc93 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -32,6 +32,7 @@ SRC_URI = "\ 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 \ + file://0025-Check-for-atomic-double-intrinsics.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From c52f2598029dfd68cce4266587c6eb97325928fc Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 19 Nov 2019 10:38:00 -0800 Subject: qtwebengine: Link libatomic on x86/clang/gnu-runtime gcc uses intrinsics for atomic but clang does not for x86 when using libstdc++ ./media/audio/pulse/pulse_input.cc uses this atomic variable Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 68303b5..821b172 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -217,6 +217,7 @@ COMPILER_RT_remove_pn-m4_powerpc = "--rtlib=compiler-rt" LDFLAGS_append_pn-gnutls_toolchain-clang_riscv64 = " -latomic" LDFLAGS_append_pn-harfbuzz_toolchain-clang_riscv64 = " -latomic" +LDFLAGS_append_pn-qtwebengine_toolchain-clang_runtime-gnu_x86 = " -latomic" # glibc is built with gcc and hence encodes some libgcc specific builtins which are not found # when doing static linking with clang using compiler-rt, so use libgcc -- cgit v1.2.3-54-g00ecf From cc7a0172677b070c49fadf4cbaec0e5230c9184c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 19 Nov 2019 22:27:29 -0800 Subject: armeb: Disable compiler-rt compile-rt is not fully ported for ARM big-endian therefore disable it Signed-off-by: Khem Raj --- classes/clang.bbclass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/clang.bbclass b/classes/clang.bbclass index 7b662bd..f19cb64 100644 --- a/classes/clang.bbclass +++ b/classes/clang.bbclass @@ -10,11 +10,13 @@ NM_toolchain-clang = "${HOST_PREFIX}llvm-nm" COMPILER_RT ??= "${@bb.utils.contains("RUNTIME", "llvm", "-rtlib=compiler-rt ${UNWINDLIB}", "", d)}" COMPILER_RT_powerpc = "--rtlib=libgcc ${UNWINDLIB}" +COMPILER_RT_armeb = "--rtlib=libgcc ${UNWINDLIB}" UNWINDLIB ??= "${@bb.utils.contains("RUNTIME", "llvm", "--unwindlib=libgcc", "", d)}" UNWINDLIB_riscv64 = "--unwindlib=libgcc" UNWINDLIB_riscv32 = "--unwindlib=libgcc" UNWINDLIB_powerpc = "--unwindlib=libgcc" +UNWINDLIB_armeb = "--unwindlib=libgcc" LIBCPLUSPLUS ??= "${@bb.utils.contains("RUNTIME", "llvm", "--stdlib=libc++", "", d)}" @@ -47,6 +49,7 @@ TOOLCHAIN ??= "gcc" # choose between 'gnu' 'llvm' RUNTIME ??= "gnu" RUNTIME_toolchain-gcc = "gnu" +RUNTIME_armeb = "gnu" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "gcc" -- cgit v1.2.3-54-g00ecf From 1487eeeb41eac7f4eccd85cf758190793c56621d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 19 Nov 2019 22:40:04 -0800 Subject: m4,ruby,webkitgtk: Do not use compiler-rt explicitly on arrmeb/ppc Needed for clang since it needs __mulodi4 but these arches do not build compiler-rt Signed-off-by: Khem Raj --- conf/nonclangable.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 821b172..1a01659 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -214,6 +214,11 @@ COMPILER_RT_pn-ruby_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-m4_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-webkitgtk_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_remove_pn-m4_powerpc = "--rtlib=compiler-rt" +COMPILER_RT_remove_pn-ruby_powerpc = "--rtlib=compiler-rt" +COMPILER_RT_remove_pn-webkitgtk_powerpc = "--rtlib=compiler-rt" +COMPILER_RT_remove_pn-m4_armeb = "--rtlib=compiler-rt" +COMPILER_RT_remove_pn-ruby_armeb = "--rtlib=compiler-rt" +COMPILER_RT_remove_pn-webkitgtk_armeb = "--rtlib=compiler-rt" LDFLAGS_append_pn-gnutls_toolchain-clang_riscv64 = " -latomic" LDFLAGS_append_pn-harfbuzz_toolchain-clang_riscv64 = " -latomic" -- cgit v1.2.3-54-g00ecf From 4a8b6e826768bf9e8bc3c753a868fa735c90d410 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 19 Nov 2019 23:13:38 -0800 Subject: libffi: Use gcc for armeb libffi expects arv7+neon with clang in asm Signed-off-by: Khem Raj --- conf/nonclangable.conf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 1a01659..ac51481 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -128,6 +128,11 @@ TOOLCHAIN_pn-caps = "gcc" TOOLCHAIN_pn-lttng-ust_riscv64 = "gcc" +#| ../libffi-3.3-rc0/src/arm/sysv.S: Assembler messages: +#| ../libffi-3.3-rc0/src/arm/sysv.S:131: Error: selected processor does not support `vldrle d0,[sp]' in ARM mode +#| ../libffi-3.3-rc0/src/arm/sysv.S:132: Error: selected processor does not support `vldmgt sp,{d0-d7}' in ARM mode +TOOLCHAIN_pn-libffi_armeb = "gcc" + CFLAGS_append_pn-liboil_toolchain-clang_x86-64 = " -fheinous-gnu-extensions " #io_getevents.c:25:141: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions @@ -140,7 +145,7 @@ CFLAGS_append_pn-mdadm_toolchain-clang = " -Wno-error=unknown-warning-option" #../libffi-3.2.1/src/arm/sysv.S:363:2: error: invalid instruction, did you mean: fldmiax? # fldmiadgt ip, {d0-d7} CFLAGS_append_pn-libffi_arm_toolchain-clang = " -no-integrated-as" -CFLAGS_append_pn-libffi_armeb_toolchain-clang = " -no-integrated-as" + # ../db-5.3.28/src/mutex/mut_tas.c:150:34: error: unknown directive #:9:2: note: instantiated into assembly here # .force_thumb -- cgit v1.2.3-54-g00ecf From 17dd87b39a1b6d90c1c4a9955a75468e6ce80663 Mon Sep 17 00:00:00 2001 From: rchard2scout Date: Fri, 6 Dec 2019 13:34:20 +0100 Subject: clang: ensure correct python for nativesdk builds This fixes #162 for nativesdk-clang. --- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 86d8ddd..0b16e1a 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -134,6 +134,7 @@ EXTRA_OECMAKE_append_class-nativesdk = "\ -DLLDB_TABLEGEN=${STAGING_BINDIR_NATIVE}/lldb-tblgen \ -DPYTHON_LIBRARY=${STAGING_LIBDIR}/lib${PYTHON_DIR}${PYTHON_ABI}.so \ -DPYTHON_INCLUDE_DIR=${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI} \ + -DPYTHON_EXECUTABLE='${PYTHON}' \ " EXTRA_OECMAKE_append_class-target = "\ -DCMAKE_CROSSCOMPILING:BOOL=ON \ -- cgit v1.2.3-54-g00ecf From 4dd00318511ff9bdaa9e857680ab9d96dfcf2758 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Nov 2019 17:32:13 -0800 Subject: clang: Do not lock clang as only cross compiler option clang might be used for more than just static compiler on target and therefore lock-stepping it with needing clang cross-compiler is not right thing Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 0b16e1a..6884085 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -239,6 +239,5 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" -TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 2b77c6edba3784b707907cbc45d093e4cf69d70c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 10:46:31 -0800 Subject: Revert "clang: Do not lock clang as only cross compiler option" This reverts commit cb86d1f837f8f8c40e8b00c9c29d136ed6a16a08. Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 6884085..0b16e1a 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -239,5 +239,6 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" +TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From d3a8c723ee180502643985a6c8b314724a4279bb Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 16:33:49 -0800 Subject: clangd: Always link with libatomic Since it uses double atomics which are not available yet as intrinsics Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch new file mode 100644 index 0000000..1122d6a --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch @@ -0,0 +1,37 @@ +From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 17 Nov 2019 16:26:07 -0800 +Subject: [PATCH] clangd: Always link with libatomic + +Trace.cpp uses atomic which is not available as instrinsic +its only added in c++20, until then link with libatomic + +Another solution would be to not use double atomics something like below + +- std::atomic EndTime; // Filled in by markEnded(). ++ std::atomic EndTime; // Filled in by markEnded(). + +but I don't know if this would be just the change needed or more is +required + +Signed-off-by: Khem Raj +--- + clang-tools-extra/clangd/CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt +index f617f7931de..2be738c6097 100644 +--- a/clang-tools-extra/clangd/CMakeLists.txt ++++ b/clang-tools-extra/clangd/CMakeLists.txt +@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) + include(CheckAtomic) + endif() + +-set(CLANGD_ATOMIC_LIB "") +-if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) +- list(APPEND CLANGD_ATOMIC_LIB "atomic") +-endif() ++list(APPEND CLANGD_ATOMIC_LIB "atomic") + + add_clang_library(clangDaemon + AST.cpp -- cgit v1.2.3-54-g00ecf From 28032a29b44d8fbd1acaf9b9671e49c96001ed07 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 16:42:17 -0800 Subject: Revert "clangd: Always link with libatomic" This reverts commit 2fdb19c4f8b025d4465d78cdf1bc05d786f5e087. Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch deleted file mode 100644 index 1122d6a..0000000 --- a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 17 Nov 2019 16:26:07 -0800 -Subject: [PATCH] clangd: Always link with libatomic - -Trace.cpp uses atomic which is not available as instrinsic -its only added in c++20, until then link with libatomic - -Another solution would be to not use double atomics something like below - -- std::atomic EndTime; // Filled in by markEnded(). -+ std::atomic EndTime; // Filled in by markEnded(). - -but I don't know if this would be just the change needed or more is -required - -Signed-off-by: Khem Raj ---- - clang-tools-extra/clangd/CMakeLists.txt | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt -index f617f7931de..2be738c6097 100644 ---- a/clang-tools-extra/clangd/CMakeLists.txt -+++ b/clang-tools-extra/clangd/CMakeLists.txt -@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) - include(CheckAtomic) - endif() - --set(CLANGD_ATOMIC_LIB "") --if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) -- list(APPEND CLANGD_ATOMIC_LIB "atomic") --endif() -+list(APPEND CLANGD_ATOMIC_LIB "atomic") - - add_clang_library(clangDaemon - AST.cpp -- cgit v1.2.3-54-g00ecf From e319f28a26f1983edb8afb95404581f0bca19739 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 20 Nov 2019 21:51:06 -0800 Subject: Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++++++++++ .github/ISSUE_TEMPLATE/custom.md | 10 ++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..48d5f81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. -- cgit v1.2.3-54-g00ecf From df9f203dc069dd7878384b60c90364fd0ee4281b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 20 Nov 2019 21:52:00 -0800 Subject: Create CODE_OF_CONDUCT.md --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..bcec6e1 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at raj.khem@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq -- cgit v1.2.3-54-g00ecf From 3d1819884ee5d0430a52d893ab36cce71a769c64 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 20 Nov 2019 21:54:51 -0800 Subject: Create CONTRIBUTING.md --- CONTRIBUTING.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..11d84de --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ + +# Contributing + +You are encouraged to follow Github Pull request workflow +to share changes and following commit message guidelines are recommended [OE patch guidelines](https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines) + +Layer Maintainer: [Khem Raj]() -- cgit v1.2.3-54-g00ecf From 1c1cc28c5b5697f9c1bad48890565322ca533cda Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 23 Nov 2019 08:00:40 -0800 Subject: clang: Uodate to 9.0.1-rc1 Drop 0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch as its already applied upstream Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 4 +- ...d-lxml2-to-linker-cmdline-of-xml-is-found.patch | 2 +- ...ind-libunwind-headers-when-LIBCXXABI_LIBU.patch | 4 +- ...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 | 6 +- .../0010-clang-driver-Use-lib-for-ldso-on-OE.patch | 4 +- ...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 | 4 +- ...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 | 4 +- .../0017-clang-scan-view-needs-python-2.x.patch | 2 +- ...al-implementation-of-fmacro-prefix-map-an.patch | 2 +- ...pthread-and-ldl-along-with-lunwind-for-st.patch | 2 +- ...clang-default-to-lp64d-ABI-and-rv64gc-ISA.patch | 2 +- ...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 ------------------ ..._EXECUTABLE-when-cross-compiling-for-nati.patch | 22 ---- ...023-openmp-Recognise-ARMv7ve-machine-arch.patch | 28 +++++ .../0024-Check-for-atomic-double-intrinsics.patch | 32 ++++++ ...024-openmp-Recognise-ARMv7ve-machine-arch.patch | 28 ----- .../0025-Check-for-atomic-double-intrinsics.patch | 33 ------ recipes-devtools/clang/common.inc | 9 +- 31 files changed, 217 insertions(+), 334 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch create mode 100644 recipes-devtools/clang/clang/0021-RISCV-Add-support-for-floating-point-registers-in-in.patch create mode 100644 recipes-devtools/clang/clang/0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch delete mode 100644 recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch delete mode 100644 recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch create mode 100644 recipes-devtools/clang/clang/0023-openmp-Recognise-ARMv7ve-machine-arch.patch create mode 100644 recipes-devtools/clang/clang/0024-Check-for-atomic-double-intrinsics.patch delete mode 100644 recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch delete mode 100644 recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index b301344..248ff28 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -6,9 +6,9 @@ LLVM_GIT_PROTOCOL ?= "https" MAJOR_VER = "9" MINOR_VER = "0" -PATCH_VER = "0" +PATCH_VER = "1" -SRCREV ?= "0399d5a9682b3cef71c653373e38890c63c4c365" +SRCREV ?= "aa0ed8dac77bf205f2b376a44a0d161f4dafcb5a" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/${MAJOR_VER}.x" 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 db200b4..439701b 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 71040ed1f04234ddb7498f834780a7dcaee1fbf1 Mon Sep 17 00:00:00 2001 +From 364c720b5291ed32d14162fd2ddd5975a55fdbe9 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 32b0d39..a3c1256 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 aa5d4a3e2c24b5229d8170e518aa91623d15f197 Mon Sep 17 00:00:00 2001 +From d3caf3ac407c6d53f62f18dcec3ecb2cb33166ba 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 @@ -17,7 +17,7 @@ Signed-off-by: Khem Raj 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt -index ce69fff1370..47e09e34fc2 100644 +index aa0b124fc3c..e1503837f33 100644 --- a/libcxxabi/CMakeLists.txt +++ b/libcxxabi/CMakeLists.txt @@ -455,14 +455,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}") 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 796b965..916ac00 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 f0ae2066cccbe1095eb60bd41f53444fd01c2434 Mon Sep 17 00:00:00 2001 +From 438cdfa2636eb5c180de004feb4527f70c6c1f88 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 8bccb02..daa6079 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 785464a219c4d37ef9542e3674dcafdaa945a472 Mon Sep 17 00:00:00 2001 +From 0d904bb5f9f9876e09392cadf36e053e983951c3 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 60ee7fb..310e8d0 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 085fe7fd35c5f6b801c4a3aff1df6007259668fa Mon Sep 17 00:00:00 2001 +From c82435d462420d64e4fd249bd6673a12ef38d433 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 b09b8ef..bcc8c6d 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 187ca963c2d6faa84ea9f33c1c895e0b2702f116 Mon Sep 17 00:00:00 2001 +From 9076572a14be8f881d1395f144d07b0740f71c69 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 40aedfd..d71005f 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 a5cfe77db04dcab424dfbc5cb98d9566228cf9b5 Mon Sep 17 00:00:00 2001 +From 58d9492746d605752409824db350ce4e299c9739 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 7ad9d6b..bc89cfd 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 ccb11131c6a82b4fcdeb777015b74dff55abcd1a Mon Sep 17 00:00:00 2001 +From 8fe2337421af15dee7f0d2af7ed27695e2967723 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 a732a5e..d5795d6 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 fa7c046b11dc21b613ec7033b0f5e7b0658f7c70 Mon Sep 17 00:00:00 2001 +From 421fd7dbd379d6d2d89ee58527eca10da8cc643c 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 @@ -22,10 +22,10 @@ of a compile-time option (https://bugs.llvm.org/show_bug.cgi?id=13410) 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index d900508ad93..3e68d50dac2 100644 +index 7f59bc77f52..ed907549929 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp -@@ -972,8 +972,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, +@@ -975,8 +975,18 @@ void Linux::AddIAMCUIncludeArgs(const ArgList &DriverArgs, } bool Linux::isPIEDefault() const { 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 a169e0a..80cf185 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 75628b5ab0ea3e4d633f15dbab6dd16cf2e35ee2 Mon Sep 17 00:00:00 2001 +From c4954f2b9126edccbffa76d860aebf858c80bc4d 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 @@ -18,7 +18,7 @@ Signed-off-by: Khem Raj 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 3e68d50dac2..dbe5ed7d89e 100644 +index ed907549929..8cee2490cc7 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -593,12 +593,12 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 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 149c71d..a95b838 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 9a11a10ae400b590a9465e16e9019f33facf9d22 Mon Sep 17 00:00:00 2001 +From 3beedc96c33d7c7b0e3b1f9c402b7cda71764d4b 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 939af8a..22c1b3b 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 6d7d4ac713e3ab01e09cf61dd62d6c663a63dd4e Mon Sep 17 00:00:00 2001 +From 971efedff8fa505ac8c3786e190bec7e3bd2a544 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 89cc5be..87ccffd 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 dcbb050659b37f397238754ac005fec806aca558 Mon Sep 17 00:00:00 2001 +From cfc6e9f9deb0ef42ac024762cd2e7052641a0515 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 @@ -24,7 +24,7 @@ Signed-off-by: Khem Raj 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index dbe5ed7d89e..9bf66207ac9 100644 +index 8cee2490cc7..33037dafb57 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -223,7 +223,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args) 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 aa23abf..40c19a7 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 0e247141b80454d248c51a3139ed7e3cc3d149f3 Mon Sep 17 00:00:00 2001 +From e4b89d394dec7b9019faf2d3ad788142032b34b4 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 d6ee1bb..d8ec5d7 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 59debafd7650bf0af1e88ed6a461f14590f39b26 Mon Sep 17 00:00:00 2001 +From e8650cb2729787e0fa8edbfe6c32474472a673b8 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 3410d2f..04d9da7 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 a105a76862d92ad15520671971e333222618d275 Mon Sep 17 00:00:00 2001 +From 9d30864a94bced63a95a1fc300dbfad37a3d6038 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 @@ -14,7 +14,7 @@ Signed-off-by: Khem Raj 1 file changed, 8 insertions(+) diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp -index 9bf66207ac9..fc7d6c17484 100644 +index 33037dafb57..ff671fe27d2 100644 --- a/clang/lib/Driver/ToolChains/Linux.cpp +++ b/clang/lib/Driver/ToolChains/Linux.cpp @@ -519,6 +519,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const { 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 a063925..82b016e 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 b95744a9edf853fa4d8a4ed813760d8b2d8595b6 Mon Sep 17 00:00:00 2001 +From 9ec21455fc581e3755ff59af0828c7f7f9529968 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 b570ac2..b9e67d4 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 ba1d096576732493155834256698bfd3020790b3 Mon Sep 17 00:00:00 2001 +From 3a6bf36829e16fd7ab1c2eb6b93ed6caa8210cd1 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 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 aa4ad22..0a023ea 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 743e7a4f6e2f74e846151f07e498b3124ae73e71 Mon Sep 17 00:00:00 2001 +From a761afb9da0223ec9475288831f35c72c145a905 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 735a8cb..f9d4733 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 084a896c2032cec87d6ef073ca1ee562cf3d3b95 Mon Sep 17 00:00:00 2001 +From a11464585a13998f97e837a62b299bf66e2f90f0 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 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 deleted file mode 100644 index 848aaf6..0000000 --- a/recipes-devtools/clang/clang/0021-Driver-Prioritize-SYSROOT-usr-include-over-RESOURCE_.patch +++ /dev/null @@ -1,115 +0,0 @@ -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/0021-RISCV-Add-support-for-floating-point-registers-in-in.patch b/recipes-devtools/clang/clang/0021-RISCV-Add-support-for-floating-point-registers-in-in.patch new file mode 100644 index 0000000..b36d260 --- /dev/null +++ b/recipes-devtools/clang/clang/0021-RISCV-Add-support-for-floating-point-registers-in-in.patch @@ -0,0 +1,103 @@ +From 19de4c98078a98a0663e945d419fa2147a70fe9c 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/0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch b/recipes-devtools/clang/clang/0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch new file mode 100644 index 0000000..b799916 --- /dev/null +++ b/recipes-devtools/clang/clang/0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch @@ -0,0 +1,22 @@ +From 5864ac955ccfc19fc5a09f68b5a5e9961be18694 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/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 deleted file mode 100644 index ba7d901..0000000 --- a/recipes-devtools/clang/clang/0022-RISCV-Add-support-for-floating-point-registers-in-in.patch +++ /dev/null @@ -1,103 +0,0 @@ -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 deleted file mode 100644 index 08d8516..0000000 --- a/recipes-devtools/clang/clang/0023-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch +++ /dev/null @@ -1,22 +0,0 @@ -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-openmp-Recognise-ARMv7ve-machine-arch.patch b/recipes-devtools/clang/clang/0023-openmp-Recognise-ARMv7ve-machine-arch.patch new file mode 100644 index 0000000..59ee7b6 --- /dev/null +++ b/recipes-devtools/clang/clang/0023-openmp-Recognise-ARMv7ve-machine-arch.patch @@ -0,0 +1,28 @@ +From 68d9f584ed5e3b65af21548fb1a9f3547a14cd59 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/clang/0024-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0024-Check-for-atomic-double-intrinsics.patch new file mode 100644 index 0000000..842002e --- /dev/null +++ b/recipes-devtools/clang/clang/0024-Check-for-atomic-double-intrinsics.patch @@ -0,0 +1,32 @@ +From 376f2f44fbfb5d08742e478b193a9da667dab9bd Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 18 Nov 2019 17:00:29 -0800 +Subject: [PATCH] Check for atomic intrinsics + +On some architectures e.g. x86/32bit gcc decides to inline calls to +double atomic variables but clang does not and defers it to libatomic +therefore detect if clang can use built-ins for atomic if not +then link libatomic, this helps building clangd for x86 on linux systems +with gcc runtime + +Signed-off-by: Khem Raj +--- + llvm/cmake/modules/CheckAtomic.cmake | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake +index 9a4cdf12a62..e70ce924df9 100644 +--- a/llvm/cmake/modules/CheckAtomic.cmake ++++ b/llvm/cmake/modules/CheckAtomic.cmake +@@ -26,9 +26,10 @@ function(check_working_cxx_atomics64 varname) + #include + #include + std::atomic x (0); ++std::atomic y (0); + int main() { + uint64_t i = x.load(std::memory_order_relaxed); +- return 0; ++ return int(y); + } + " ${varname}) + set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) 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 deleted file mode 100644 index ec476fc..0000000 --- a/recipes-devtools/clang/clang/0024-openmp-Recognise-ARMv7ve-machine-arch.patch +++ /dev/null @@ -1,28 +0,0 @@ -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/clang/0025-Check-for-atomic-double-intrinsics.patch b/recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch deleted file mode 100644 index 04a5b93..0000000 --- a/recipes-devtools/clang/clang/0025-Check-for-atomic-double-intrinsics.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a580e8fcf17fb9cb9056debdd342ac4eabef4762 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 18 Nov 2019 17:00:29 -0800 -Subject: [PATCH] Check for atomic intrinsics - -On some architectures e.g. x86/32bit gcc decides to inline calls to -double atomic variables but clang does not and defers it to libatomic -therefore detect if clang can use built-ins for atomic if not -then link libatomic, this helps building clangd for x86 on linux systems -with gcc runtime - -Upstream-Status: Pending -Signed-off-by: Khem Raj ---- - llvm/cmake/modules/CheckAtomic.cmake | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/llvm/cmake/modules/CheckAtomic.cmake b/llvm/cmake/modules/CheckAtomic.cmake -index 9a4cdf12a62..e70ce924df9 100644 ---- a/llvm/cmake/modules/CheckAtomic.cmake -+++ b/llvm/cmake/modules/CheckAtomic.cmake -@@ -26,9 +26,10 @@ function(check_working_cxx_atomics64 varname) - #include - #include - std::atomic x (0); -+std::atomic y (0); - int main() { - uint64_t i = x.load(std::memory_order_relaxed); -- return 0; -+ return int(y); - } - " ${varname}) - set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index a21bc93..3f50fd0 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -28,11 +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://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 \ - file://0025-Check-for-atomic-double-intrinsics.patch \ + file://0021-RISCV-Add-support-for-floating-point-registers-in-in.patch \ + file://0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ + file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ + file://0024-Check-for-atomic-double-intrinsics.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From cd222aa915d22b102c5e365db1f3d0fb0f9b7c31 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 23 Nov 2019 12:04:54 -0800 Subject: layer.conf: Define LLVMVERSION in terms of clang version Signed-off-by: Khem Raj --- conf/layer.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/layer.conf b/conf/layer.conf index 967f052..96fed5f 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -28,5 +28,7 @@ INHERIT += "clang" # include clang in SDK CLANGSDK ??= "1" +LLVMVERSION = "9.0.1" + require conf/nonclangable.conf require conf/nonscanable.conf -- cgit v1.2.3-54-g00ecf From 9315ab76e68093779f553db3f9275de17a2dd15b Mon Sep 17 00:00:00 2001 From: Justin Bronder Date: Mon, 25 Nov 2019 16:07:52 -0500 Subject: clang: enable AMDGPU for all targets In 003dd05e4c168f7c3cccb9cbfad3fd8f38fe8741, clang replaced the oe-core provided llvm for building mesa. However, mesa needs AMDGPU to be enabled on the native target in order to build. Following the example of oe-core's recipe, just enable AMDGPU for all targets. Signed-off-by: Justin Bronder Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 0b16e1a..d67985c 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -87,10 +87,10 @@ LLVM_ENABLE_LIBEDIT;LLDB_DISABLE_LIBEDIT; \ # # Default to build all OE-Core supported target arches (user overridable). # -LLVM_TARGETS_TO_BUILD ?= "AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86" +LLVM_TARGETS_TO_BUILD ?= "AMDGPU;AArch64;ARM;BPF;Mips;PowerPC;RISCV;X86" LLVM_TARGETS_TO_BUILD_append = ";${@get_clang_host_arch(bb, d)};${@get_clang_target_arch(bb, d)}" -LLVM_TARGETS_TO_BUILD_TARGET ?= "AMDGPU;${LLVM_TARGETS_TO_BUILD}" +LLVM_TARGETS_TO_BUILD_TARGET ?= "${LLVM_TARGETS_TO_BUILD}" LLVM_TARGETS_TO_BUILD_TARGET_append ?= ";${@get_clang_target_arch(bb, d)}" LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ?= "" -- cgit v1.2.3-54-g00ecf From 4fe4ef97f24f2ac0aee1b1483a191d267c29ad4d Mon Sep 17 00:00:00 2001 From: Ross Burton Date: Mon, 2 Dec 2019 14:32:42 +0000 Subject: packagegroup: be lenient about CLANGSDK setting As CLANGSDK defaults to '1', users who have not read the README may think that setting it to '0' would disable adding Clang to the SDK. Little do they know that you need to *unset* the value for this to work (as bool('0') -> True). Change the logic to use bb.utils.contains(), so that '0' is not true. Signed-off-by: Ross Burton --- recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend | 2 +- .../packagegroups/packagegroup-core-standalone-sdk-target.bbappend | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend index 3472eb3..0c8ae6c 100644 --- a/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend +++ b/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend @@ -1 +1 @@ -RDEPENDS_${PN} += "${@'nativesdk-clang' if '${CLANGSDK}' else ''}" +RDEPENDS_${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'nativesdk-clang', '', d)}" diff --git a/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend index 2a727e0..59f0959 100644 --- a/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend +++ b/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bbappend @@ -1 +1 @@ -RRECOMMENDS_${PN} += "${@'libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev' if '${CLANGSDK}' else ''}" +RRECOMMENDS_${PN} += "${@bb.utils.contains('CLANGSDK', '1', 'libcxx-dev libcxx-staticdev compiler-rt-dev compiler-rt-staticdev', '', d)}" -- cgit v1.2.3-54-g00ecf From f96e80ca460004faecb9bdd36f7458799ddf0295 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Wed, 4 Dec 2019 11:44:24 -0600 Subject: clang: Fix multilib clang compile failing if lib is in the toolchain path Signed-off-by: Michael Davis Signed-off-by: Khem Raj --- .../0025-llvm-Let-llvm-ar-name-contain-lib.patch | 44 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 45 insertions(+) create mode 100644 recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch diff --git a/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch new file mode 100644 index 0000000..5edf8ad --- /dev/null +++ b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch @@ -0,0 +1,44 @@ +From fa44b5037ceac5d201b5ab0395ec9c5b928f79bf Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 4 Dec 2019 11:50:09 -0800 +Subject: [PATCH] llvm: Let llvm-ar name contain 'lib' + +In cross-compile cases canonical names are created using symlinks but +they fail to execute because the name confuses 'lib' instead of toolname + +In multilib(lib32) case, the arm-pokymllib32-linux-gnueabi-llvm-ar (${TARGET_PREFIX}llvm-ar) gives: +qc: no such file or directory + +Which is because when the llvm-ar symbol link's name contains "lib", it would be considered as llvm-lib: + +Signed-off-by: Michael Davis +Signed-off-by: Khem Raj +--- + llvm/tools/llvm-ar/llvm-ar.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp +index 91746d0fab3..daef39ede79 100644 +--- a/llvm/tools/llvm-ar/llvm-ar.cpp ++++ b/llvm/tools/llvm-ar/llvm-ar.cpp +@@ -1125,16 +1125,16 @@ int main(int argc, char **argv) { + llvm::InitializeAllAsmParsers(); + + Stem = sys::path::stem(ToolName); +- if (Stem.contains_lower("dlltool")) ++ if (Stem.endswith("dlltool") || Stem.contains("dlltool-")) + return dlltoolDriverMain(makeArrayRef(argv, argc)); + +- if (Stem.contains_lower("ranlib")) ++ if (Stem.endswith("ranlib") || Stem.contains("ranlib-")) + return ranlib_main(argc, argv); + +- if (Stem.contains_lower("lib")) ++ if (Stem.endswith("lib") || Stem.contains("lib-")) + return libDriverMain(makeArrayRef(argv, argc)); + +- if (Stem.contains_lower("ar")) ++ if (Stem.endswith("ar") || Stem.contains("ar-")) + return ar_main(argc, argv); + fail("Not ranlib, ar, lib or dlltool!"); + } diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 3f50fd0..c5e8d48 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -32,6 +32,7 @@ SRC_URI = "\ file://0022-Pass-PYTHON_EXECUTABLE-when-cross-compiling-for-nati.patch \ file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ file://0024-Check-for-atomic-double-intrinsics.patch \ + file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From ef7db76196c48aabe1bfbabfa365da45bcd16047 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 3 Dec 2019 10:31:02 -0600 Subject: clang: Fix cmake exports not finding native binaries Issue #230 Signed-off-by: Michael Davis Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 13 +++++++++++++ recipes-devtools/clang/llvm-common/llvm-config | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index d67985c..f33b78a 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -172,6 +172,19 @@ do_install() { rm -rf ${D}${libdir}/python*/site-packages/six.py } +do_install_append_class-target () { + # Allow bin path to change based on YOCTO_ALTERNATE_EXE_PATH + sed -i 's;${_IMPORT_PREFIX}/bin;${_IMPORT_PREFIX_BIN};g' ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake + + # Insert function to populate Import Variables + sed -i "4i\ +if(DEFINED ENV{YOCTO_ALTERNATE_EXE_PATH})\n\ + execute_process(COMMAND \"llvm-config\" \"--bindir\" OUTPUT_VARIABLE _IMPORT_PREFIX_BIN OUTPUT_STRIP_TRAILING_WHITESPACE)\n\ +else()\n\ + set(_IMPORT_PREFIX_BINARY \"\${_IMPORT_PREFIX}/bin\")\n\ +endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake +} + do_install_append_class-native () { install -Dm 0755 ${B}${BINPATHPREFIX}/bin/clang-tblgen ${D}${bindir}/clang-tblgen install -Dm 0755 ${B}${BINPATHPREFIX}/bin/lldb-tblgen ${D}${bindir}/lldb-tblgen diff --git a/recipes-devtools/clang/llvm-common/llvm-config b/recipes-devtools/clang/llvm-common/llvm-config index 4462896..a139514 100644 --- a/recipes-devtools/clang/llvm-common/llvm-config +++ b/recipes-devtools/clang/llvm-common/llvm-config @@ -18,6 +18,11 @@ if [[ $1 == "--libs" ]]; then exec "$NEXT_LLVM_CONFIG" $@ fi +if [[ $1 == "--bindir" ]]; then + unset YOCTO_ALTERNATE_EXE_PATH + exec "$NEXT_LLVM_CONFIG" $@ +fi + for arg in "$@"; do case "$arg" in --cppflags) -- cgit v1.2.3-54-g00ecf From a375163f9c30b24601450956a4f66ba23def5019 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Nov 2019 17:32:13 -0800 Subject: clang: Do not lock clang as only cross compiler option clang might be used for more than just static compiler on target and therefore lock-stepping it with needing clang cross-compiler is not right thing Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index f33b78a..179bd71 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -252,6 +252,5 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" -TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From a50bfa8eef7a021312f03204674b5cba05f7ff31 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 10:46:31 -0800 Subject: Revert "clang: Do not lock clang as only cross compiler option" This reverts commit cb86d1f837f8f8c40e8b00c9c29d136ed6a16a08. Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 179bd71..f33b78a 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -252,5 +252,6 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" +TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 5e4de05e6a05a57827499b1078a50c02c4f3a8e1 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 6 Dec 2019 23:36:58 -0800 Subject: clang: Update to 9.0.1-rc2 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 248ff28..4c028b4 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -8,7 +8,7 @@ MAJOR_VER = "9" MINOR_VER = "0" PATCH_VER = "1" -SRCREV ?= "aa0ed8dac77bf205f2b376a44a0d161f4dafcb5a" +SRCREV ?= "432bf48c08da748e2542cf40e3ab9aee53a744b0" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/${MAJOR_VER}.x" -- cgit v1.2.3-54-g00ecf From 70970debb568a47b5453d6c36c6da484da6bc2ec Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 7 Dec 2019 00:05:43 -0800 Subject: clang: Enable lto when asked for via DISTRO_FEATURES add 'thin-lto' or 'full-lto' to DISTRO_FEATURES to enable it instead of making it unconditional Should fix Issue #236 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index f33b78a..fb4020d 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -55,7 +55,7 @@ PACKAGECONFIG ??= "compiler-rt libcplusplus shared-libs lldb-wchar \ rtti eh libedit \ " PACKAGECONFIG_class-native = "rtti eh libedit" -PACKAGECONFIG_class-nativesdk = "rtti eh libedit thin-lto" +PACKAGECONFIG_class-nativesdk = "rtti eh libedit ${@bb.utils.filter('DISTRO_FEATURES', 'thin-lto full-lto', d)}" PACKAGECONFIG[compiler-rt] = "-DCLANG_DEFAULT_RTLIB=compiler-rt,,libcxx,compiler-rt" PACKAGECONFIG[libcplusplus] = "-DCLANG_DEFAULT_CXX_STDLIB=libc++,,libcxx" -- cgit v1.2.3-54-g00ecf From 345cf557f00ddd17d345dd2ce7d49075ec4c2305 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 8 Dec 2019 19:58:26 -0800 Subject: python3,x64: Can be compiled with clang9 Signed-off-by: Khem Raj --- conf/nonclangable.conf | 8 -------- 1 file changed, 8 deletions(-) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index ac51481..f50400d 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -103,10 +103,6 @@ TOOLCHAIN_pn-pulseaudio_armv7a = "gcc" # clang++ 6.0 crashes during link phase of a shared library TOOLCHAIN_pn-wpewebkit = "gcc" -# x264 causes a infinite loop when compiling 1 source file -# -TOOLCHAIN_pn-x264_x86 = "gcc" - #| /usr/src/debug/qemu/2.6.0-r1/qemu-2.6.0/util/bitmap.c:191: undefined reference to `__atomic_fetch_or_4' #| /usr/src/debug/qemu/2.6.0-r1/qemu-2.6.0/util/bitmap.c:210: undefined reference to `__atomic_fetch_or_4' #| libqemuutil.a(bitmap.o): In function `bitmap_test_and_clear_atomic': @@ -117,10 +113,6 @@ TOOLCHAIN_pn-x264_x86 = "gcc" # to compile qemu for target TOOLCHAIN_pn-qemu_arm = "gcc" -# llvm-profdata fails see -# | error: Could not read profile code.profd: No such file or directory -TOOLCHAIN_pn-python3 = "gcc" - #| ./dsp/v4f_IIR2.h:554:12: error: no matching function for call to 'v4f_map' #| a[5] = v4f_map<__builtin_cosf> (f); #| ^~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3-54-g00ecf From 180d86ec4714b63b661dfc3f21f50076f0cf5082 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 Dec 2019 16:09:16 -0800 Subject: clang: Update tool rename patch to match upstream one Signed-off-by: Khem Raj --- .../0025-llvm-Let-llvm-ar-name-contain-lib.patch | 136 ++++++++++++++++++--- 1 file changed, 121 insertions(+), 15 deletions(-) diff --git a/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch index 5edf8ad..0d5baab 100644 --- a/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch +++ b/recipes-devtools/clang/clang/0025-llvm-Let-llvm-ar-name-contain-lib.patch @@ -1,6 +1,6 @@ -From fa44b5037ceac5d201b5ab0395ec9c5b928f79bf Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Wed, 4 Dec 2019 11:50:09 -0800 +From e709fa8c221d21bce717b22fa4076c94d51f011e Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Tue, 10 Dec 2019 15:56:05 -0800 Subject: [PATCH] llvm: Let llvm-ar name contain 'lib' In cross-compile cases canonical names are created using symlinks but @@ -11,34 +11,140 @@ qc: no such file or directory Which is because when the llvm-ar symbol link's name contains "lib", it would be considered as llvm-lib: -Signed-off-by: Michael Davis +Signed-off-by: Fangrui Song Signed-off-by: Khem Raj --- - llvm/tools/llvm-ar/llvm-ar.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + llvm/test/tools/llvm-ar/tool-name.test | 15 ++++++++++++++ + llvm/test/tools/llvm-dlltool/tool-name.test | 13 ++++++++++++ + llvm/test/tools/llvm-lib/tool-name.test | 14 +++++++++++++ + llvm/test/tools/llvm-ranlib/tool-name.test | 13 ++++++++++++ + llvm/tools/llvm-ar/llvm-ar.cpp | 23 ++++++++++++++------- + 5 files changed, 71 insertions(+), 7 deletions(-) + create mode 100644 llvm/test/tools/llvm-ar/tool-name.test + create mode 100644 llvm/test/tools/llvm-dlltool/tool-name.test + create mode 100644 llvm/test/tools/llvm-lib/tool-name.test + create mode 100644 llvm/test/tools/llvm-ranlib/tool-name.test +diff --git a/llvm/test/tools/llvm-ar/tool-name.test b/llvm/test/tools/llvm-ar/tool-name.test +new file mode 100644 +index 00000000000..cb656d3b47f +--- /dev/null ++++ b/llvm/test/tools/llvm-ar/tool-name.test +@@ -0,0 +1,15 @@ ++## Don't make symlinks on Windows. ++# UNSUPPORTED: system-windows ++ ++# RUN: rm -rf %t ++# RUN: mkdir %t ++# RUN: ln -s llvm-ar %t/llvm-ar-9 ++# RUN: ln -s llvm-ar %t/ar.exe ++# RUN: ln -s llvm-ar %t/arm-pokymllib32-linux-gnueabi-llvm-ar-9 ++ ++# RUN: llvm-ar h | FileCheck %s ++# RUN: %t/llvm-ar-9 h | FileCheck %s ++# RUN: %t/ar.exe h | FileCheck %s ++# RUN: %t/arm-pokymllib32-linux-gnueabi-llvm-ar-9 h | FileCheck %s ++ ++# CHECK: USAGE: llvm-ar +diff --git a/llvm/test/tools/llvm-dlltool/tool-name.test b/llvm/test/tools/llvm-dlltool/tool-name.test +new file mode 100644 +index 00000000000..e9d8680322d +--- /dev/null ++++ b/llvm/test/tools/llvm-dlltool/tool-name.test +@@ -0,0 +1,13 @@ ++## Don't make symlinks on Windows. ++# UNSUPPORTED: system-windows ++ ++# RUN: rm -rf %t ++# RUN: mkdir %t ++# RUN: ln -s llvm-dlltool %t/dlltool.exe ++# RUN: ln -s llvm-dlltool %t/dlltool-10 ++ ++# RUN: not llvm-dlltool 2>&1 | FileCheck %s ++# RUN: not %t/dlltool.exe 2>&1 | FileCheck %s ++# RUN: not %t/dlltool-10 2>&1 | FileCheck %s ++ ++# CHECK: USAGE: llvm-dlltool +diff --git a/llvm/test/tools/llvm-lib/tool-name.test b/llvm/test/tools/llvm-lib/tool-name.test +new file mode 100644 +index 00000000000..9c0f7b5de73 +--- /dev/null ++++ b/llvm/test/tools/llvm-lib/tool-name.test +@@ -0,0 +1,14 @@ ++## Don't make symlinks on Windows. ++# UNSUPPORTED: system-windows ++ ++# RUN: rm -rf %t ++# RUN: mkdir %t ++## See D44808, MSBuild runs Lib.exe ++# RUN: ln -s llvm-lib %t/Lib.exe ++# RUN: ln -s llvm-lib %t/llvm-lib-10 ++ ++# RUN: llvm-lib '/?' | FileCheck %s ++# RUN: %t/Lib.exe '/?' | FileCheck %s ++# RUN: %t/llvm-lib-10 '/?' | FileCheck %s ++ ++# CHECK: USAGE: llvm-lib +diff --git a/llvm/test/tools/llvm-ranlib/tool-name.test b/llvm/test/tools/llvm-ranlib/tool-name.test +new file mode 100644 +index 00000000000..bd2b4965331 +--- /dev/null ++++ b/llvm/test/tools/llvm-ranlib/tool-name.test +@@ -0,0 +1,13 @@ ++## Don't make symlinks on Windows. ++# UNSUPPORTED: system-windows ++ ++# RUN: rm -rf %t ++# RUN: mkdir %t ++# RUN: ln -s llvm-ranlib %t/llvm-ranlib-9 ++# RUN: ln -s llvm-ranlib %t/ranlib.exe ++ ++# RUN: llvm-ranlib -h | FileCheck %s ++# RUN: %t/llvm-ranlib-9 -h | FileCheck %s ++# RUN: %t/ranlib.exe -h | FileCheck %s ++ ++# CHECK: USAGE: llvm-ranlib diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp -index 91746d0fab3..daef39ede79 100644 +index 91746d0fab3..a7118371f1e 100644 --- a/llvm/tools/llvm-ar/llvm-ar.cpp +++ b/llvm/tools/llvm-ar/llvm-ar.cpp -@@ -1125,16 +1125,16 @@ int main(int argc, char **argv) { +@@ -11,6 +11,7 @@ + // + //===----------------------------------------------------------------------===// + ++#include "llvm/ADT/StringExtras.h" + #include "llvm/ADT/StringSwitch.h" + #include "llvm/ADT/Triple.h" + #include "llvm/IR/LLVMContext.h" +@@ -1125,16 +1126,24 @@ int main(int argc, char **argv) { llvm::InitializeAllAsmParsers(); Stem = sys::path::stem(ToolName); - if (Stem.contains_lower("dlltool")) -+ if (Stem.endswith("dlltool") || Stem.contains("dlltool-")) ++ auto Is = [](StringRef Tool) { ++ // We need to recognize the following filenames. ++ // ++ // Lib.exe -> lib (see D44808, MSBuild runs Lib.exe) ++ // dlltool.exe -> dlltool ++ // arm-pokymllib32-linux-gnueabi-llvm-ar-10 -> ar ++ auto I = Stem.rfind_lower(Tool); ++ return I != StringRef::npos && ++ (I + Tool.size() == Stem.size() || !isAlnum(Stem[I + Tool.size()])); ++ }; ++ ++ if (Is("dlltool")) return dlltoolDriverMain(makeArrayRef(argv, argc)); - +- - if (Stem.contains_lower("ranlib")) -+ if (Stem.endswith("ranlib") || Stem.contains("ranlib-")) ++ if (Is("ranlib")) return ranlib_main(argc, argv); - +- - if (Stem.contains_lower("lib")) -+ if (Stem.endswith("lib") || Stem.contains("lib-")) ++ if (Is("lib")) return libDriverMain(makeArrayRef(argv, argc)); - +- - if (Stem.contains_lower("ar")) -+ if (Stem.endswith("ar") || Stem.contains("ar-")) ++ if (Is("ar")) return ar_main(argc, argv); fail("Not ranlib, ar, lib or dlltool!"); } -- cgit v1.2.3-54-g00ecf From b4cb98f1f5dbb262b28c15281700305ef8a4b2e3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 11 Dec 2019 10:25:49 -0800 Subject: clang: Use cmake variable for libdl This ensures that clang can link with libdl on platforms where needed Fixes issue #241 Signed-off-by: Khem Raj --- ...lang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch | 33 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 34 insertions(+) create mode 100644 recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch diff --git a/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch b/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch new file mode 100644 index 0000000..18008c3 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch @@ -0,0 +1,33 @@ +From 9c37e644d96de108d931a6bcce1819a666ae91d8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Wed, 11 Dec 2019 10:23:15 -0800 +Subject: [PATCH] libclang: Use CMAKE_DL_LIBS for deducing libdl + +This helps in getting right settings for libdl irrespective of platform +it also fixes build with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON + +Fixes + +tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexer.cpp.o: In function clang::CIndexer::getClangResourcesPath[abi:cxx11]()': 2019-12-06T06:04:39.2987601Z | CIndexer.cpp:(.text._ZN5clang8CIndexer21getClangResourcesPathB5cxx11Ev+0x8b): undefined reference to dladdr' + +Signed-off-by: Khem Raj +--- + clang/tools/libclang/CMakeLists.txt | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt +index 613ead1a36b..9d5cd0ba9df 100644 +--- a/clang/tools/libclang/CMakeLists.txt ++++ b/clang/tools/libclang/CMakeLists.txt +@@ -58,9 +58,8 @@ if (TARGET clangTidyPlugin) + endif() + endif () + +-find_library(DL_LIBRARY_PATH dl) +-if (DL_LIBRARY_PATH) +- list(APPEND LIBS dl) ++if (HAVE_LIBDL) ++ list(APPEND LIBS ${CMAKE_DL_LIBS}) + endif() + + option(LIBCLANG_BUILD_STATIC diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index c5e8d48..0f632f8 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -33,6 +33,7 @@ SRC_URI = "\ file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ file://0024-Check-for-atomic-double-intrinsics.patch \ file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ + file://0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From fa64e059b167870dca186fc9adc8dfdc5a58292d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 11 Dec 2019 23:01:23 -0800 Subject: hdf5: Use gcc on musl/x86_64 clang crashes for some reason Signed-off-by: Khem Raj --- conf/nonclangable.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index f50400d..4dca172 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -17,6 +17,14 @@ TOOLCHAIN_pn-glibc-scripts = "gcc" TOOLCHAIN_pn-glibc-testsuite = "gcc" TOOLCHAIN_pn-grub = "gcc" TOOLCHAIN_pn-grub-efi = "gcc" + +# Clang crashes on musl/x86_64 +# Running pass 'Function Pass Manager' on module '/mnt/b/yoe/build/tmp/work/core2-64- +# yoe-linux-musl/hdf5/1.8.21-r0/hdf5-1.8.21/src/H5detect.c'. +# Running pass 'X86 Assembly Printer' on function '@detect_C99_floats' +# clang-9: error: unable to execute command: Segmentation fault (core dumped) +TOOLCHAIN_pn-hdf5_libc-musl_x86-64 = "gcc" + # VLAs #| control.c:286:19: error: fields must have a constant size: 'variable length array in structure' extension will never be supported #| __u32 buffer[cam->max_response_quads]; -- cgit v1.2.3-54-g00ecf From f7b778be0cb933c454eb36d359eb7ac2d1bb46da Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 13 Dec 2019 23:50:15 -0800 Subject: libexecinfo,openflow: Use gcc on mips Fails with error on clang error: return address can be determined only for current frame Signed-off-by: Khem Raj --- conf/nonclangable.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index 4dca172..dd5eb51 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -31,6 +31,9 @@ TOOLCHAIN_pn-hdf5_libc-musl_x86-64 = "gcc" #| ^ #| 1 error generated. TOOLCHAIN_pn-libdc1394 = "gcc" + +# error: return address can be determined only for current frame +TOOLCHAIN_pn-libexecinfo_mipsarch = "gcc" TOOLCHAIN_pn-libgcc = "gcc" TOOLCHAIN_pn-libgcc-initial = "gcc" TOOLCHAIN_pn-libgfortran = "gcc" @@ -50,6 +53,8 @@ TOOLCHAIN_pn-mesa_powerpc = "gcc" TOOLCHAIN_pn-mongodb = "gcc" # variant-impl.hpp:309:36: error: 'is_variant' does not name a template but is followed by template arguments TOOLCHAIN_pn-omxplayer = "gcc" +# error: return address can be determined only for current frame +TOOLCHAIN_pn-openflow_mipsarch = "gcc" TOOLCHAIN_pn-opensbi = "gcc" TOOLCHAIN_pn-openjdk-8 = "gcc" TOOLCHAIN_pn-openjre-8 = "gcc" -- cgit v1.2.3-54-g00ecf From c17bbdbf8c9153f9e6c71b634cb83b000c26593d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 14 Dec 2019 21:40:18 -0800 Subject: cpio: Link with compiler-rt when using clang Fixes /usr/src/debug/cpio/2.13-r0/build/gnu/../../cpio-2.13/gnu/xmalloc.c:100: undefined reference to `__mulodi4' clang-9: error: linker command failed with exit code 1 (use -v to see invocation) Makefile:1124: recipe for target 'rmt' failed Signed-off-by: Khem Raj --- conf/nonclangable.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index dd5eb51..70336bb 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf @@ -222,6 +222,7 @@ TUNE_CCARGS_remove_pn-omxplayer_toolchain-clang = "-no-integrated-as" #| clang-7: error: linker command failed with exit code 1 (use -v to see invocation) COMPILER_RT_pn-ruby_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-m4_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" +COMPILER_RT_pn-cpio_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_pn-webkitgtk_toolchain-clang = "--rtlib=compiler-rt ${UNWINDLIB}" COMPILER_RT_remove_pn-m4_powerpc = "--rtlib=compiler-rt" COMPILER_RT_remove_pn-ruby_powerpc = "--rtlib=compiler-rt" -- cgit v1.2.3-54-g00ecf From 9dc8119ad7414b2e7ff1ebd98a48737c015bb171 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 16 Dec 2019 17:41:45 +0900 Subject: Compute LLVM_LIBDIR_SUFFIX correctly on multiarch environment Co-authored-by: INAJIMA Daisuke --- recipes-devtools/clang/clang.inc | 18 ++++++++++++++++++ recipes-devtools/clang/compiler-rt_git.bb | 1 + recipes-devtools/clang/libcxx_git.bb | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index 4c028b4..b631c0e4 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -18,4 +18,22 @@ CLANGMD5SUM = "ff42885ed2ab98f1ecb8c1fc41205343" LLDMD5SUM = "ae7dc7c027b1fa89b5b013d391d3ee2b" LLDBMD5SUM = "2e0d44968471fcde980034dbb826bea9" +def get_libdir_suffix(d, arch_var): + import re + multilibs = (d.getVar("MULTILIB_VARIANTS") or "").split() + if multilibs: + a = d.getVar(arch_var, True) + if re.match('(i.86|athlon)$', a): return '32' + elif re.match('x86.64$', a): return '64' + elif re.match('(arm|armbe)$', a): return '32' + elif re.match('(aarch64|aarch64_be)$', a): return '64' + elif re.match('mips(isa|)32(r6|)(el|)$', a): return '32' + elif re.match('mips(isa|)64(r6|)(el|)$', a): return '64' + elif re.match('p(pc|owerpc)', a): return '32' + elif re.match('p(pc|owerpc)64', a): return '64' + else: + return '' + +LLVM_LIBDIR_SUFFIX="${@get_libdir_suffix(d, 'TARGET_ARCH')}" + require common.inc diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index e76a560..f331a07 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -31,6 +31,7 @@ EXTRA_OECMAKE += "-DCOMPILER_RT_STANDALONE_BUILD=OFF \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ranlib \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-ar \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}llvm-nm \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -G Ninja ${S}/llvm \ " diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 2d530c5..01d9260 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -51,7 +51,7 @@ EXTRA_OECMAKE += "\ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ -DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi;libunwind' \ - -DLLVM_LIBDIR_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ + -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} \ -G Ninja \ ${S}/llvm \ " -- cgit v1.2.3-54-g00ecf From 6d802c562de57d28352f880ab0d1be60b4c98612 Mon Sep 17 00:00:00 2001 From: Hiroshi Hatake Date: Mon, 16 Dec 2019 17:42:10 +0900 Subject: Package compiler-rt correctly with non-empty LLVM_LIBDIR_SUFFIX --- recipes-devtools/clang/compiler-rt_git.bb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/recipes-devtools/clang/compiler-rt_git.bb b/recipes-devtools/clang/compiler-rt_git.bb index f331a07..3c0f214 100644 --- a/recipes-devtools/clang/compiler-rt_git.bb +++ b/recipes-devtools/clang/compiler-rt_git.bb @@ -76,12 +76,12 @@ sysroot_stage_all_append_class-target() { } FILES_SOLIBSDEV = "" -FILES_${PN} += "${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ - ${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ - ${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" -FILES_${PN}-staticdev += "${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" -FILES_${PN}-dev += "${datadir} ${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ - ${exec_prefix}/lib/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ +FILES_${PN} += "${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/lib*${SOLIBSDEV} \ + ${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/*.txt \ + ${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/share/*.txt" +FILES_${PN}-staticdev += "${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.a" +FILES_${PN}-dev += "${datadir} ${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/*.syms \ + ${exec_prefix}/lib${LLVM_LIBDIR_SUFFIX}/clang/${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}/lib/linux/clang_rt.crt*.o \ " INSANE_SKIP_${PN} = "dev-so libdir" -- cgit v1.2.3-54-g00ecf From 2628b9d2219bb136612a85b6596043409fbbd22c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 16 Dec 2019 13:31:02 -0800 Subject: openmp: Mark mips64 unsupported host Fixes error Unknown or unsupported architecture Signed-off-by: Khem Raj --- recipes-devtools/clang/openmp_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/openmp_git.bb b/recipes-devtools/clang/openmp_git.bb index 4de2f4a..d2c3909 100644 --- a/recipes-devtools/clang/openmp_git.bb +++ b/recipes-devtools/clang/openmp_git.bb @@ -35,3 +35,4 @@ INSANE_SKIP_${PN} = "dev-so" COMPATIBLE_HOST_riscv64 = "null" COMPATIBLE_HOST_riscv32 = "null" +COMPATIBLE_HOST_mips64 = "null" -- cgit v1.2.3-54-g00ecf From d58a2633b58f69b1fbc8bafbc5c5a50dbc4ddfa3 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Tue, 17 Dec 2019 09:38:08 -0600 Subject: clang: Fix cmake exports sed variable using incorrect name Signed-off-by: Michael Davis --- recipes-devtools/clang/clang_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index fb4020d..383866c 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -181,7 +181,7 @@ do_install_append_class-target () { if(DEFINED ENV{YOCTO_ALTERNATE_EXE_PATH})\n\ execute_process(COMMAND \"llvm-config\" \"--bindir\" OUTPUT_VARIABLE _IMPORT_PREFIX_BIN OUTPUT_STRIP_TRAILING_WHITESPACE)\n\ else()\n\ - set(_IMPORT_PREFIX_BINARY \"\${_IMPORT_PREFIX}/bin\")\n\ + set(_IMPORT_PREFIX_BIN \"\${_IMPORT_PREFIX}/bin\")\n\ endif()\n" ${D}${libdir}/cmake/llvm/LLVMExports-release.cmake } -- cgit v1.2.3-54-g00ecf From 8f35558049253b9a935da35cec2e255bafdc2db3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 17 Dec 2019 16:25:44 -0800 Subject: ffmpeg,gstreamer1.0-libav: Fix mips64/clang build error Signed-off-by: Khem Raj --- .../ffmpeg/ffmpeg/clang_mips64.patch | 28 +++++++++++++++ recipes-multimedia/ffmpeg/ffmpeg_%.bbappend | 3 ++ ...-using-code-when-using-clang-mips64-combo.patch | 40 ++++++++++++++++++++++ .../gstreamer/gstreamer1.0-libav_%.bbappend | 4 +++ 4 files changed, 75 insertions(+) create mode 100644 recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch create mode 100644 recipes-multimedia/ffmpeg/ffmpeg_%.bbappend create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend diff --git a/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch b/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch new file mode 100644 index 0000000..9206af1 --- /dev/null +++ b/recipes-multimedia/ffmpeg/ffmpeg/clang_mips64.patch @@ -0,0 +1,28 @@ +Disable fpu using code when using clang/mips64 combo +it works around clang's inline asm error + +error: couldn't allocate output register for constraint 'r' + +Upstream-Status: Pending +Signed-off-by: Khem Raj + +--- a/libavcodec/mips/aacdec_mips.c ++++ b/libavcodec/mips/aacdec_mips.c +@@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *a + } + } + +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) + { + /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ +@@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) + #if HAVE_INLINE_ASM + c->imdct_and_windowing = imdct_and_windowing_mips; + c->apply_ltp = apply_ltp_mips; +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + c->update_ltp = update_ltp_mips; + #endif /* HAVE_MIPSFPU */ + #endif /* HAVE_INLINE_ASM */ diff --git a/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend b/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend new file mode 100644 index 0000000..2077fda --- /dev/null +++ b/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append_toolchain-clang_mips64 = " file://clang_mips64.patch" diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch b/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch new file mode 100644 index 0000000..93ab73f --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch @@ -0,0 +1,40 @@ +From 91c980d4cf88b0c12fe5971fe16c7b97b5a942af Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 17 Dec 2019 14:57:55 -0800 +Subject: [PATCH] Disable fpu using code when using clang/mips64 combo + +it works around clang's inline asm error + +error: couldn't allocate output register for constraint 'r' + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c +index 253cdeb..df4f25d 100644 +--- a/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c ++++ b/gst-libs/ext/libav/libavcodec/mips/aacdec_mips.c +@@ -282,7 +282,7 @@ static void apply_ltp_mips(AACContext *ac, SingleChannelElement *sce) + } + } + +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + static av_always_inline void fmul_and_reverse(float *dst, const float *src0, const float *src1, int count) + { + /* Multiply 'count' floats in src0 by src1 and store the results in dst in reverse */ +@@ -435,7 +435,7 @@ void ff_aacdec_init_mips(AACContext *c) + #if HAVE_INLINE_ASM + c->imdct_and_windowing = imdct_and_windowing_mips; + c->apply_ltp = apply_ltp_mips; +-#if HAVE_MIPSFPU ++#if HAVE_MIPSFPU && !defined(__clang__) + c->update_ltp = update_ltp_mips; + #endif /* HAVE_MIPSFPU */ + #endif /* HAVE_INLINE_ASM */ +-- +2.24.1 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend new file mode 100644 index 0000000..dee9619 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-libav_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append_toolchain-clang_mips64 = " file://0001-Disable-fpu-using-code-when-using-clang-mips64-combo.patch" + -- cgit v1.2.3-54-g00ecf From ee3921863461b4dcc59390df3c7b88db81567561 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 17 Dec 2019 16:27:09 -0800 Subject: clang: Use LLVM_USE_SPLIT_DWARF=ON This helps in consuming less memory during link stage and also fixed link failures on mips64 Using clang cross itself ends up crashing | clang-9: error: unable to execute command: Killed | clang-9: error: linker command failed due to signal (use -v to see invocation) Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 383866c..825bd1d 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -113,6 +113,7 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;lldb' \ -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR} \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ + -DLLVM_USE_SPLIT_DWARF=ON \ -G Ninja ${S}/llvm \ " @@ -210,8 +211,6 @@ do_install_append_class-nativesdk () { rm -rf ${D}${datadir}/llvm } -PACKAGE_DEBUG_SPLIT_STYLE_class-nativesdk = "debug-without-src" - PACKAGES =+ "${PN}-libllvm ${PN}-lldb-python libclang" PROVIDES += "llvm llvm${PV}" -- cgit v1.2.3-54-g00ecf From 94eccf90de4dc752d95d1d604d871294557f88fa Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 18 Dec 2019 23:45:28 -0800 Subject: clang: Update to 9.0.1 RC3 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index b631c0e4..3fd0723 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -8,7 +8,7 @@ MAJOR_VER = "9" MINOR_VER = "0" PATCH_VER = "1" -SRCREV ?= "432bf48c08da748e2542cf40e3ab9aee53a744b0" +SRCREV ?= "c1a0a213378a458fbea1a5c77b315c7dce08fd05" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "release/${MAJOR_VER}.x" -- cgit v1.2.3-54-g00ecf From 65e99142dffa55084712cd02304943509447ad50 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 20 Dec 2019 13:19:02 -0800 Subject: libcxx: Fix build on architectures with baselib != lib Signed-off-by: Khem Raj --- recipes-devtools/clang/libcxx_git.bb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index 01d9260..7325e4f 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb @@ -32,6 +32,8 @@ LIC_FILES_CHKSUM = "file://libcxx/LICENSE.TXT;md5=55d89dd7eec8d3b4204b680e27da39 file://libunwind/LICENSE.TXT;md5=f66970035d12f196030658b11725e1a1 \ " +LLVM_LIBDIR_SUFFIX_powerpc64 = "64" + EXTRA_OECMAKE += "\ -DCMAKE_CROSSCOMPILING=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ @@ -46,7 +48,7 @@ EXTRA_OECMAKE += "\ -DLIBCXX_CXX_ABI=libcxxabi \ -DLIBCXX_USE_COMPILER_RT=ON \ -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/libcxxabi/include \ - -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/${baselib} \ + -DLIBCXX_CXX_ABI_LIBRARY_PATH=${B}/lib${LLVM_LIBDIR_SUFFIX} \ -DCMAKE_AR=${STAGING_BINDIR_TOOLCHAIN}/${AR} \ -DCMAKE_NM=${STAGING_BINDIR_TOOLCHAIN}/${NM} \ -DCMAKE_RANLIB=${STAGING_BINDIR_TOOLCHAIN}/${RANLIB} \ -- cgit v1.2.3-54-g00ecf From 9cd45fb6c6d2786fe8d49f9c511b527b4ed46526 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 Dec 2019 18:18:54 -0800 Subject: compiler-rt: Fix build with glibc 2.31 Signed-off-by: Khem Raj --- ...ix-sanitizer-common-build-with-glibc-2.31.patch | 81 ++++++++++++++++++++++ recipes-devtools/clang/common.inc | 1 + 2 files changed, 82 insertions(+) create mode 100644 recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch diff --git a/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch b/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch new file mode 100644 index 0000000..4c05fc6 --- /dev/null +++ b/recipes-devtools/clang/clang/0027-Fix-sanitizer-common-build-with-glibc-2.31.patch @@ -0,0 +1,81 @@ +From 322766bb272ca8f818fe26a74ac1254a3d2b0201 Mon Sep 17 00:00:00 2001 +From: Evgenii Stepanov +Date: Mon, 25 Nov 2019 13:52:17 -0800 +Subject: [PATCH] Fix sanitizer-common build with glibc 2.31 + +Summary: +As mentioned in D69104, glibc changed ABI recently with the [[ https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=2f959dfe849e0646e27403f2e4091536496ac0f0| 2f959dfe ]] change. +D69104 dealt with just 32-bit ARM, but that is just one of the many affected architectures. +E.g. x86_64, i?86, riscv64, sparc 32-bit, s390 31-bit are affected too (and various others). + +This patch instead of adding a long list of further architectures that wouldn't be checked ever next to arm 32-bit changes the structures to match the 2.31 layout and performs the checking on Linux for ipc_perm mode position/size only on non-Linux or on Linux with glibc 2.31 or later. I think this matches what is done for aarch64 already. +If needed, we could list architectures that haven't changed ABI (e.g. powerpc), so that they would be checked even with older glibcs. AFAIK sanitizers don't actually use ipc_perm.mode and +so all they care about is the size and alignment of the whole structure. + +Note, s390 31-bit and arm 32-bit big-endian changed ABI even further, there will now be shmctl with old symbol version and shmctl@@GLIBC_2.31 which will be incompatible. I'm afraid this isn't really solvable unless the sanitizer libraries are symbol versioned and use matching symbol versions to glibc symbols for stuff they intercept, plus use dlvsym. +This patch doesn't try to address that. + +Patch by Jakub Jelinek. + +Reviewers: kcc, eugenis, dvyukov + +Reviewed By: eugenis + +Subscribers: jyknight, kristof.beyls, fedor.sergeev, simoncook, PkmX, s.egerton, steven.zhang, #sanitizers, llvm-commits + +Tags: #sanitizers, #llvm + +Differential Revision: https://reviews.llvm.org/D70662 +--- + .../sanitizer_platform_limits_posix.cc | 5 +++-- + .../sanitizer_platform_limits_posix.h | 15 +-------------- + 2 files changed, 4 insertions(+), 16 deletions(-) + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +index b7fa6e8f7e0..abdf7941b5c 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1126,8 +1126,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) +-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) ++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit ++ on many architectures. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +index f1a4fd7d370..029a209fc03 100644 +--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -203,26 +203,13 @@ namespace __sanitizer { + u64 __unused1; + u64 __unused2; + #elif defined(__sparc__) +-#if defined(__arch64__) + unsigned mode; +- unsigned short __pad1; +-#else +- unsigned short __pad1; +- unsigned short mode; + unsigned short __pad2; +-#endif + unsigned short __seq; + unsigned long long __unused1; + unsigned long long __unused2; +-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__) +- unsigned int mode; +- unsigned short __seq; +- unsigned short __pad1; +- unsigned long __unused1; +- unsigned long __unused2; + #else +- unsigned short mode; +- unsigned short __pad1; ++ unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 0f632f8..044a9ab 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -34,6 +34,7 @@ SRC_URI = "\ file://0024-Check-for-atomic-double-intrinsics.patch \ file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ file://0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch \ + file://0027-Fix-sanitizer-common-build-with-glibc-2.31.patch \ " # Fallback to no-PIE if not set -- cgit v1.2.3-54-g00ecf From eaef80a97f039dafa2fbeb53f1e35071b9d82760 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 25 Dec 2019 15:56:32 -0800 Subject: clang: Turn split-dwarf setting into a packageconfig knob Disable it by default, since centos7/gcc4.8 can't handle it Fixes Issue #262 Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 825bd1d..13138c1 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -68,6 +68,7 @@ PACKAGECONFIG[lldb-wchar] = "-DLLDB_EDITLINE_USE_WCHAR=1,-DLLDB_EDITLINE_USE_WCH PACKAGECONFIG[bootstrap] = "-DCLANG_ENABLE_BOOTSTRAP=On -DCLANG_BOOTSTRAP_PASSTHROUGH='${PASSTHROUGH}' -DBOOTSTRAP_LLVM_ENABLE_LTO=Thin -DBOOTSTRAP_LLVM_ENABLE_LLD=ON,,," PACKAGECONFIG[eh] = "-DLLVM_ENABLE_EH=ON,-DLLVM_ENABLE_EH=OFF,," PACKAGECONFIG[rtti] = "-DLLVM_ENABLE_RTTI=ON,-DLLVM_ENABLE_RTTI=OFF,," +PACKAGECONFIG[split-dwarf] = "-DLLVM_USE_SPLIT_DWARF=ON,-DLLVM_USE_SPLIT_DWARF=OFF,," PACKAGECONFIG[libedit] = "-DLLVM_ENABLE_LIBEDIT=ON -DLLDB_DISABLE_LIBEDIT=0,-DLLVM_ENABLE_LIBEDIT=OFF -DLLDB_DISABLE_LIBEDIT=1,libedit libedit-native" BUILDTARGET = "${@bb.utils.contains('PACKAGECONFIG', 'bootstrap', 'stage2', '', d)}" @@ -113,7 +114,6 @@ EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \ -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;lldb' \ -DLLVM_BINUTILS_INCDIR=${STAGING_INCDIR} \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ - -DLLVM_USE_SPLIT_DWARF=ON \ -G Ninja ${S}/llvm \ " -- cgit v1.2.3-54-g00ecf From 533da721e0cc5bb2d29c059e4e4312e5d54fa9d5 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 16 Nov 2019 17:32:13 -0800 Subject: clang: Do not lock clang as only cross compiler option clang might be used for more than just static compiler on target and therefore lock-stepping it with needing clang cross-compiler is not right thing Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 13138c1..44e9136 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -251,6 +251,5 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" -TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 8452609cef63596e097f73480647aeb05227eeef Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 10:46:31 -0800 Subject: Revert "clang: Do not lock clang as only cross compiler option" This reverts commit cb86d1f837f8f8c40e8b00c9c29d136ed6a16a08. Signed-off-by: Khem Raj --- recipes-devtools/clang/clang_git.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes-devtools/clang/clang_git.bb b/recipes-devtools/clang/clang_git.bb index 44e9136..13138c1 100644 --- a/recipes-devtools/clang/clang_git.bb +++ b/recipes-devtools/clang/clang_git.bb @@ -251,5 +251,6 @@ INSANE_SKIP_${PN}-lldb-python += "dev-so dev-deps" #Avoid SSTATE_SCAN_COMMAND running sed over llvm-config. SSTATE_SCAN_FILES_remove = "*-config" +TOOLCHAIN = "clang" TOOLCHAIN_class-native = "gcc" TOOLCHAIN_class-nativesdk = "clang" -- cgit v1.2.3-54-g00ecf From 335d959b15cb7745267490c7cf50050dbf5c023b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 17 Nov 2019 16:33:49 -0800 Subject: clangd: Always link with libatomic Since it uses double atomics which are not available yet as intrinsics Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch new file mode 100644 index 0000000..1122d6a --- /dev/null +++ b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch @@ -0,0 +1,37 @@ +From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 17 Nov 2019 16:26:07 -0800 +Subject: [PATCH] clangd: Always link with libatomic + +Trace.cpp uses atomic which is not available as instrinsic +its only added in c++20, until then link with libatomic + +Another solution would be to not use double atomics something like below + +- std::atomic EndTime; // Filled in by markEnded(). ++ std::atomic EndTime; // Filled in by markEnded(). + +but I don't know if this would be just the change needed or more is +required + +Signed-off-by: Khem Raj +--- + clang-tools-extra/clangd/CMakeLists.txt | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt +index f617f7931de..2be738c6097 100644 +--- a/clang-tools-extra/clangd/CMakeLists.txt ++++ b/clang-tools-extra/clangd/CMakeLists.txt +@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) + include(CheckAtomic) + endif() + +-set(CLANGD_ATOMIC_LIB "") +-if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) +- list(APPEND CLANGD_ATOMIC_LIB "atomic") +-endif() ++list(APPEND CLANGD_ATOMIC_LIB "atomic") + + add_clang_library(clangDaemon + AST.cpp -- cgit v1.2.3-54-g00ecf From cb6fd933a6400a54933d86824fbe7f8e1f52f375 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 18 Nov 2019 16:42:17 -0800 Subject: Revert "clangd: Always link with libatomic" This reverts commit 2fdb19c4f8b025d4465d78cdf1bc05d786f5e087. Signed-off-by: Khem Raj --- .../0025-clangd-Always-link-with-libatomic.patch | 37 ---------------------- 1 file changed, 37 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch diff --git a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch b/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch deleted file mode 100644 index 1122d6a..0000000 --- a/recipes-devtools/clang/clang/0025-clangd-Always-link-with-libatomic.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 59a72650c3ffcda09e430888e27750ee5008a957 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Sun, 17 Nov 2019 16:26:07 -0800 -Subject: [PATCH] clangd: Always link with libatomic - -Trace.cpp uses atomic which is not available as instrinsic -its only added in c++20, until then link with libatomic - -Another solution would be to not use double atomics something like below - -- std::atomic EndTime; // Filled in by markEnded(). -+ std::atomic EndTime; // Filled in by markEnded(). - -but I don't know if this would be just the change needed or more is -required - -Signed-off-by: Khem Raj ---- - clang-tools-extra/clangd/CMakeLists.txt | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt -index f617f7931de..2be738c6097 100644 ---- a/clang-tools-extra/clangd/CMakeLists.txt -+++ b/clang-tools-extra/clangd/CMakeLists.txt -@@ -29,10 +29,7 @@ if(CLANG_BUILT_STANDALONE) - include(CheckAtomic) - endif() - --set(CLANGD_ATOMIC_LIB "") --if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) -- list(APPEND CLANGD_ATOMIC_LIB "atomic") --endif() -+list(APPEND CLANGD_ATOMIC_LIB "atomic") - - add_clang_library(clangDaemon - AST.cpp -- cgit v1.2.3-54-g00ecf From 9c2a68ffbf8db5ebaffdc9ab87f716519958dc09 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 26 Dec 2019 10:56:56 -0800 Subject: drone.yml: Trigger CI on zeus branch push Signed-off-by: Khem Raj --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 7a1c463..23ad190 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,7 +11,7 @@ clone: trigger: branch: - - master + - zeus event: - push - pull_request -- cgit v1.2.3-54-g00ecf