public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gendwarfksyms: define __GENKSYMS__ when processing asm-protoypes.h
@ 2025-03-20  7:07 Ard Biesheuvel
  2025-03-20  8:22 ` Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2025-03-20  7:07 UTC (permalink / raw)
  To: linux-kbuild
  Cc: brgerst, x86, masahiroy, nathan, linux-kernel, nogikh,
	Ard Biesheuvel, Sami Tolvanen, syzbot+06fd1a3613c50d36129e

From: Ard Biesheuvel <ardb@kernel.org>

Ensure that __GENKSYMS__ is #define'd when passing asm/asm-prototypes.h
through the compiler to capture the exported symbols. This ensures that
exported symbols such as __ref_stack_chk_guard on x86, which is declared
conditionally, is visible to the tool.

Otherwise, an error such as the below may be raised, breaking the build
when CONFIG_GENDWARFKSYMS=y

  <stdin>:4:15: error: use of undeclared identifier '__ref_stack_chk_guard'

Cc: Sami Tolvanen <samitolvanen@google.com>
Reported-by: syzbot+06fd1a3613c50d36129e@syzkaller.appspotmail.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 scripts/Makefile.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 993708d11874..7855cdc4e763 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -305,6 +305,7 @@ $(obj)/%.rs: $(obj)/%.rs.S FORCE
 getasmexports =								\
    { echo "\#include <linux/kernel.h>" ;				\
      echo "\#include <linux/string.h>" ;				\
+     echo "\#define  __GENKSYMS__" ;					\
      echo "\#include <asm/asm-prototypes.h>" ;				\
      $(call getexportsymbols,EXPORT_SYMBOL(\1);) ; }
 
-- 
2.49.0.rc1.451.g8f38331e32-goog


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

end of thread, other threads:[~2025-03-20 20:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-20  7:07 [PATCH] gendwarfksyms: define __GENKSYMS__ when processing asm-protoypes.h Ard Biesheuvel
2025-03-20  8:22 ` Ard Biesheuvel
2025-03-20  9:01 ` [tip: x86/core] gendwarfksyms: Define __GENKSYMS__ when processing <asm/asm-protoypes.h> tip-bot2 for Ard Biesheuvel
2025-03-20 14:40 ` [PATCH] gendwarfksyms: define __GENKSYMS__ when processing asm-protoypes.h Masahiro Yamada
2025-03-20 14:45   ` Ard Biesheuvel
2025-03-20 14:47 ` Sami Tolvanen
2025-03-20 16:08   ` Ard Biesheuvel
2025-03-20 16:22     ` Sami Tolvanen
2025-03-20 16:41       ` Ard Biesheuvel
2025-03-20 20:00         ` Ingo Molnar

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