diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-03-15 12:16:47 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2016-03-15 19:44:53 +0000 |
commit | 4e430cc7b14c2e52071c03b796b1b7a017b4790f (patch) | |
tree | ee14c3c4162d248ec505bdc52d94e40f827f87b6 | |
parent | 6b15e67b863e024b1eb20b93f48fd66aec538056 (diff) | |
download | meta-clang-4e430cc7b14c2e52071c03b796b1b7a017b4790f.tar.gz |
libcxx,libcxxabi: Use cmake knobs for musl
libcxx already has support for musl, enable that
instead of patching code
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/files/0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch | 39 | ||||
-rw-r--r-- | recipes-devtools/clang/files/0001-replace-strtoll_l-with-strtoll-on-musl.patch | 55 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch (renamed from recipes-devtools/clang/files/0001-use-constexpr-when-using-glibc.patch) | 0 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxx_git.bb | 8 | ||||
-rw-r--r-- | recipes-devtools/clang/libcxxabi_git.bb | 3 |
5 files changed, 4 insertions, 101 deletions
diff --git a/recipes-devtools/clang/files/0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch b/recipes-devtools/clang/files/0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch deleted file mode 100644 index dc06ddd..0000000 --- a/recipes-devtools/clang/files/0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | From f85abde580d2ba399bfc7538a28f7b6f96912bc6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 15 Mar 2016 03:10:42 +0000 | ||
4 | Subject: [PATCH] Use __GLIBC__ to differentiate glibc-like libc on linux | ||
5 | |||
6 | glibc/uclibc define __GLIBC_PREREQ but musl does not therefore we need | ||
7 | to check if its on glibc system before using it | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | include/__config | 6 +++--- | ||
12 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
13 | |||
14 | diff --git a/include/__config b/include/__config | ||
15 | index db5a832..0859b5f 100644 | ||
16 | --- a/include/__config | ||
17 | +++ b/include/__config | ||
18 | @@ -392,15 +392,15 @@ typedef __char32_t char32_t; | ||
19 | #elif defined(__ANDROID__) | ||
20 | #define _LIBCPP_HAS_QUICK_EXIT | ||
21 | #elif defined(__linux__) | ||
22 | -#if !defined(_LIBCPP_HAS_MUSL_LIBC) | ||
23 | +#if defined(__GLIBC__) | ||
24 | # include <features.h> | ||
25 | -#if __GLIBC_PREREQ(2, 15) | ||
26 | +#if __GLIBC_PREREQ(2, 15) | ||
27 | #define _LIBCPP_HAS_QUICK_EXIT | ||
28 | #endif | ||
29 | #if __GLIBC_PREREQ(2, 17) | ||
30 | #define _LIBCPP_HAS_C11_FEATURES | ||
31 | #endif | ||
32 | -#else // defined(_LIBCPP_HAS_MUSL_LIBC) | ||
33 | +#else // defined(__GLIBC__) | ||
34 | #define _LIBCPP_HAS_QUICK_EXIT | ||
35 | #define _LIBCPP_HAS_C11_FEATURES | ||
36 | #endif | ||
37 | -- | ||
38 | 1.9.1 | ||
39 | |||
diff --git a/recipes-devtools/clang/files/0001-replace-strtoll_l-with-strtoll-on-musl.patch b/recipes-devtools/clang/files/0001-replace-strtoll_l-with-strtoll-on-musl.patch deleted file mode 100644 index 6e8404d..0000000 --- a/recipes-devtools/clang/files/0001-replace-strtoll_l-with-strtoll-on-musl.patch +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | From 103e1e99622318a6183c4576d372cc8126c6778d Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 15 Mar 2016 04:20:10 +0000 | ||
4 | Subject: [PATCH] replace strtoll_l with strtoll on musl | ||
5 | |||
6 | Fixes errors like | ||
7 | libcxx/include/locale:874:26: error: use of undeclared identifier 'strtoll_l' | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | include/locale | 7 +++---- | ||
12 | 1 file changed, 3 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/include/locale b/include/locale | ||
15 | index 84cb5a5..9072722 100644 | ||
16 | --- a/include/locale | ||
17 | +++ b/include/locale | ||
18 | @@ -10,7 +10,6 @@ | ||
19 | |||
20 | #ifndef _LIBCPP_LOCALE | ||
21 | #define _LIBCPP_LOCALE | ||
22 | - | ||
23 | /* | ||
24 | locale synopsis | ||
25 | |||
26 | @@ -871,7 +870,7 @@ __num_get_signed_integral(const char* __a, const char* __a_end, | ||
27 | typename remove_reference<decltype(errno)>::type __save_errno = errno; | ||
28 | errno = 0; | ||
29 | char *__p2; | ||
30 | - long long __ll = strtoll_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); | ||
31 | + long long __ll = strtoll(__a, &__p2, __base); | ||
32 | typename remove_reference<decltype(errno)>::type __current_errno = errno; | ||
33 | if (__current_errno == 0) | ||
34 | errno = __save_errno; | ||
35 | @@ -911,7 +910,7 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end, | ||
36 | typename remove_reference<decltype(errno)>::type __save_errno = errno; | ||
37 | errno = 0; | ||
38 | char *__p2; | ||
39 | - unsigned long long __ll = strtoull_l(__a, &__p2, __base, _LIBCPP_GET_C_LOCALE); | ||
40 | + unsigned long long __ll = strtoull(__a, &__p2, __base); | ||
41 | typename remove_reference<decltype(errno)>::type __current_errno = errno; | ||
42 | if (__current_errno == 0) | ||
43 | errno = __save_errno; | ||
44 | @@ -941,7 +940,7 @@ __num_get_float(const char* __a, const char* __a_end, ios_base::iostate& __err) | ||
45 | typename remove_reference<decltype(errno)>::type __save_errno = errno; | ||
46 | errno = 0; | ||
47 | char *__p2; | ||
48 | - long double __ld = strtold_l(__a, &__p2, _LIBCPP_GET_C_LOCALE); | ||
49 | + long double __ld = strtold(__a, &__p2); | ||
50 | typename remove_reference<decltype(errno)>::type __current_errno = errno; | ||
51 | if (__current_errno == 0) | ||
52 | errno = __save_errno; | ||
53 | -- | ||
54 | 1.9.1 | ||
55 | |||
diff --git a/recipes-devtools/clang/files/0001-use-constexpr-when-using-glibc.patch b/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch index f66de8f..f66de8f 100644 --- a/recipes-devtools/clang/files/0001-use-constexpr-when-using-glibc.patch +++ b/recipes-devtools/clang/libcxx/0001-use-constexpr-when-using-glibc.patch | |||
diff --git a/recipes-devtools/clang/libcxx_git.bb b/recipes-devtools/clang/libcxx_git.bb index ba6ecc2..b00cb53 100644 --- a/recipes-devtools/clang/libcxx_git.bb +++ b/recipes-devtools/clang/libcxx_git.bb | |||
@@ -23,10 +23,7 @@ SRC_URI = "\ | |||
23 | ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \ | 23 | ${LLVM_GIT}/libcxx.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxx;destsuffix=git/projects/libcxx \ |
24 | ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxxabi;destsuffix=git/projects/libcxxabi \ | 24 | ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxxabi;destsuffix=git/projects/libcxxabi \ |
25 | " | 25 | " |
26 | SRC_URI += "file://0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch \ | 26 | SRC_URI_append_libc-musl = " file://0001-use-constexpr-when-using-glibc.patch " |
27 | file://0001-use-constexpr-when-using-glibc.patch \ | ||
28 | " | ||
29 | SRC_URI_append_libc-musl = " file://0001-replace-strtoll_l-with-strtoll-on-musl.patch " | ||
30 | 27 | ||
31 | SRCREV_FORMAT = "llvm_libcxx_libcxxabi" | 28 | SRCREV_FORMAT = "llvm_libcxx_libcxxabi" |
32 | 29 | ||
@@ -36,10 +33,11 @@ THUMB_TUNE_CCARGS = "" | |||
36 | TUNE_CCARGS += "-ffreestanding -nostdlib" | 33 | TUNE_CCARGS += "-ffreestanding -nostdlib" |
37 | 34 | ||
38 | EXTRA_OECMAKE += "-DLIBCXX_CXX_ABI=libcxxabi \ | 35 | EXTRA_OECMAKE += "-DLIBCXX_CXX_ABI=libcxxabi \ |
39 | -DLIBCXXABI_LIBCXX_PATH=${S}/../libcxx \ | ||
40 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/../libcxxabi/include \ | 36 | -DLIBCXX_CXX_ABI_INCLUDE_PATHS=${S}/../libcxxabi/include \ |
41 | -DLLVM_PATH=${S}/../../ \ | 37 | -DLLVM_PATH=${S}/../../ \ |
42 | -DLIBCXX_ENABLE_SHARED=False \ | 38 | -DLIBCXX_ENABLE_SHARED=False \ |
43 | " | 39 | " |
44 | 40 | ||
41 | EXTRA_OECMAKE_append_libc-musl = " -DLIBCXX_HAS_MUSL_LIBC=True " | ||
42 | |||
45 | BBCLASSEXTEND = "native nativesdk" | 43 | BBCLASSEXTEND = "native nativesdk" |
diff --git a/recipes-devtools/clang/libcxxabi_git.bb b/recipes-devtools/clang/libcxxabi_git.bb index 2cb2408..5f8243e 100644 --- a/recipes-devtools/clang/libcxxabi_git.bb +++ b/recipes-devtools/clang/libcxxabi_git.bb | |||
@@ -23,8 +23,6 @@ SRC_URI = "\ | |||
23 | ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxxabi;destsuffix=git/projects/libcxxabi \ | 23 | ${LLVM_GIT}/libcxxabi.git;protocol=${LLVM_GIT_PROTOCOL};branch=${BRANCH};name=libcxxabi;destsuffix=git/projects/libcxxabi \ |
24 | " | 24 | " |
25 | 25 | ||
26 | SRC_URI += "file://0001-Use-__GLIBC__-to-differentiate-glibc-like-libc-on-li.patch;patchdir=../libcxx" | ||
27 | |||
28 | SRCREV_FORMAT = "llvm_libcxx_libcxxabi" | 26 | SRCREV_FORMAT = "llvm_libcxx_libcxxabi" |
29 | 27 | ||
30 | S = "${WORKDIR}/git/projects/libcxxabi" | 28 | S = "${WORKDIR}/git/projects/libcxxabi" |
@@ -39,5 +37,6 @@ EXTRA_OECMAKE += "-DLIBCXXABI_LIBCXX_PATH=${S}/../libcxx \ | |||
39 | -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \ | 37 | -DLLVM_BUILD_EXTERNAL_COMPILER_RT=True \ |
40 | -DLIBCXXABI_ENABLE_SHARED=False \ | 38 | -DLIBCXXABI_ENABLE_SHARED=False \ |
41 | " | 39 | " |
40 | CXXFLAGS_append_libc-musl = " -D_LIBCPP_HAS_MUSL_LIBC " | ||
42 | 41 | ||
43 | BBCLASSEXTEND = "native nativesdk" | 42 | BBCLASSEXTEND = "native nativesdk" |