From bc71f97ed74691a10ca2a6fa33e45ecaa700fe9f Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 26 Jun 2019 08:18:15 -0500 Subject: [PATCH] efi: Don't assume x86 and x86_64 build flags Change-Id: If11a892665d08f61c46b5a6a5b4bf0453225c3ee Reviewed-on: https://review.haiku-os.org/c/1533 Reviewed-by: Alex von Gluck IV --- build/jam/ArchitectureRules | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/build/jam/ArchitectureRules b/build/jam/ArchitectureRules index 583672ac09..35b887f456 100644 --- a/build/jam/ArchitectureRules +++ b/build/jam/ArchitectureRules @@ -463,14 +463,22 @@ rule KernelArchitectureSetup architecture case efi : # efi bootloader is PIC HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -fpic -fno-stack-protector - -fPIC -fshort-wchar -Wno-error=unused-variable -Wno-error=main - -mno-red-zone ; + -fPIC -fshort-wchar -Wno-error=unused-variable -Wno-error=main ; HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -fpic -fno-stack-protector - -fPIC -fshort-wchar -Wno-error=unused-variable -Wno-error=main - -mno-red-zone ; - if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 { - HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -maccumulate-outgoing-args ; - HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -maccumulate-outgoing-args ; + -fPIC -fshort-wchar -Wno-error=unused-variable -Wno-error=main ; + switch $(cpu) { + case x86 : + if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 { + HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -maccumulate-outgoing-args ; + HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -maccumulate-outgoing-args ; + } + case x86_64 : + HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -mno-red-zone ; + HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -mno-red-zone ; + if $(HAIKU_CC_IS_CLANG_$(architecture)) != 1 { + HAIKU_BOOT_$(bootTarget:U)_CCFLAGS += -maccumulate-outgoing-args ; + HAIKU_BOOT_$(bootTarget:U)_C++FLAGS += -maccumulate-outgoing-args ; + } } HAIKU_BOOT_$(bootTarget:U)_LDFLAGS = -Bstatic -Bsymbolic -nostdlib -znocombreloc -no-undefined ;