Skip to contentSkip to conversation

kconfig: Remove the architecture specific config for AutoFDO and Propeller

PATCH Superseded [email protected] 3 participants 14 messages May 27 – Jun 4

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover kconfig: Remove the architecture specific config for AutoFDO and Propeller

From: Rong Xu <[email protected]>

Resend this patch:

ChangeLog:
V3: (1) updated the base;
(2) changed vmlinux.lds.S for arm64 to avoid the warnings from .llvm_bb_addr_map.

Rong Xu (2):
kconfig: Remove the architecture specific config for AutoFDO
kconfig: Remove the architecture specific config for Propeller

 arch/Kconfig                    | 8 --------
 arch/arm64/kernel/vmlinux.lds.S | 3 +++
 arch/x86/Kconfig                | 2 --
 3 files changed, 3 insertions(+), 10 deletions(-)

base-commit: 2c31897a17e55a6da529b4e797e98c6febc60fd2

Signature · 1 line
2.54.0.794.g4f17f83d09-goog
#1 lore raw

PATCH v3 1/2 kconfig: Remove the architecture specific config for AutoFDO

From: Rong Xu <[email protected]>

The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.

Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.

---
 arch/Kconfig     | 4 ----
 arch/x86/Kconfig | 1 -
 2 files changed, 5 deletions(-)
arch/Kconfig +0 -4
index e86880045158..e510c585ea84 100644
@@ -863,12 +863,8 @@ config LTO_CLANG_THIN
 	  If unsure, say Y.
 endchoice
 
-config ARCH_SUPPORTS_AUTOFDO_CLANG
-	bool
-
 config AUTOFDO_CLANG
 	bool "Enable Clang's AutoFDO build (EXPERIMENTAL)"
-	depends on ARCH_SUPPORTS_AUTOFDO_CLANG
 	depends on CC_IS_CLANG && CLANG_VERSION >= 170000
 	help
 	  This option enables Clang’s AutoFDO build. When
arch/x86/Kconfig +0 -1
index f3f7cb01d69d..10bf3984102e 100644
@@ -130,7 +130,6 @@ config X86
 	select ARCH_SUPPORTS_LTO_CLANG
 	select ARCH_SUPPORTS_LTO_CLANG_THIN
 	select ARCH_SUPPORTS_RT
-	select ARCH_SUPPORTS_AUTOFDO_CLANG
 	select ARCH_SUPPORTS_PROPELLER_CLANG    if X86_64
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF		if X86_CX8
Signature · 1 line
2.54.0.794.g4f17f83d09-goog
#2 lore raw

Re: [PATCH v3 1/2] kconfig: Remove the architecture specific config for AutoFDO

Quoted 6 lines · On Wed, 27 May 2026 14:45:07 -0700, [email protected] <[email protected]> wrote:

The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.

Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.

It is worth noting that not all architectures support '-fsplit-machine-functions' but I guess that does not matter too much because it will only be used if a profile is provided, which would require an architecture that is supported by the AutoFDO tooling? The documentation is x86_64 focused but aarch64 works as well, any others that the kernel supports?

Signature · 2 lines
Cheers,
Nathan
author
#3 lore raw

Re: [PATCH v3 1/2] kconfig: Remove the architecture specific config for AutoFDO

Quoted 9 lines · Nathan Chancellor
Quoted 6 lines · On Wed, 27 May 2026 14:45:07 -0700, [email protected] <[email protected]> wrote:

The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.

Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.

Quoted 6 lines

It is worth noting that not all architectures support '-fsplit-machine-functions' but I guess that does not matter too much because it will only be used if a profile is provided, which would require an architecture that is supported by the AutoFDO tooling? The documentation is x86_64 focused but aarch64 works as well, any others that the kernel supports?

Current support extends to x86_64 and arm64 architectures only.

We initially considered making arm64 to opt-in, Will suggests that users should be expected to verify AutoFDO/Propeller compatibility independently before using it.
This approach allows for the removal of ARCH_SUPPORTS_..., which prevents potential confusion.

Thanks!

-Rong

Quoted 5 lines

--
Cheers,
Nathan

#4 lore raw

Re: [PATCH v3 1/2] kconfig: Remove the architecture specific config for AutoFDO

Quoted 17 lines · Rong Xu
Quoted 9 lines · Nathan Chancellor
Quoted 6 lines · On Wed, 27 May 2026 14:45:07 -0700, [email protected] <[email protected]> wrote:

The CONFIG_AUTOFDO_CLANG option currently depends on ARCH_SUPPORTS_AUTOFDO_CLANG, but this dependency seems unnecessary.

Remove ARCH_SUPPORTS_AUTOFDO_CLANG and allow users to control AutoFDO builds solely through CONFIG_AUTOFDO_CLANG. This simplifies the kconfig and avoids potential confusion.

Quoted 6 lines

It is worth noting that not all architectures support '-fsplit-machine-functions' but I guess that does not matter too much because it will only be used if a profile is provided, which would require an architecture that is supported by the AutoFDO tooling? The documentation is x86_64 focused but aarch64 works as well, any others that the kernel supports?

Quoted 7 lines

Current support extends to x86_64 and arm64 architectures only.

We initially considered making arm64 to opt-in, Will suggests that users should be expected to verify AutoFDO/Propeller compatibility independently before using it.
This approach allows for the removal of ARCH_SUPPORTS_..., which prevents potential confusion.

Right, in cases where the build does not break (i.e., this case), I think it is fine to leave things open to selection and restrict them when they become confusing or problematic for users based on real feedback.

Signature · 2 lines
Cheers,
Nathan
#5 lore raw

PATCH v3 2/2 kconfig: Remove the architecture specific config for Propeller

In reply to [email protected]

From: Rong Xu <[email protected]>

The CONFIG_PROPELLER_CLANG option currently depends on ARCH_SUPPORTS_PROPELLER_CLANG, but this dependency seems unnecessary.

Remove ARCH_SUPPORTS_PROPELLER_CLANG and allow users to control Propeller builds solely through CONFIG_PROPELLER_CLANG. This simplifies the kconfig and avoids potential confusion.

For arm64, change vmlinux.lds.S to ensure the .llvm_bb_addr_map is explicitly placed within its own section.

---
 arch/Kconfig                    | 4 ----
 arch/arm64/kernel/vmlinux.lds.S | 3 +++
 arch/x86/Kconfig                | 1 -
 3 files changed, 3 insertions(+), 5 deletions(-)
arch/Kconfig +0 -4
index e510c585ea84..e4eaca9c917c 100644
@@ -879,12 +879,8 @@ config AUTOFDO_CLANG
 
 	  If unsure, say N.
 
-config ARCH_SUPPORTS_PROPELLER_CLANG
-	bool
-
 config PROPELLER_CLANG
 	bool "Enable Clang's Propeller build"
-	depends on ARCH_SUPPORTS_PROPELLER_CLANG
 	depends on CC_IS_CLANG && CLANG_VERSION >= 190000
 	help
 	  This option enables Clang’s Propeller build. When the Propeller
arch/arm64/kernel/vmlinux.lds.S +3 -0
index e1ac876200a3..44a42e7c66cf 100644
@@ -368,6 +368,9 @@ SECTIONS
 
 	STABS_DEBUG
 	DWARF_DEBUG
+#ifdef CONFIG_PROPELLER_CLANG
+        .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
+#endif
 	MODINFO
 	ELF_DETAILS
 
arch/x86/Kconfig +0 -1
index 10bf3984102e..b875d2f27e48 100644
@@ -130,7 +130,6 @@ config X86
 	select ARCH_SUPPORTS_LTO_CLANG
 	select ARCH_SUPPORTS_LTO_CLANG_THIN
 	select ARCH_SUPPORTS_RT
-	select ARCH_SUPPORTS_PROPELLER_CLANG    if X86_64
 	select ARCH_USE_BUILTIN_BSWAP
 	select ARCH_USE_CMPXCHG_LOCKREF		if X86_CX8
 	select ARCH_USE_MEMTEST
Signature · 1 line
2.54.0.794.g4f17f83d09-goog
#6 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 5 lines · On Wed, 27 May 2026 14:45:08 -0700, [email protected] <[email protected]> wrote:
arch/Kconfig +0 -0
index e510c585ea84..e4eaca9c917c 100644

arch/Kconfig config AUTOFDO_CLANG · line 887

Quoted 9 lines
arch/Kconfig +0 -4
@@ -879,12 +879,8 @@ config AUTOFDO_CLANG
 
 	  If unsure, say N.
 
-config ARCH_SUPPORTS_PROPELLER_CLANG
-	bool
-
 config PROPELLER_CLANG
 	bool "Enable Clang's Propeller build"
-	depends on ARCH_SUPPORTS_PROPELLER_CLANG

It does not look like '-fbasic-block-address-map' or its predecessor, '-fbasic-block-sections=labels', are supported by all architectures? This will break allmodconfig for some architectures in that case, so this needs to addressed with some other dependency.

  | $ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 'armv6k-unknown-linux-gnueabi'
  | ...
  |
  | $ make -skj"$(nproc)" ARCH=s390 LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 's390x-unknown-linux-gnu'
  | ...

Maybe something like

  depends on CC_IS_CLANG && $(cc-option,-fbasic-block-address-map)

then cleaning up scripts/Makefile.propeller to use it exclusively?

arch/arm64/kernel/vmlinux.lds.S SECTIONS · line 372

Quoted 11 lines
arch/arm64/kernel/vmlinux.lds.S +2 -0
index e1ac876200a3..44a42e7c66cf 100644
@@ -368,6 +368,9 @@ SECTIONS
 
 	STABS_DEBUG
 	DWARF_DEBUG
+#ifdef CONFIG_PROPELLER_CLANG
+        .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }

I would prefer to take the opportunity to consolidate this into include/asm-generic/vmlinux.lds.h with something like this:

  | diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
  | index 44a42e7c66cf..8aaf404980a7 100644
  | --- a/arch/arm64/kernel/vmlinux.lds.S
  | +++ b/arch/arm64/kernel/vmlinux.lds.S
  | @@ -368,9 +368,7 @@ SECTIONS
  |  
  |  	STABS_DEBUG
  |  	DWARF_DEBUG
  | -#ifdef CONFIG_PROPELLER_CLANG
  | -        .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | -#endif
  | +	PROPELLER_DATA
  |  	MODINFO
  |  	ELF_DETAILS
  |  
  | diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
  | index 4711a35e706c..d93611675d8a 100644
  | --- a/arch/x86/kernel/vmlinux.lds.S
  | +++ b/arch/x86/kernel/vmlinux.lds.S
  | @@ -423,9 +423,7 @@ SECTIONS
  |  
  |  	STABS_DEBUG
  |  	DWARF_DEBUG
  | -#ifdef CONFIG_PROPELLER_CLANG
  | -	.llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | -#endif
  | +	PROPELLER_DATA
  |  
  |  	MODINFO
  |  	ELF_DETAILS
  | diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
  | index 60c8c22fd3e4..7a157a1320b9 100644
  | --- a/include/asm-generic/vmlinux.lds.h
  | +++ b/include/asm-generic/vmlinux.lds.h
  | @@ -1011,6 +1011,13 @@
  |  #define PERCPU_DECRYPTED_SECTION
  |  #endif
  |  
  | +#ifdef CONFIG_PROPELLER_CLANG
  | +#define PROPELLER_DATA							\
  | +	.llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | +#else
  | +#define PROPELLER_DATA
  | +#endif
  | +
  |  
  |  /*
  |   * Default discarded sections.

That keeps the ifdef in one place and makes it easy to add this to other architecture linker scripts as they gain support for Propeller. Are there any other architectures that need this added? Or are arm64 and x86_64 the only supported architectures?

Signature · 2 lines
Cheers,
Nathan
author
#7 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Thanks Nathan for the review! My response is inlined.

Quoted 10 lines · Nathan Chancellor
Quoted 8 lines · On Wed, 27 May 2026 14:45:08 -0700, [email protected] <[email protected]> wrote:
arch/Kconfig +0 -0
index e510c585ea84..e4eaca9c917c 100644
@@ -879,12 +879,8 @@ config AUTOFDO_CLANG
 
        If unsure, say N.
 
Quoted 11 lines

arch/Kconfig config AUTOFDO_CLANG · line 887

Quoted 6 lines
arch/Kconfig +0 -4
-config ARCH_SUPPORTS_PROPELLER_CLANG
-     bool
-
 config PROPELLER_CLANG
      bool "Enable Clang's Propeller build"
-     depends on ARCH_SUPPORTS_PROPELLER_CLANG

It does not look like '' or its predecessor, '-fbasic-block-sections=labels', are supported by all architectures? This will break allmodconfig for some architectures in that case, so this needs to addressed with some other dependency.

Thanks for catching this. Yes. -fbasic-block-address-map currently only supports Arm64 and X86_64 as of now.
We thought people would only enable this config if they knew Propeller was supported on that architecture.
But the allmodconfig build breaks this assumption. I think I have to keep this config for propeller, and make arm64 opt-in.

Quoted 11 lines
  | $ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 'armv6k-unknown-linux-gnueabi'
  | ...
  |
  | $ make -skj"$(nproc)" ARCH=s390 LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 's390x-unknown-linux-gnu'
  | ...
Quoted 5 lines

Maybe something like

  depends on CC_IS_CLANG && $(cc-option,-fbasic-block-address-map)

then cleaning up scripts/Makefile.propeller to use it exclusively?

I think keep ARCH_SUPPORTS_PROPELLER_CLANG is cleaner.

Quoted 65 lines

arch/arm64/kernel/vmlinux.lds.S SECTIONS · line 372

Quoted 12 lines
arch/arm64/kernel/vmlinux.lds.S +2 -0
index e1ac876200a3..44a42e7c66cf 100644
@@ -368,6 +368,9 @@ SECTIONS
 
      STABS_DEBUG
      DWARF_DEBUG
+#ifdef CONFIG_PROPELLER_CLANG
+        .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }

I would prefer to take the opportunity to consolidate this into include/asm-generic/vmlinux.lds.h with something like this:

  | diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
  | index 44a42e7c66cf..8aaf404980a7 100644
  | --- a/arch/arm64/kernel/vmlinux.lds.S
  | +++ b/arch/arm64/kernel/vmlinux.lds.S
  | @@ -368,9 +368,7 @@ SECTIONS
  |
  |     STABS_DEBUG
  |     DWARF_DEBUG
  | -#ifdef CONFIG_PROPELLER_CLANG
  | -        .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | -#endif
  | +   PROPELLER_DATA
  |     MODINFO
  |     ELF_DETAILS
  |
  | diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
  | index 4711a35e706c..d93611675d8a 100644
  | --- a/arch/x86/kernel/vmlinux.lds.S
  | +++ b/arch/x86/kernel/vmlinux.lds.S
  | @@ -423,9 +423,7 @@ SECTIONS
  |
  |     STABS_DEBUG
  |     DWARF_DEBUG
  | -#ifdef CONFIG_PROPELLER_CLANG
  | -   .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | -#endif
  | +   PROPELLER_DATA
  |
  |     MODINFO
  |     ELF_DETAILS
  | diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
  | index 60c8c22fd3e4..7a157a1320b9 100644
  | --- a/include/asm-generic/vmlinux.lds.h
  | +++ b/include/asm-generic/vmlinux.lds.h
  | @@ -1011,6 +1011,13 @@
  |  #define PERCPU_DECRYPTED_SECTION
  |  #endif
  |
  | +#ifdef CONFIG_PROPELLER_CLANG
  | +#define PROPELLER_DATA                                                     \
  | +   .llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
  | +#else
  | +#define PROPELLER_DATA
  | +#endif
  | +
  |
  |  /*
  |   * Default discarded sections.
Quoted 4 lines

That keeps the ifdef in one place and makes it easy to add this to other architecture linker scripts as they gain support for Propeller. Are there any other architectures that need this added? Or are arm64 and x86_64 the only supported architectures?

I think this is good idea to move to vmlinux.lds.h. I'll change the patch accordingly.

Quoted 5 lines

--
Cheers,
Nathan

maintainer
#8 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 40 lines · Rong Xu
Quoted 9 lines · Nathan Chancellor
Quoted 8 lines · On Wed, 27 May 2026 14:45:08 -0700, [email protected] <[email protected]> wrote:
arch/Kconfig +0 -0
index e510c585ea84..e4eaca9c917c 100644
@@ -879,12 +879,8 @@ config AUTOFDO_CLANG
 
        If unsure, say N.
 
Quoted 11 lines

arch/Kconfig config AUTOFDO_CLANG · line 887

Quoted 6 lines
arch/Kconfig +0 -4
-config ARCH_SUPPORTS_PROPELLER_CLANG
-     bool
-
 config PROPELLER_CLANG
      bool "Enable Clang's Propeller build"
-     depends on ARCH_SUPPORTS_PROPELLER_CLANG

It does not look like '' or its predecessor, '-fbasic-block-sections=labels', are supported by all architectures? This will break allmodconfig for some architectures in that case, so this needs to addressed with some other dependency.

Thanks for catching this. Yes. -fbasic-block-address-map currently only supports Arm64 and X86_64 as of now.
We thought people would only enable this config if they knew Propeller was supported on that architecture.
But the allmodconfig build breaks this assumption. I think I have to keep this config for propeller, and make arm64 opt-in.

Quoted 11 lines
  | $ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 'armv6k-unknown-linux-gnueabi'
  | ...
  |
  | $ make -skj"$(nproc)" ARCH=s390 LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 's390x-unknown-linux-gnu'
  | ...
Quoted 7 lines
Quoted 5 lines

Maybe something like

  depends on CC_IS_CLANG && $(cc-option,-fbasic-block-address-map)

then cleaning up scripts/Makefile.propeller to use it exclusively?

I think keep ARCH_SUPPORTS_PROPELLER_CLANG is cleaner.

I still don't think it has anything to do with the arch. If the compiler supports the option, then we can use it. The arch code in the kernel doesn't need to do anything, right? So can you just check if the compiler accepts the option using a 'depends on $(cc-option, ...)' line?

Will

author
#9 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 46 lines · Will Deacon
Quoted 44 lines · Rong Xu
Quoted 9 lines · Nathan Chancellor
Quoted 8 lines · On Wed, 27 May 2026 14:45:08 -0700, [email protected] <[email protected]> wrote:
arch/Kconfig +0 -0
index e510c585ea84..e4eaca9c917c 100644
@@ -879,12 +879,8 @@ config AUTOFDO_CLANG
 
        If unsure, say N.
 
Quoted 11 lines

arch/Kconfig config AUTOFDO_CLANG · line 887

Quoted 6 lines
arch/Kconfig +0 -4
-config ARCH_SUPPORTS_PROPELLER_CLANG
-     bool
-
 config PROPELLER_CLANG
      bool "Enable Clang's Propeller build"
-     depends on ARCH_SUPPORTS_PROPELLER_CLANG

It does not look like '' or its predecessor, '-fbasic-block-sections=labels', are supported by all architectures? This will break allmodconfig for some architectures in that case, so this needs to addressed with some other dependency.

Thanks for catching this. Yes. -fbasic-block-address-map currently only supports Arm64 and X86_64 as of now.
We thought people would only enable this config if they knew Propeller was supported on that architecture.
But the allmodconfig build breaks this assumption. I think I have to keep this config for propeller, and make arm64 opt-in.

Quoted 15 lines
  | $ make -skj"$(nproc)" ARCH=arm LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 'armv6k-unknown-linux-gnueabi'
  | ...
  |
  | $ make -skj"$(nproc)" ARCH=s390 LLVM=1 mrproper allmodconfig all
  | ...
  | clang: error: unsupported option '-fbasic-block-address-map' for target 's390x-unknown-linux-gnu'
  | ...

Maybe something like

  depends on CC_IS_CLANG && $(cc-option,-fbasic-block-address-map)
Quoted 8 lines
Quoted 3 lines
Quoted 1 line

then cleaning up scripts/Makefile.propeller to use it exclusively?

I think keep ARCH_SUPPORTS_PROPELLER_CLANG is cleaner.

I still don't think it has anything to do with the arch. If the compiler supports the option, then we can use it. The arch code in the kernel doesn't need to do anything, right? So can you just check if the compiler accepts the option using a 'depends on $(cc-option, ...)' line?

Yes, arch code in the kernel does not need to do anything—it is just a marker.

I understand your concern. I can use (cc-options,...) in PROPELLER_CLANG config. But I will not use -fbasic-block-address-map for backward compatiliby reason. I would use "-fbasic-block-sections=list=/dev/null".

I'll send the updated patch shortly.

Thanks,

-Rong

Quoted 2 lines

Will

#10 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 6 lines · Rong Xu
Quoted 4 lines · Will Deacon

I still don't think it has anything to do with the arch. If the compiler supports the option, then we can use it. The arch code in the kernel doesn't need to do anything, right? So can you just check if the compiler accepts the option using a 'depends on $(cc-option, ...)' line?

Quoted 7 lines

Yes, arch code in the kernel does not need to do anything—it is just a marker.

I understand your concern. I can use (cc-options,...) in PROPELLER_CLANG config. But I will not use -fbasic-block-address-map for backward compatiliby reason. I would use "-fbasic-block-sections=list=/dev/null".

I'll send the updated patch shortly.

Technically, an architecture needs to add the section generated by this compiler option to their linker script to avoid an orphan section warning (or error from CONFIG_WERROR) if enabled, as has been done in this series.

I worry that moving to a dynamic check will cause build breakage if an LLVM target gains support for Propeller without having their kernel image linker script adjusted. Maybe that will not happen very often and even if it does, I do not mind taking on the maintenance burden of fixing it but there is a cost of moving to a dynamic check like this.

Signature · 2 lines
Cheers,
Nathan
author
#11 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 21 lines · Nathan Chancellor
Quoted 6 lines · Rong Xu
Quoted 4 lines · Will Deacon

I still don't think it has anything to do with the arch. If the compiler supports the option, then we can use it. The arch code in the kernel doesn't need to do anything, right? So can you just check if the compiler accepts the option using a 'depends on $(cc-option, ...)' line?

Quoted 7 lines

Yes, arch code in the kernel does not need to do anything—it is just a marker.

I understand your concern. I can use (cc-options,...) in PROPELLER_CLANG config. But I will not use -fbasic-block-address-map for backward compatiliby reason. I would use "-fbasic-block-sections=list=/dev/null".

I'll send the updated patch shortly.

Technically, an architecture needs to add the section generated by this compiler option to their linker script to avoid an orphan section warning (or error from CONFIG_WERROR) if enabled, as has been done in this series.

Quoted 6 lines

I worry that moving to a dynamic check will cause build breakage if an LLVM target gains support for Propeller without having their kernel image linker script adjusted. Maybe that will not happen very often and even if it does, I do not mind taking on the maintenance burden of fixing it but there is a cost of moving to a dynamic check like this.

This is true.

That said, these orphan sections usually won't impact correctness. The linker will group these together even withgout the link script change, even though it generates a lot of warnings.

With moving to a dynamic check, correct usage of this feature remains the user's responsibility -- I think this is Will's point from the very beginning.
As noted in your previous response, the dynamic check is primarily intended to prevent "allmodconfig" build failures.

I am comfortable with either the arch_kconfig or dynamic_check approach. Once a preferred solution is decided, please let me know so I can submit v4 for review.

Thanks,

-Rong

Quoted 3 lines

--
Cheers,
Nathan

maintainer
#12 lore raw

Re: [PATCH v3 2/2] kconfig: Remove the architecture specific config for Propeller

Quoted 41 lines · Rong Xu
Quoted 21 lines · Nathan Chancellor
Quoted 6 lines · Rong Xu
Quoted 4 lines · Will Deacon

I still don't think it has anything to do with the arch. If the compiler supports the option, then we can use it. The arch code in the kernel doesn't need to do anything, right? So can you just check if the compiler accepts the option using a 'depends on $(cc-option, ...)' line?

Quoted 7 lines

Yes, arch code in the kernel does not need to do anything—it is just a marker.

I understand your concern. I can use (cc-options,...) in PROPELLER_CLANG config. But I will not use -fbasic-block-address-map for backward compatiliby reason. I would use "-fbasic-block-sections=list=/dev/null".

I'll send the updated patch shortly.

Technically, an architecture needs to add the section generated by this compiler option to their linker script to avoid an orphan section warning (or error from CONFIG_WERROR) if enabled, as has been done in this series.

Quoted 6 lines

I worry that moving to a dynamic check will cause build breakage if an LLVM target gains support for Propeller without having their kernel image linker script adjusted. Maybe that will not happen very often and even if it does, I do not mind taking on the maintenance burden of fixing it but there is a cost of moving to a dynamic check like this.

This is true.

That said, these orphan sections usually won't impact correctness. The linker will group these together even withgout the link script change, even though it generates a lot of warnings.

With moving to a dynamic check, correct usage of this feature remains the user's responsibility -- I think this is Will's point from the very beginning.
As noted in your previous response, the dynamic check is primarily intended to prevent "allmodconfig" build failures.

Quoted 3 lines

I am comfortable with either the arch_kconfig or dynamic_check approach. Once a preferred solution is decided, please let me know so I can submit v4 for review.

I continue to object to the pointless ARCH_ selection and much prefer having the core Kconfig check the cc-option.

Will

maintainer Acked-by on the v3 series
#13 lore raw
In reply to [email protected]
Quoted 9 lines · On Wed, May 27, 2026 at 02:45:06PM -0700, [email protected] wrote:

From: Rong Xu <[email protected]>

Resend this patch:

ChangeLog:
V3: (1) updated the base;
(2) changed vmlinux.lds.S for arm64 to avoid the warnings from .llvm_bb_addr_map.

Quoted 8 lines

Rong Xu (2):
kconfig: Remove the architecture specific config for AutoFDO
kconfig: Remove the architecture specific config for Propeller

 arch/Kconfig                    | 8 --------
 arch/arm64/kernel/vmlinux.lds.S | 3 +++
 arch/x86/Kconfig                | 2 --
 3 files changed, 3 insertions(+), 10 deletions(-)

For the series:

Will