3 CFLAGS += -fstrength-reduce -fomit-frame-pointer
5 # Code size reduction. gcc3 needs a different syntax to gcc2 if you
6 # want to avoid spurious warnings.
8 CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
10 # Use %rip-relative addressing wherever possible.
18 LDFLAGS += -m elf_x86_64
20 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
22 CFLAGS += -fshort-wchar
24 # We need to undefine the default macro "i386" when compiling .S
25 # files, otherwise ".arch i386" translates to ".arch 1"...
29 # Add -maccumulate-outgoing-args if required by this version of gcc
32 MS_ABI_TEST_CODE := extern void __attribute__ (( ms_abi )) ms_abi(); \
33 void sysv_abi ( void ) { ms_abi(); }
34 MS_ABI_TEST = $(ECHO) '$(MS_ABI_TEST_CODE)' | \
35 $(CC) -m64 -mno-accumulate-outgoing-args -x c -c - -o /dev/null \
37 MS_ABI_FLAGS := $(shell $(MS_ABI_TEST) || $(ECHO) '-maccumulate-outgoing-args')
38 WORKAROUND_CFLAGS += $(MS_ABI_FLAGS)
41 # x86_64-specific directories containing source files
43 SRCDIRS += arch/x86_64/core
44 SRCDIRS += arch/x86_64/prefix
46 # Include common x86 Makefile
48 MAKEDEPS += arch/x86/Makefile
49 include arch/x86/Makefile
51 # Include platform-specific Makefile
53 MAKEDEPS += arch/x86_64/Makefile.$(PLATFORM)
54 include arch/x86_64/Makefile.$(PLATFORM)