Skip to contentSkip to conversation

grub2: force -fno-stack-protector in CFLAGS

PATCH New Erico Nunes 2 participants 2 messages Aug 30, 2017 – Sep 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 grub2: force -fno-stack-protector in CFLAGS

grub2 fails to configure when BR2_SSP_ALL is enabled, with the following configure error:

checking whether -fno-asynchronous-unwind-tables works... yes checking whether -fno-unwind-tables works... yes checking for target linking format... unknown
configure: error: no suitable link format found

This can be worked around by enforcing -fno-stack-protector in the package CFLAGS in a way that overrides the SSP flag, as is already done for the valgrind package.

Fixes bug #10261.

---
 boot/grub2/grub2.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
boot/grub2/grub2.mk +1 -1
index 36f27d14ea..492cddf1a5 100644
@@ -53,7 +53,7 @@ GRUB2_CONF_ENV = \
 	$(HOST_CONFIGURE_OPTS) \
 	CPP="$(HOSTCC) -E" \
 	TARGET_CC="$(TARGET_CC)" \
-	TARGET_CFLAGS="$(TARGET_CFLAGS)" \
+	TARGET_CFLAGS="$(TARGET_CFLAGS) -fno-stack-protector" \
 	TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
 	TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
 	NM="$(TARGET_NM)" \
Signature · 1 line
2.13.5
#1 lore raw

PATCH 1/1 grub2: force -fno-stack-protector in CFLAGS

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Erico" == Erico Nunes <[email protected]> writes:

grub2 fails to configure when BR2_SSP_ALL is enabled, with the following configure error:

checking whether -fno-asynchronous-unwind-tables works... yes checking whether -fno-unwind-tables works... yes checking for target linking format... unknown
configure: error: no suitable link format found

Quoted 8 lines

This can be worked around by enforcing -fno-stack-protector in the package CFLAGS in a way that overrides the SSP flag, as is already done for the valgrind package.

Fixes bug #10261.

Committed to 2017.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard