diff options
author | Wang Mingyu <wangmy@cn.fujitsu.com> | 2021-02-27 12:48:13 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-01 11:12:16 +0000 |
commit | 954a89df7049e214bc864b4636ef82b2f114a2fc (patch) | |
tree | 2943c97503b45e146f4bb4e84676a7aff396a1f0 | |
parent | fc222345f071b845f65a4ce382fe64d681c48df5 (diff) | |
download | poky-954a89df7049e214bc864b4636ef82b2f114a2fc.tar.gz |
ccache: upgrade 4.1 -> 4.2
0001-Improve-SIMD-detection-735.patch
0001-blake3-Remove-asm-checks-for-sse-avx.patch
0002-Always-use-64bit-to-print-time_t.patch
removed since they'are included in 4.2
-License-Update: Copyright year updated to 2021.
(From OE-Core rev: 45a0b1f7dc48955d9e9a476bd26239ef360fd0fc)
Signed-off-by: Wang Mingyu <wangmy@cn.fujitsu.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-devtools/ccache/ccache/0001-Improve-SIMD-detection-735.patch | 121 | ||||
-rw-r--r-- | meta/recipes-devtools/ccache/ccache/0001-blake3-Remove-asm-checks-for-sse-avx.patch | 35 | ||||
-rw-r--r-- | meta/recipes-devtools/ccache/ccache/0002-Always-use-64bit-to-print-time_t.patch | 33 | ||||
-rw-r--r-- | meta/recipes-devtools/ccache/ccache_4.2.bb (renamed from meta/recipes-devtools/ccache/ccache_4.1.bb) | 10 |
4 files changed, 3 insertions, 196 deletions
diff --git a/meta/recipes-devtools/ccache/ccache/0001-Improve-SIMD-detection-735.patch b/meta/recipes-devtools/ccache/ccache/0001-Improve-SIMD-detection-735.patch deleted file mode 100644 index 12d4ebc4bc..0000000000 --- a/meta/recipes-devtools/ccache/ccache/0001-Improve-SIMD-detection-735.patch +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | From 05d290165a3b61da09b715e6c8e62cebebab57cc Mon Sep 17 00:00:00 2001 | ||
2 | From: Erik Flodin <erik@ejohansson.se> | ||
3 | Date: Mon, 7 Dec 2020 19:20:31 +0100 | ||
4 | Subject: [PATCH 1/2] Improve SIMD detection (#735) | ||
5 | |||
6 | * Try to compile code to detect SSE/AVX support. Just checking if the compiler | ||
7 | supports the flag isn't enough as e.g. Clang on Apple's new ARM silicon seems | ||
8 | to accept the flag but then fails when building. | ||
9 | * Try to detect and enable BLAKE3's Neon support. | ||
10 | * Improve detection of AVX2 target attribute support and remove the explicit | ||
11 | compiler version check that hopefully shouldn't be needed. | ||
12 | |||
13 | Fixes #734. | ||
14 | Upstream-Status: Backport [https://github.com/ccache/ccache/commit/b438f50388dd00285083260f60450e6237b7d58f] | ||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | cmake/GenerateConfigurationFile.cmake | 25 +++++++++--------- | ||
18 | src/third_party/blake3/CMakeLists.txt | 38 ++++++++++++++++++++------- | ||
19 | 2 files changed, 42 insertions(+), 21 deletions(-) | ||
20 | |||
21 | diff --git a/cmake/GenerateConfigurationFile.cmake b/cmake/GenerateConfigurationFile.cmake | ||
22 | index a21861f4..836ff9bb 100644 | ||
23 | --- a/cmake/GenerateConfigurationFile.cmake | ||
24 | +++ b/cmake/GenerateConfigurationFile.cmake | ||
25 | @@ -67,18 +67,19 @@ check_struct_has_member("struct stat" st_mtim sys/stat.h | ||
26 | check_struct_has_member("struct statfs" f_fstypename sys/mount.h | ||
27 | HAVE_STRUCT_STATFS_F_FSTYPENAME) | ||
28 | |||
29 | -include(CheckCXXCompilerFlag) | ||
30 | - | ||
31 | -# Old GCC versions don't have the required header support. | ||
32 | -# Old Apple Clang versions seem to support -mavx2 but not the target | ||
33 | -# attribute that's used to enable AVX2 for a certain function. | ||
34 | -if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) | ||
35 | - OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)) | ||
36 | - message(STATUS "Detected unsupported compiler for HAVE_AVX2 - disabled") | ||
37 | - set(HAVE_AVX2 FALSE) | ||
38 | -else() | ||
39 | - check_cxx_compiler_flag(-mavx2 HAVE_AVX2) | ||
40 | -endif() | ||
41 | +include(CheckCXXSourceCompiles) | ||
42 | +check_cxx_source_compiles( | ||
43 | + [=[ | ||
44 | + #include <immintrin.h> | ||
45 | + void func() __attribute__((target("avx2"))); | ||
46 | + void func() { _mm256_abs_epi8(_mm256_set1_epi32(42)); } | ||
47 | + int main() | ||
48 | + { | ||
49 | + func(); | ||
50 | + return 0; | ||
51 | + } | ||
52 | + ]=] | ||
53 | + HAVE_AVX2) | ||
54 | |||
55 | list(APPEND CMAKE_REQUIRED_LIBRARIES ws2_32) | ||
56 | list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES ws2_32) | ||
57 | diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt | ||
58 | index a75e5611..cc24253c 100644 | ||
59 | --- a/src/third_party/blake3/CMakeLists.txt | ||
60 | +++ b/src/third_party/blake3/CMakeLists.txt | ||
61 | @@ -13,9 +13,9 @@ else() | ||
62 | endif() | ||
63 | |||
64 | include(CheckAsmCompilerFlag) | ||
65 | -include(CheckCCompilerFlag) | ||
66 | +include(CheckCSourceCompiles) | ||
67 | |||
68 | -function(add_source_if_enabled feature compile_flags) | ||
69 | +function(add_source_if_enabled feature compile_flags intrinsic) | ||
70 | string(TOUPPER "have_${blake_source_type}_${feature}" have_feature) | ||
71 | |||
72 | # AVX512 support fails to compile with old Apple Clang versions even though | ||
73 | @@ -28,7 +28,14 @@ function(add_source_if_enabled feature compile_flags) | ||
74 | elseif(${blake_source_type} STREQUAL "asm") | ||
75 | check_asm_compiler_flag(${compile_flags} ${have_feature}) | ||
76 | else() | ||
77 | - check_c_compiler_flag(${compile_flags} ${have_feature}) | ||
78 | + set(CMAKE_REQUIRED_FLAGS ${compile_flags}) | ||
79 | + check_c_source_compiles( | ||
80 | + [=[ | ||
81 | + #include <immintrin.h> | ||
82 | + int main() { ${intrinsic}; return 0; } | ||
83 | + ]=] | ||
84 | + ${have_feature}) | ||
85 | + unset(CMAKE_REQUIRED_FLAGS) | ||
86 | endif() | ||
87 | |||
88 | if(${have_feature}) | ||
89 | @@ -42,10 +49,23 @@ function(add_source_if_enabled feature compile_flags) | ||
90 | endif() | ||
91 | endfunction() | ||
92 | |||
93 | -add_source_if_enabled(sse2 "-msse2") | ||
94 | -add_source_if_enabled(sse41 "-msse4.1") | ||
95 | -add_source_if_enabled(avx2 "-mavx2") | ||
96 | -add_source_if_enabled(avx512 "-mavx512f -mavx512vl") | ||
97 | +# https://software.intel.com/sites/landingpage/IntrinsicsGuide/ | ||
98 | +add_source_if_enabled(sse2 "-msse2" "_mm_set1_epi32(42)") | ||
99 | +add_source_if_enabled(sse41 "-msse4.1" "_mm_test_all_ones(_mm_set1_epi32(42))") | ||
100 | +add_source_if_enabled(avx2 "-mavx2" "_mm256_abs_epi8(_mm256_set1_epi32(42))") | ||
101 | +add_source_if_enabled(avx512 "-mavx512f -mavx512vl" "_mm256_abs_epi64(_mm256_set1_epi32(42))") | ||
102 | |||
103 | -# TODO: how to detect ARM NEON support? | ||
104 | -# If NEON, define BLAKE3_USE_NEON and build blake3_neon.c | ||
105 | +# Neon is always available on AArch64 | ||
106 | +if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
107 | + # https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics | ||
108 | + check_c_source_compiles( | ||
109 | + [=[ | ||
110 | + #include <arm_neon.h> | ||
111 | + int main() { vdupq_n_s32(42); return 0; } | ||
112 | + ]=] | ||
113 | + HAVE_NEON) | ||
114 | + if(HAVE_NEON) | ||
115 | + target_sources(blake3 PRIVATE blake3_neon.c) | ||
116 | + target_compile_definitions(blake3 PRIVATE BLAKE3_USE_NEON) | ||
117 | + endif() | ||
118 | +endif() | ||
119 | -- | ||
120 | 2.30.0 | ||
121 | |||
diff --git a/meta/recipes-devtools/ccache/ccache/0001-blake3-Remove-asm-checks-for-sse-avx.patch b/meta/recipes-devtools/ccache/ccache/0001-blake3-Remove-asm-checks-for-sse-avx.patch deleted file mode 100644 index bdabb381aa..0000000000 --- a/meta/recipes-devtools/ccache/ccache/0001-blake3-Remove-asm-checks-for-sse-avx.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From 0448eddcf2863ebf911e7dd445bca1c7eee2a239 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 5 Jan 2021 13:55:34 -0800 | ||
4 | Subject: [PATCH] blake3: Remove asm checks for sse/avx | ||
5 | |||
6 | This ends up passing on clang/linux wrongly when building for aarch64 | ||
7 | the check in else part is good to detect the feature support and this | ||
8 | check can be removed, it was setting | ||
9 | |||
10 | HAVE_ASM_AVX* and HAVE_ASM_SSE* macros which are not used in the build | ||
11 | anyway | ||
12 | |||
13 | Upstream-Status: Submitted [https://github.com/ccache/ccache/pull/768] | ||
14 | |||
15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
16 | --- | ||
17 | src/third_party/blake3/CMakeLists.txt | 2 -- | ||
18 | 1 file changed, 2 deletions(-) | ||
19 | |||
20 | diff --git a/src/third_party/blake3/CMakeLists.txt b/src/third_party/blake3/CMakeLists.txt | ||
21 | index cc24253c..856b5721 100644 | ||
22 | --- a/src/third_party/blake3/CMakeLists.txt | ||
23 | +++ b/src/third_party/blake3/CMakeLists.txt | ||
24 | @@ -25,8 +25,6 @@ function(add_source_if_enabled feature compile_flags intrinsic) | ||
25 | AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0) | ||
26 | message(STATUS "Detected unsupported compiler for ${have_feature} - disabled") | ||
27 | set(${have_feature} FALSE) | ||
28 | - elseif(${blake_source_type} STREQUAL "asm") | ||
29 | - check_asm_compiler_flag(${compile_flags} ${have_feature}) | ||
30 | else() | ||
31 | set(CMAKE_REQUIRED_FLAGS ${compile_flags}) | ||
32 | check_c_source_compiles( | ||
33 | -- | ||
34 | 2.30.0 | ||
35 | |||
diff --git a/meta/recipes-devtools/ccache/ccache/0002-Always-use-64bit-to-print-time_t.patch b/meta/recipes-devtools/ccache/ccache/0002-Always-use-64bit-to-print-time_t.patch deleted file mode 100644 index 85ce2b762d..0000000000 --- a/meta/recipes-devtools/ccache/ccache/0002-Always-use-64bit-to-print-time_t.patch +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | From fa360ca8a457dafcae1d22df2b342d3ee291e8af Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 31 Dec 2020 14:28:39 -0800 | ||
4 | Subject: [PATCH 2/2] Always use 64bit to print time_t | ||
5 | |||
6 | some 32bit architectures e.g. RISCV32 use 64bit time_t from beginning | ||
7 | which does not fit into long int size on LP32 systems | ||
8 | |||
9 | Upstream-Status: Submitted [https://github.com/ccache/ccache/pull/762] | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | src/Logging.cpp | 5 ++++- | ||
13 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/src/Logging.cpp b/src/Logging.cpp | ||
16 | index 9a5d99b7..1a6e6264 100644 | ||
17 | --- a/src/Logging.cpp | ||
18 | +++ b/src/Logging.cpp | ||
19 | @@ -88,7 +88,10 @@ do_log(string_view message, bool bulk) | ||
20 | if (tm) { | ||
21 | strftime(timestamp, sizeof(timestamp), "%Y-%m-%dT%H:%M:%S", &*tm); | ||
22 | } else { | ||
23 | - snprintf(timestamp, sizeof(timestamp), "%lu", tv.tv_sec); | ||
24 | + snprintf(timestamp, | ||
25 | + sizeof(timestamp), | ||
26 | + "%llu", | ||
27 | + (long long unsigned int)tv.tv_sec); | ||
28 | } | ||
29 | snprintf(prefix, | ||
30 | sizeof(prefix), | ||
31 | -- | ||
32 | 2.30.0 | ||
33 | |||
diff --git a/meta/recipes-devtools/ccache/ccache_4.1.bb b/meta/recipes-devtools/ccache/ccache_4.2.bb index 6bd46b1017..9957bc7e65 100644 --- a/meta/recipes-devtools/ccache/ccache_4.1.bb +++ b/meta/recipes-devtools/ccache/ccache_4.2.bb | |||
@@ -7,16 +7,12 @@ HOMEPAGE = "http://ccache.samba.org" | |||
7 | SECTION = "devel" | 7 | SECTION = "devel" |
8 | 8 | ||
9 | LICENSE = "GPLv3+" | 9 | LICENSE = "GPLv3+" |
10 | LIC_FILES_CHKSUM = "file://LICENSE.adoc;md5=a66c581f855c1c408730fe5d171e3013" | 10 | LIC_FILES_CHKSUM = "file://LICENSE.adoc;md5=28afb89f649f309e7ac1aab554564637" |
11 | 11 | ||
12 | DEPENDS = "zstd" | 12 | DEPENDS = "zstd" |
13 | 13 | ||
14 | SRC_URI = "https://github.com/ccache/ccache/releases/download/v${PV}/${BP}.tar.gz \ | 14 | SRC_URI = "https://github.com/ccache/ccache/releases/download/v${PV}/${BP}.tar.gz" |
15 | file://0001-Improve-SIMD-detection-735.patch \ | 15 | SRC_URI[sha256sum] = "dbf139ff32031b54cb47f2d7983269f328df14b5a427882f89f7721e5c411b7e" |
16 | file://0002-Always-use-64bit-to-print-time_t.patch \ | ||
17 | file://0001-blake3-Remove-asm-checks-for-sse-avx.patch \ | ||
18 | " | ||
19 | SRC_URI[sha256sum] = "cdeefb827b3eef3b42b5454858123881a4a90abbd46cc72cf8c20b3bd039deb7" | ||
20 | 16 | ||
21 | UPSTREAM_CHECK_URI = "https://github.com/ccache/ccache/releases/" | 17 | UPSTREAM_CHECK_URI = "https://github.com/ccache/ccache/releases/" |
22 | 18 | ||