Skip to contentSkip to conversation

Build: Drop -no-pie from EMBEDDED_EXTRA_CFLAGS

PATCH In review Andrew Cooper 3 participants 6 messages Sep 27, 2022 – Oct 4, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Build: Drop -no-pie from EMBEDDED_EXTRA_CFLAGS

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Fixes ecd6b9759919 ("Config.mk: correct PIE-related option(s) in EMBEDDED_EXTRA_CFLAGS")

---
CC: George Dunlap <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
CC: Henry Wang <[email protected]>

Henry: This bugfix is a blocker for 4.17.

---
 Config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Config.mk +1 -1
index 000e57e57b44..69af1e60d4cc 100644
@@ -188,7 +188,7 @@ endif
 APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
 APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 
-EMBEDDED_EXTRA_CFLAGS := -fno-pie -no-pie -fno-stack-protector -fno-stack-protector-all
+EMBEDDED_EXTRA_CFLAGS := -fno-pie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables
 
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Andrew Cooper

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Fixes ecd6b9759919 ("Config.mk: correct PIE-related option(s) in EMBEDDED_EXTRA_CFLAGS")

Perhaps the Reported-by: Stefano should be kept, even if you noticed the issue as well?

I would have preferred a mention of the questionable origin of the earlier misspelled -nopie, but I guess I'm not going to insist.

Jan

#2 lore raw
Quoted 13 lines · Jan Beulich
Quoted 11 lines · Andrew Cooper

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Fixes ecd6b9759919 ("Config.mk: correct PIE-related option(s) in EMBEDDED_EXTRA_CFLAGS")
Quoted 7 lines

Perhaps the Reported-by: Stefano should be kept, even if you noticed the issue as well?

I would have preferred a mention of the questionable origin of the earlier misspelled -nopie, but I guess I'm not going to insist.

and committed

#3 lore raw
In reply to Andrew Cooper
Quoted 8 lines · Andrew Cooper

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Since it was largely unavoidable for me to notice this while putting together the two XTF patches just sent - isn't the current way of using -no-pie there bogus then as well?

Jan

#4 lore raw
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Andrew Cooper

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

Quoted 5 lines
Quoted 2 lines

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Since it was largely unavoidable for me to notice this while putting together the two XTF patches just sent - isn't the current way of using -no-pie there bogus then as well?

Hmm, it is now.  In the past, XTF did use $(CC) for linking, but that is not the case now.  I'll drop it.

~Andrew

#5 lore raw
Quoted 8 lines · Andrew Cooper
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Andrew Cooper

This breaks all Clang builds, as demostrated by Gitlab CI.

Contrary to the description in ecd6b9759919, -no-pie is not even an option passed to the linker. GCC's actual behaviour is to inhibit the passing of -pie to the linker, as well as selecting different cr0 artefacts to be linked.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

EMBEDDED_EXTRA_CFLAGS is not used for $(CC)-doing-linking, and not liable to gain such a usecase.

Since it was largely unavoidable for me to notice this while putting together the two XTF patches just sent - isn't the current way of using -no-pie there bogus then as well?

Hmm, it is now.  In the past, XTF did use $(CC) for linking, but that is not the case now.  I'll drop it.

I notice you've dropped it without replacement - don't you want -fno-pie in its place?

Jan