All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Config.in: disable PIC/PIE for microblaze
@ 2021-06-12 10:24 Romain Naour
  2021-07-25 13:49 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Romain Naour @ 2021-06-12 10:24 UTC (permalink / raw)
  To: buildroot

As reported by Toolchain-builder project [1], the system doesn't
boot when PIC/PIE is enabled for glibc based toolchain (the init
process hang).

Also, hardening features may not be wanted or possible for such
slow soft-core cpus [2].

Like for NiosII, disable BR2_PIC_PIE.

[1] https://gitlab.com/bootlin/toolchains-builder/-/pipelines/318038406
[2] http://lists.busybox.net/pipermail/buildroot/2021-June/312416.html

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 Config.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Config.in b/Config.in
index c05485173b..7f2ee553a5 100644
--- a/Config.in
+++ b/Config.in
@@ -729,7 +729,9 @@ comment "Security Hardening Options"
 config BR2_PIC_PIE
 	bool "Build code with PIC/PIE"
 	default y
+	# 'Hardening' features are not recommended/wanted for soft-core cpus.
 	# Nios2 toolchains produce non working binaries with -fPIC
+	depends on !BR2_microblaze
 	depends on !BR2_nios2
 	depends on BR2_SHARED_LIBS
 	depends on BR2_TOOLCHAIN_SUPPORTS_PIE
@@ -738,6 +740,7 @@ config BR2_PIC_PIE
 	  Position-Independent Executables (PIE).
 
 comment "PIC/PIE needs a toolchain w/ PIE"
+	depends on !BR2_microblaze
 	depends on !BR2_nios2
 	depends on BR2_SHARED_LIBS
 	depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
@@ -829,6 +832,7 @@ config BR2_RELRO_PARTIAL
 
 config BR2_RELRO_FULL
 	bool "Full"
+	depends on !BR2_microblaze # BR2_PIC_PIE
 	depends on !BR2_nios2 # BR2_PIC_PIE
 	depends on BR2_TOOLCHAIN_SUPPORTS_PIE
 	select BR2_PIC_PIE
@@ -838,6 +842,7 @@ config BR2_RELRO_FULL
 	  program loading, i.e every time an executable is started.
 
 comment "RELRO Full needs a toolchain w/ PIE"
+	depends on !BR2_microblaze
 	depends on !BR2_nios2
 	depends on !BR2_TOOLCHAIN_SUPPORTS_PIE
 
-- 
2.31.1

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

* Re: [Buildroot] [PATCH] Config.in: disable PIC/PIE for microblaze
  2021-06-12 10:24 [Buildroot] [PATCH] Config.in: disable PIC/PIE for microblaze Romain Naour
@ 2021-07-25 13:49 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-07-25 13:49 UTC (permalink / raw)
  To: Romain Naour; +Cc: buildroot

On Sat, 12 Jun 2021 12:24:49 +0200
Romain Naour <romain.naour@gmail.com> wrote:

> As reported by Toolchain-builder project [1], the system doesn't
> boot when PIC/PIE is enabled for glibc based toolchain (the init
> process hang).
> 
> Also, hardening features may not be wanted or possible for such
> slow soft-core cpus [2].
> 
> Like for NiosII, disable BR2_PIC_PIE.
> 
> [1] https://gitlab.com/bootlin/toolchains-builder/-/pipelines/318038406
> [2] http://lists.busybox.net/pipermail/buildroot/2021-June/312416.html
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> ---
>  Config.in | 5 +++++
>  1 file changed, 5 insertions(+)

I have introduced a preparation patch that adds a hidden
BR2_PIC_PIE_ARCH_SUPPORTS boolean, and then made use of it to exclude
Microblaze from PIC/PIE. It makes the whole thing a bit clearer IMO.

So, in short: applied, with those changes!

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

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

end of thread, other threads:[~2021-07-25 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 10:24 [Buildroot] [PATCH] Config.in: disable PIC/PIE for microblaze Romain Naour
2021-07-25 13:49 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.