Skip to contentSkip to conversation

grub2: force -fno-stack-protector in CPPFLAGS

PATCH New tarek_el-sherbiny at waters.com 3 participants 4 messages Apr 19, 2018 – May 1, 2018

lore
Share & tools
lore
#0 lore raw

cover grub2: force -fno-stack-protector in CPPFLAGS

From: Tarek El-Sherbiny <[email protected]>

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

checking for target linking format... unknown
configure: error: no suitable link format found
package/pkg-generic.mk:211: recipe for target 'output/build/grub2-2.02/.stamp_configured' failed

This problem has been previously fixed by here:
commit 2a27294e9ade6130a12ced9a1f152c51431a870e

However, a more recent change which was introduced in 2018.02.x branch has broken the build:
commit 20a4583ebf7fe97ea22a1ea11621dd44a8114ca5

This patch will implement the same workaround but for the correct flags.

Tarek El-Sherbiny (1):
grub2: force -fno-stack-protector in CPPFLAGS

 boot/grub2/grub2.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 9 lines
2.14.1


===========================================================
The information in this email is confidential, and is intended solely for the addressee(s). 
Access to this email by anyone else is unauthorized and therefore prohibited.  If you are 
not the intended recipient you are notified that disclosing, copying, distributing or taking 
any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
===========================================================
#1 lore raw

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

From: Tarek El-Sherbiny <[email protected]>

The last commit which implements this workaround is now broken by commit 20a4583ebf7fe97ea22a1ea11621dd44a8114ca5
This commit will force no-stack-protector in CPPFLAGS instead of CFLAGS to work with buildroot 2018_02

---
 boot/grub2/grub2.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
boot/grub2/grub2.mk +2 -2
index 492cddf1a5..35aea41287 100644
@@ -53,8 +53,8 @@ GRUB2_CONF_ENV = \
 	$(HOST_CONFIGURE_OPTS) \
 	CPP="$(HOSTCC) -E" \
 	TARGET_CC="$(TARGET_CC)" \
-	TARGET_CFLAGS="$(TARGET_CFLAGS) -fno-stack-protector" \
-	TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
+	TARGET_CFLAGS="$(TARGET_CFLAGS)" \
+	TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -fno-stack-protector" \
 	TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
 	NM="$(TARGET_NM)" \
 	OBJCOPY="$(TARGET_OBJCOPY)" \
Signature · 9 lines
2.14.1


===========================================================
The information in this email is confidential, and is intended solely for the addressee(s). 
Access to this email by anyone else is unauthorized and therefore prohibited.  If you are 
not the intended recipient you are notified that disclosing, copying, distributing or taking 
any action in reliance on the contents of this information is strictly prohibited and may be unlawful.
===========================================================
#2 lore raw

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

Hello,

Quoted 11 lines · tarek_el-sherbiny at waters.com

From: Tarek El-Sherbiny <[email protected]>

The last commit which implements this workaround is now broken by commit 20a4583ebf7fe97ea22a1ea11621dd44a8114ca5
This commit will force no-stack-protector in CPPFLAGS instead of CFLAGS to work with buildroot 2018_02

---
 boot/grub2/grub2.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, I've applied, after reworking a bit the commit log, and adding a reference to your bug report.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

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

In reply to tarek_el-sherbiny at waters.com
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"tarek" == tarek el-sherbiny <[email protected]> writes:

From: Tarek El-Sherbiny <[email protected]> The last commit which implements this workaround is now broken by commit 20a4583ebf7fe97ea22a1ea11621dd44a8114ca5
This commit will force no-stack-protector in CPPFLAGS instead of CFLAGS to work with buildroot 2018_02

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard