public inbox for patches@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] powerpc/vdso: Drop -DCC_USING_PATCHABLE_FUNCTION_ENTRY from 32-bit flags with clang
@ 2026-03-12  0:39 Nathan Chancellor
  2026-04-16 23:37 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2026-03-12  0:39 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Hari Bathini
  Cc: linuxppc-dev, llvm, patches, Nathan Chancellor

After commit 73cdf24e81e4 ("powerpc64: make clang cross-build
friendly"), building 64-bit little endian + CONFIG_COMPAT=y with clang
results in many warnings along the lines of:

  $ cat arch/powerpc/configs/compat.config
  CONFIG_COMPAT=y

  $ make -skj"$(nproc)" ARCH=powerpc LLVM=1 ppc64le_defconfig compat.config arch/powerpc/kernel/vdso/
  ...
  In file included from <built-in>:4:
  In file included from lib/vdso/gettimeofday.c:6:
  In file included from include/vdso/datapage.h:15:
  In file included from include/vdso/cache.h:5:
  arch/powerpc/include/asm/cache.h:77:8: warning: unknown attribute 'patchable_function_entry' ignored [-Wunknown-attributes]
     77 | static inline u32 l1_icache_bytes(void)
        |        ^~~~~~
  include/linux/compiler_types.h:235:58: note: expanded from macro 'inline'
    235 | #define inline inline __gnu_inline __inline_maybe_unused notrace
        |                                                          ^~~~~~~
  include/linux/compiler_types.h:215:34: note: expanded from macro 'notrace'
    215 | #define notrace                 __attribute__((patchable_function_entry(0, 0)))
        |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ...

arch/powerpc/Makefile adds -DCC_USING_PATCHABLE_FUNCTION_ENTRY to
KBUILD_CPPFLAGS, which is inherited by the 32-bit vDSO. However, the
32-bit little endian target does not support
'-fpatchable-function-entry', resulting in the warnings above.

Remove -DCC_USING_PATCHABLE_FUNCTION_ENTRY from the 32-bit vDSO flags
when building with clang to avoid the warnings.

Fixes: 73cdf24e81e4 ("powerpc64: make clang cross-build friendly")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 arch/powerpc/kernel/vdso/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile
index 8834dfe9d727..368759f81708 100644
--- a/arch/powerpc/kernel/vdso/Makefile
+++ b/arch/powerpc/kernel/vdso/Makefile
@@ -62,6 +62,12 @@ CC32FLAGSREMOVE += -fno-stack-clash-protection
 # 32-bit one. clang validates the values passed to these arguments during
 # parsing, even when -fno-stack-protector is passed afterwards.
 CC32FLAGSREMOVE += -mstack-protector-guard%
+# ftrace is disabled for the vdso but arch/powerpc/Makefile adds this define to
+# KBUILD_CPPFLAGS, which enables use of the 'patchable_function_entry'
+# attribute in the 'inline' define via 'notrace'. This attribute is not
+# supported for the powerpcle target, resulting in many instances of
+# -Wunknown-attributes.
+CC32FLAGSREMOVE += -DCC_USING_PATCHABLE_FUNCTION_ENTRY
 endif
 LD32FLAGS := -Wl,-soname=linux-vdso32.so.1
 AS32FLAGS := -D__VDSO32__

---
base-commit: 35e4f2a17eb40288f9bcdb09549fa04a63a96279
change-id: 20260311-ppc-vdso-drop-cc-using-pfe-define-clang-46d6f5041544

Best regards,
--  
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/vdso: Drop -DCC_USING_PATCHABLE_FUNCTION_ENTRY from 32-bit flags with clang
  2026-03-12  0:39 [PATCH] powerpc/vdso: Drop -DCC_USING_PATCHABLE_FUNCTION_ENTRY from 32-bit flags with clang Nathan Chancellor
@ 2026-04-16 23:37 ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2026-04-16 23:37 UTC (permalink / raw)
  To: Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Hari Bathini
  Cc: linuxppc-dev, llvm, patches

Ping? This patch is pretty simple and fixes many build warnings since
inline is used many times in this file. I can take this via my
clang-fixes tree with an appropriate ack if that would be easier.

On Wed, Mar 11, 2026 at 05:39:56PM -0700, Nathan Chancellor wrote:
> After commit 73cdf24e81e4 ("powerpc64: make clang cross-build
> friendly"), building 64-bit little endian + CONFIG_COMPAT=y with clang
> results in many warnings along the lines of:
> 
>   $ cat arch/powerpc/configs/compat.config
>   CONFIG_COMPAT=y
> 
>   $ make -skj"$(nproc)" ARCH=powerpc LLVM=1 ppc64le_defconfig compat.config arch/powerpc/kernel/vdso/
>   ...
>   In file included from <built-in>:4:
>   In file included from lib/vdso/gettimeofday.c:6:
>   In file included from include/vdso/datapage.h:15:
>   In file included from include/vdso/cache.h:5:
>   arch/powerpc/include/asm/cache.h:77:8: warning: unknown attribute 'patchable_function_entry' ignored [-Wunknown-attributes]
>      77 | static inline u32 l1_icache_bytes(void)
>         |        ^~~~~~
>   include/linux/compiler_types.h:235:58: note: expanded from macro 'inline'
>     235 | #define inline inline __gnu_inline __inline_maybe_unused notrace
>         |                                                          ^~~~~~~
>   include/linux/compiler_types.h:215:34: note: expanded from macro 'notrace'
>     215 | #define notrace                 __attribute__((patchable_function_entry(0, 0)))
>         |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   ...
> 
> arch/powerpc/Makefile adds -DCC_USING_PATCHABLE_FUNCTION_ENTRY to
> KBUILD_CPPFLAGS, which is inherited by the 32-bit vDSO. However, the
> 32-bit little endian target does not support
> '-fpatchable-function-entry', resulting in the warnings above.
> 
> Remove -DCC_USING_PATCHABLE_FUNCTION_ENTRY from the 32-bit vDSO flags
> when building with clang to avoid the warnings.
> 
> Fixes: 73cdf24e81e4 ("powerpc64: make clang cross-build friendly")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  arch/powerpc/kernel/vdso/Makefile | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile
> index 8834dfe9d727..368759f81708 100644
> --- a/arch/powerpc/kernel/vdso/Makefile
> +++ b/arch/powerpc/kernel/vdso/Makefile
> @@ -62,6 +62,12 @@ CC32FLAGSREMOVE += -fno-stack-clash-protection
>  # 32-bit one. clang validates the values passed to these arguments during
>  # parsing, even when -fno-stack-protector is passed afterwards.
>  CC32FLAGSREMOVE += -mstack-protector-guard%
> +# ftrace is disabled for the vdso but arch/powerpc/Makefile adds this define to
> +# KBUILD_CPPFLAGS, which enables use of the 'patchable_function_entry'
> +# attribute in the 'inline' define via 'notrace'. This attribute is not
> +# supported for the powerpcle target, resulting in many instances of
> +# -Wunknown-attributes.
> +CC32FLAGSREMOVE += -DCC_USING_PATCHABLE_FUNCTION_ENTRY
>  endif
>  LD32FLAGS := -Wl,-soname=linux-vdso32.so.1
>  AS32FLAGS := -D__VDSO32__
> 
> ---
> base-commit: 35e4f2a17eb40288f9bcdb09549fa04a63a96279
> change-id: 20260311-ppc-vdso-drop-cc-using-pfe-define-clang-46d6f5041544
> 
> Best regards,
> --  
> Nathan Chancellor <nathan@kernel.org>
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-16 23:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12  0:39 [PATCH] powerpc/vdso: Drop -DCC_USING_PATCHABLE_FUNCTION_ENTRY from 32-bit flags with clang Nathan Chancellor
2026-04-16 23:37 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox