Patch "powerpc: Fix build failure with clang due to BUILD_BUG_ON()" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
powerpc: Fix build failure with clang due to BUILD_BUG_ON()
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-fix-build-failure-with-clang-due-to-build_bug_on.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
b5fa0f7f88edcde37df1807fdf9ff10ec787a60eMon Sep 17 00:00:00 2001
From: Michael Ellerman <[email protected]>
Date: Tue, 24 Jan 2017 16:36:57 +1100
Subject: powerpc: Fix build failure with clang due to BUILD_BUG_ON()
From: Michael Ellerman <[email protected]>
commit b5fa0f7f88edcde37df1807fdf9ff10ec787a60e upstream.
Anton says: In commit 4db7327194db ("powerpc: Add option to use jump label for cpu_has_feature()") and commit c12e6f24d413 ("powerpc: Add option to use jump label for mmu_has_feature()") we added:
BUILD_BUG_ON(!__builtin_constant_p(feature))
to cpu_has_feature() and mmu_has_feature() in order to catch usage issues (such as cpu_has_feature(cpu_has_feature(X), which has happened once in the past). Unfortunately LLVM isn't smart enough to resolve this, and it errors out.
I work around it in my clang/LLVM builds of the kernel, but I have just discovered that it causes a lot of issues for the bcc (eBPF) trace tool (which uses LLVM).
For now just #ifdef it away for clang builds.
--- arch/powerpc/include/asm/cpu_has_feature.h | 2 ++ arch/powerpc/include/asm/mmu.h | 2 ++ 2 files changed, 4 insertions(+)
arch/powerpc/include/asm/cpu_has_feature.h +2 -0
@@ -23,7 +23,9 @@ static __always_inline bool cpu_has_feat {int i; +#ifndef __clang__/* clang can't cope with this */ BUILD_BUG_ON (!__builtin_constant_p (feature)); +#endif #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG if (!static_key_initialized) {
arch/powerpc/include/asm/mmu.h +2 -0
@@ -160,7 +160,9 @@ static __always_inline bool mmu_has_feat {int i; +#ifndef __clang__/* clang can't cope with this */ BUILD_BUG_ON (!__builtin_constant_p (feature)); +#endif #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG if (!static_key_initialized) {
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/powerpc-fix-build-failure-with-clang-due-to-build_bug_on.patch queue-4.9/powerpc-mm-use-the-correct-pointer-when-setting-a-2mb-pte.patch queue-4.9/powerpc-eeh-fix-wrong-flag-passed-to-eeh_unfreeze_pe.patch queue-4.9/powerpc-add-missing-error-check-to-prom_find_boot_cpu.patch