common: remove -fno-stack-protector from EMBEDDED_EXTRA_CFLAGS

This patch is preparation for making stack protector
configurable. First step is to remove -fno-stack-protector flag from
EMBEDDED_EXTRA_CFLAGS so separate components (Hypervisor in this case)
can enable/disable this feature by themselves.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Volodymyr Babchuk authored and Andrew Cooper committed 2025-03-04 12:53:15 +00:00
1 parent 66f9aceafd
commit 981d5550fd
6 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -198,7 +198,7 @@ endif
APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i))
APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
EMBEDDED_EXTRA_CFLAGS := -fno-pie -fno-stack-protector
EMBEDDED_EXTRA_CFLAGS := -fno-pie
EMBEDDED_EXTRA_CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables
XEN_EXTFILES_URL ?= https://xenbits.xen.org/xen-extfiles
+1
View File
@@ -13,6 +13,7 @@ export stubdom=y
export debug=y
# Moved from config/StdGNU.mk
CFLAGS += -O1 -fno-omit-frame-pointer
CFLAGS += -fno-stack-protector
ifeq (,$(findstring clean,$(MAKECMDGOALS)))
ifeq ($(wildcard $(MINI_OS)/Config.mk),)
+2
View File
@@ -11,6 +11,8 @@ ifneq ($(debug),y)
CFLAGS += -DNDEBUG
endif
CFLAGS += -fno-stack-protector
$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
$(call cc-option-add,CFLAGS,CC,-fcf-protection=none)
+1 -1
View File
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
CFLAGS += -fno-builtin -g0 $($(TESTCASE)-cflags)
CFLAGS += -fno-builtin -fno-stack-protector -g0 $($(TESTCASE)-cflags)
LDFLAGS_DIRECT += $(shell { $(LD) -v --warn-rwx-segments; } >/dev/null 2>&1 && echo --no-warn-rwx-segments)
+2
View File
@@ -435,6 +435,8 @@ else
CFLAGS_UBSAN :=
endif
CFLAGS += -fno-stack-protector
ifeq ($(CONFIG_LTO),y)
CFLAGS += -flto
LDFLAGS-$(CONFIG_CC_IS_CLANG) += -plugin LLVMgold.so
+1
View File
@@ -17,6 +17,7 @@ obj32 := $(addprefix $(obj)/,$(obj32))
CFLAGS_x86_32 := $(subst -m64,-m32 -march=i686,$(XEN_TREEWIDE_CFLAGS))
$(call cc-options-add,CFLAGS_x86_32,CC,$(EMBEDDED_EXTRA_CFLAGS))
CFLAGS_x86_32 += -Werror -fno-builtin -g0 -msoft-float -mregparm=3
CFLAGS_x86_32 += -fno-stack-protector
CFLAGS_x86_32 += -nostdinc -include $(filter %/include/xen/config.h,$(XEN_CFLAGS))
CFLAGS_x86_32 += $(filter -I% -O%,$(XEN_CFLAGS)) -D__XEN__
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.