From 36ab7027d63850c53423460b3df6f66ca6ac6e40 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 7 Jun 2017 21:45:36 -0700 Subject: clang/llvm: Update to latest master Signed-off-by: Khem Raj --- recipes-devtools/clang/clang.inc | 14 ++++---- ...001-libcxx-use-constexpr-when-using-glibc.patch | 25 ++++++++------- ...LibraryInfo-Undefine-libc-functions-if-th.patch | 6 ++-- ...lvm-Differentiate-between-glibc-and-linux.patch | 26 --------------- .../0002-llvm-allow-env-override-of-exe-path.patch | 37 ++++++++++++++++++++++ .../0003-llvm-allow-env-override-of-exe-path.patch | 37 ---------------------- recipes-devtools/clang/common.inc | 3 +- 7 files changed, 62 insertions(+), 86 deletions(-) delete mode 100644 recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch create mode 100644 recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch delete mode 100644 recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch diff --git a/recipes-devtools/clang/clang.inc b/recipes-devtools/clang/clang.inc index ea7f89d..0e80bbc 100644 --- a/recipes-devtools/clang/clang.inc +++ b/recipes-devtools/clang/clang.inc @@ -12,14 +12,14 @@ MINOR_VER="0" PATCH_VER="0" PV = "${MAJOR_VER}.${MINOR_VER}.${PATCH_VER}" BRANCH = "master" -SRCREV_llvm = "6680feb0be2a858969f05b906bbdc4ac48160af0" -SRCREV_clang = "40ed16ee38828a60d1eb11122170d8ac8611422c" -SRCREV_compiler-rt = "6b09b9e2f0d280aa933c522066f5c68299f40833" -SRCREV_cxxabi = "4072e8fd76febee37f60aeda76d6d9f5e3791daa" -SRCREV_libcxx = "efae8792d80314d9d884d76187795db7a1f9346b" +SRCREV_llvm = "5db707b0ff5ce707a78082219658a999b6b6eaa3" +SRCREV_clang = "5cfaf047c277163a75b7bab2fd58c812e7a13424" +SRCREV_compiler-rt = "4906f471eeabb1ffd1edb2c6cef5b5a5d790ddd7" +SRCREV_cxxabi = "35b048cf8b3be1a4171f26ca87504bdb10a9f2e9" +SRCREV_libcxx = "1cf5591af9f5f7d8a97ae069bc736c1250a35a33" SRCREV_libunwind = "86219d8c6a73f95e694b4e1594e1a8a0a33613b6" -SRCREV_lld = "1478859ee649213f37529a0cebc6d2fedb04b091" -SRCREV_lldb = "b9fb6e957cf16d34b0f44e21911e44a34468c9d5" +SRCREV_lld = "3372b8f0e7438bb3486abde6aa0c41ac17ba6688" +SRCREV_lldb = "50a43fd42566d6ab17f3c84ec1116a8bfd9c58f4" LLVMMD5SUM = "e825e017edc35cfd58e26116e5251771" CLANGMD5SUM = "a77eac638a3aae44a2d604217d6f0f01" diff --git a/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch b/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch index 43387a3..c295276 100644 --- a/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch +++ b/recipes-devtools/clang/clang/0001-libcxx-use-constexpr-when-using-glibc.patch @@ -1,4 +1,4 @@ -From 7eef5975d0c68e8b34505a334061610efe50df3b Mon Sep 17 00:00:00 2001 +From e57d8fcd1d70c4be85f8f07722d1c1d61fe51d2a Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Thu, 19 May 2016 23:22:52 -0700 Subject: [PATCH] libcxx: use constexpr when using glibc @@ -12,26 +12,26 @@ code is invalid Signed-off-by: Khem Raj --- - include/__mutex_base | 13 ++++++++++++- - 1 file changed, 12 insertions(+), 1 deletion(-) + include/__mutex_base | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) -Index: libcxx/include/__mutex_base -=================================================================== ---- libcxx.orig/include/__mutex_base -+++ libcxx/include/__mutex_base -@@ -44,7 +44,10 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SA +diff --git a/include/__mutex_base b/include/__mutex_base +index 3b2453f1b..08f35434f 100644 +--- a/include/__mutex_base ++++ b/include/__mutex_base +@@ -48,7 +48,10 @@ class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mut public: _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_CXX03_LANG -- constexpr mutex() _NOEXCEPT = default; +- constexpr mutex() = default; +#ifdef __GLIBC__ + constexpr +#endif -+ mutex() _NOEXCEPT = default; ++ mutex() = default; #else mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;} #endif -@@ -289,7 +292,10 @@ class _LIBCPP_TYPE_VIS condition_variabl +@@ -296,7 +299,10 @@ class _LIBCPP_TYPE_VIS condition_variable public: _LIBCPP_INLINE_VISIBILITY #ifndef _LIBCPP_CXX03_LANG @@ -43,3 +43,6 @@ Index: libcxx/include/__mutex_base #else condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;} #endif +-- +2.13.1 + diff --git a/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch b/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch index fff2179..cb047ea 100644 --- a/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch +++ b/recipes-devtools/clang/clang/0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch @@ -1,7 +1,7 @@ -From f5c30ecd374aae4bef7a13084c8254894748e7f5 Mon Sep 17 00:00:00 2001 +From 28293e48cf1a52004c6a78de448718441f9e05f9 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 21 May 2016 00:33:20 +0000 -Subject: [PATCH 1/3] llvm: TargetLibraryInfo: Undefine libc functions if they +Subject: [PATCH 1/2] llvm: TargetLibraryInfo: Undefine libc functions if they are macros musl defines some functions as macros and not inline functions @@ -87,5 +87,5 @@ index 9cbe917c146..aff8419cf54 100644 TLI_DEFINE_STRING_INTERNAL("tmpfile64") /// int toascii(int c); -- -2.13.0 +2.13.1 diff --git a/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch b/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch deleted file mode 100644 index a4cc474..0000000 --- a/recipes-devtools/clang/clang/0002-llvm-Differentiate-between-glibc-and-linux.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c838ab629c64a98e194520f10b391f174fbccc96 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Tue, 9 May 2017 15:16:45 -0700 -Subject: [PATCH 2/3] llvm: Differentiate between glibc and linux - -Signed-off-by: Khem Raj ---- - lib/Support/Unix/DynamicLibrary.inc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/Support/Unix/DynamicLibrary.inc b/lib/Support/Unix/DynamicLibrary.inc -index a0526fa2c1b..aca85c62e54 100644 ---- a/lib/Support/Unix/DynamicLibrary.inc -+++ b/lib/Support/Unix/DynamicLibrary.inc -@@ -104,7 +104,7 @@ static void *DoSearch(const char* SymbolName) { - // On linux we have a weird situation. The stderr/out/in symbols are both - // macros and global variables because of standards requirements. So, we - // boldly use the EXPLICIT_SYMBOL macro without checking for a #define first. --#if defined(__linux__) and !defined(__ANDROID__) -+#if defined(__linux__) and !defined(__ANDROID__) and defined(__GLIBC__) - { - EXPLICIT_SYMBOL(stderr); - EXPLICIT_SYMBOL(stdout); --- -2.13.0 - diff --git a/recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch new file mode 100644 index 0000000..6864bcd --- /dev/null +++ b/recipes-devtools/clang/clang/0002-llvm-allow-env-override-of-exe-path.patch @@ -0,0 +1,37 @@ +From d776487bac17650704614248d19d1e6b35775001 Mon Sep 17 00:00:00 2001 +From: Martin Kelly +Date: Fri, 19 May 2017 00:22:57 -0700 +Subject: [PATCH 2/2] llvm: allow env override of exe path + +When using a native llvm-config from inside a sysroot, we need llvm-config to +return the libraries, include directories, etc. from inside the sysroot rather +than from the native sysroot. Thus provide an env override for calling +llvm-config from a target sysroot. + +Signed-off-by: Martin Kelly +Signed-off-by: Khem Raj +--- + tools/llvm-config/llvm-config.cpp | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 08b096afb05..d8d7742744e 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -225,6 +225,13 @@ Typical components:\n\ + + /// \brief Compute the path to the main executable. + std::string GetExecutablePath(const char *Argv0) { ++ // Hack for Yocto: we need to override the root path when we are using ++ // llvm-config from within a target sysroot. ++ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); ++ if (Sysroot != nullptr) { ++ return Sysroot; ++ } ++ + // This just needs to be some symbol in the binary; C++ doesn't + // allow taking the address of ::main however. + void *P = (void *)(intptr_t)GetExecutablePath; +-- +2.13.1 + diff --git a/recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch b/recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch deleted file mode 100644 index 8e9ac23..0000000 --- a/recipes-devtools/clang/clang/0003-llvm-allow-env-override-of-exe-path.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 31fd46a8b262b67c143b10c72c01d7289468fc8f Mon Sep 17 00:00:00 2001 -From: Martin Kelly -Date: Fri, 19 May 2017 00:22:57 -0700 -Subject: [PATCH 3/3] llvm: allow env override of exe path - -When using a native llvm-config from inside a sysroot, we need llvm-config to -return the libraries, include directories, etc. from inside the sysroot rather -than from the native sysroot. Thus provide an env override for calling -llvm-config from a target sysroot. - -Signed-off-by: Martin Kelly -Signed-off-by: Khem Raj ---- - tools/llvm-config/llvm-config.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp -index 25344e4cd01..26724c1b825 100644 ---- a/tools/llvm-config/llvm-config.cpp -+++ b/tools/llvm-config/llvm-config.cpp -@@ -225,6 +225,13 @@ Typical components:\n\ - - /// \brief Compute the path to the main executable. - std::string GetExecutablePath(const char *Argv0) { -+ // Hack for Yocto: we need to override the root path when we are using -+ // llvm-config from within a target sysroot. -+ const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH"); -+ if (Sysroot != nullptr) { -+ return Sysroot; -+ } -+ - // This just needs to be some symbol in the binary; C++ doesn't - // allow taking the address of ::main however. - void *P = (void *)(intptr_t)GetExecutablePath; --- -2.13.0 - diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index 847c290..0f01131 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc @@ -5,8 +5,7 @@ FILESEXTRAPATHS =. "${FILE_DIRNAME}/clang:" # LLVMPATCHES = "\ file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \ - file://0002-llvm-Differentiate-between-glibc-and-linux.patch \ - file://0003-llvm-allow-env-override-of-exe-path.patch \ + file://0002-llvm-allow-env-override-of-exe-path.patch \ " # Clang patches -- cgit v1.2.3-54-g00ecf