diff options
-rw-r--r-- | conf/nonclangable.conf | 5 | ||||
-rw-r--r-- | recipes-bsp/cpufrequtils/cpufrequtils/cpufrequtils-008-fix-build-on-non-x86.patch | 32 | ||||
-rw-r--r-- | recipes-bsp/cpufrequtils/cpufrequtils_%.bbappend | 2 |
3 files changed, 34 insertions, 5 deletions
diff --git a/conf/nonclangable.conf b/conf/nonclangable.conf index a51213f..a7f32d4 100644 --- a/conf/nonclangable.conf +++ b/conf/nonclangable.conf | |||
@@ -1,9 +1,4 @@ | |||
1 | TOOLCHAIN_pn-u-boot = "gcc" | 1 | TOOLCHAIN_pn-u-boot = "gcc" |
2 | # In file included from utils/aperf.c:56: | ||
3 | # utils/cpuid.h:17:8: error: invalid output constraint '=a' in asm | ||
4 | # : "=a" (*eax), | ||
5 | # (seen on aarch64 with clang 12.0, cpufrequtils 008) | ||
6 | TOOLCHAIN_pn-cpufrequtils = "gcc" | ||
7 | # crash embeds version of gdb which is not buildable with clang | 2 | # crash embeds version of gdb which is not buildable with clang |
8 | TOOLCHAIN_pn-crash = "gcc" | 3 | TOOLCHAIN_pn-crash = "gcc" |
9 | TOOLCHAIN_pn-elfutils = "gcc" | 4 | TOOLCHAIN_pn-elfutils = "gcc" |
diff --git a/recipes-bsp/cpufrequtils/cpufrequtils/cpufrequtils-008-fix-build-on-non-x86.patch b/recipes-bsp/cpufrequtils/cpufrequtils/cpufrequtils-008-fix-build-on-non-x86.patch new file mode 100644 index 0000000..0006add --- /dev/null +++ b/recipes-bsp/cpufrequtils/cpufrequtils/cpufrequtils-008-fix-build-on-non-x86.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From: Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com> | ||
2 | Date: Thu, 27 May 2021 22:51:00 +0200 | ||
3 | Subject: [PATCH] utils: Fix build on non-x86 with clang | ||
4 | |||
5 | Without this patch, there is an invalid asm construct (forcing EAX) on | ||
6 | non-x86 architectures in unreachable code. | ||
7 | |||
8 | gcc allows this (because it throws out the unreachable code before checking | ||
9 | it), but clang does not. | ||
10 | |||
11 | Signed-off-by: Bernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com> | ||
12 | Upstream-Status: Pending | ||
13 | |||
14 | diff -up git/utils/cpuid.h.omv~ git/utils/cpuid.h | ||
15 | --- git/utils/cpuid.h.omv~ 2021-05-27 22:44:44.833614642 +0200 | ||
16 | +++ git/utils/cpuid.h 2021-05-27 22:45:25.546050445 +0200 | ||
17 | @@ -1,6 +1,8 @@ | ||
18 | #ifndef _CPUFREQ_CPUID_H | ||
19 | #define _CPUFREQ_CPUID_H | ||
20 | |||
21 | +#if defined(__i386__) || defined(__x86_64__) | ||
22 | + | ||
23 | static inline void __cpuid(unsigned int *eax, unsigned int *ebx, | ||
24 | unsigned int *ecx, unsigned int *edx) | ||
25 | { | ||
26 | @@ -72,4 +74,6 @@ static inline unsigned int cpuid_edx(uns | ||
27 | return edx; | ||
28 | } | ||
29 | |||
30 | +#endif /* i386 || x86_64 */ | ||
31 | + | ||
32 | #endif /* _CPUFREQ_CPUID_H */ | ||
diff --git a/recipes-bsp/cpufrequtils/cpufrequtils_%.bbappend b/recipes-bsp/cpufrequtils/cpufrequtils_%.bbappend new file mode 100644 index 0000000..3b201f1 --- /dev/null +++ b/recipes-bsp/cpufrequtils/cpufrequtils_%.bbappend | |||
@@ -0,0 +1,2 @@ | |||
1 | FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" | ||
2 | SRC_URI_append = " file://cpufrequtils-008-fix-build-on-non-x86.patch" | ||