ports/sysutils/firmware/vmm/patches/patch-Makefile

44 lines
1.9 KiB
Text

Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -58,10 +58,18 @@ EXTRAVERSION=
CPPFLAGS = -P -MD -MT $@
+# For gcc stack alignment is specified with -mpreferred-stack-boundary,
+# clang has the option -mstack-alignment for that purpose.
+ifneq ($(call cc-option,$(CC),-mpreferred-stack-boundary=4,),)
+ cc_stack_align_opt := -mpreferred-stack-boundary
+else ifneq ($(call cc-option,$(CC),-mstack-alignment=4,),)
+ cc_stack_align_opt := -mstack-alignment
+endif
+
COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -g \
-Wall -Wno-strict-aliasing -Wold-style-definition \
$(call cc-option,$(CC),-Wtype-limits,) \
- -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
+ -m32 -march=i386 -mregparm=3 $(cc_stack_align_opt)=2 \
-minline-all-stringops -fomit-frame-pointer \
-freg-struct-return -ffreestanding -fno-delete-null-pointer-checks \
-ffunction-sections -fdata-sections -fno-common -fno-merge-constants
@@ -129,7 +137,7 @@ endef
%.noexec.o: %.o
@echo " Stripping $@"
- $(Q)$(STRIP) $< -o $<.strip.o
+ $(Q)$(STRIP) --regex --keep-section=\.fixedaddr\.0x[[:xdigit:]]{4} $< -o $<.strip.o
$(Q)$(PYTHON) ./scripts/ldnoexec.py $<.strip.o $@
$(OUT)%.s: %.c
@@ -274,7 +282,10 @@ $(Q)mkdir -p $(addprefix $(OUT), $(DIRS))
$(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1
endef
-$(OUT)autoconf.h : $(KCONFIG_CONFIG) ; $(call do-kconfig, silentoldconfig)
+$(OUT)/autoversion.h: scripts/buildversion.py
+ $(Q)$(PYTHON) ./scripts/buildversion.py -e "$(EXTRAVERSION)" -t "$(CC);$(AS);$(LD);$(OBJCOPY);$(OBJDUMP);$(STRIP)" $(OUT)autoversion.h
+
+$(OUT)autoconf.h : $(KCONFIG_CONFIG) $(OUT)/autoversion.h ; $(call do-kconfig, silentoldconfig)
$(KCONFIG_CONFIG): src/Kconfig vgasrc/Kconfig ; $(call do-kconfig, olddefconfig)
%onfig: ; $(call do-kconfig, $@)
help: ; $(call do-kconfig, $@)