[build] Prevent use of MMX and SSE registers
[ipxe.git] / src / arch / x86_64 / Makefile
1 # Code size reduction.
2 #
3 CFLAGS += -fstrength-reduce -fomit-frame-pointer
4
5 # Code size reduction. gcc3 needs a different syntax to gcc2 if you
6 # want to avoid spurious warnings.
7 #
8 CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
9
10 # Force 64-bit code
11 #
12 CFLAGS += -m64
13 ASFLAGS += --64
14 LDFLAGS += -m elf_x86_64
15
16 # Prevent use of MMX and SSE registers
17 #
18 CFLAGS += -mno-mmx -mno-sse
19
20 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
21 #
22 CFLAGS += -fshort-wchar
23
24 # We need to undefine the default macro "i386" when compiling .S
25 # files, otherwise ".arch i386" translates to ".arch 1"...
26 #
27 CFLAGS += -Ui386
28
29 # Add -maccumulate-outgoing-args if required by this version of gcc
30 #
31 ifeq ($(CCTYPE),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 \
36 >/dev/null 2>&1
37 MS_ABI_FLAGS := $(shell $(MS_ABI_TEST) || $(ECHO) '-maccumulate-outgoing-args')
38 WORKAROUND_CFLAGS += $(MS_ABI_FLAGS)
39 endif
40
41 # x86_64-specific directories containing source files
42 #
43 SRCDIRS += arch/x86_64/core
44 SRCDIRS += arch/x86_64/prefix
45
46 # Include common x86 Makefile
47 #
48 MAKEDEPS += arch/x86/Makefile
49 include arch/x86/Makefile
50
51 # Include platform-specific Makefile
52 #
53 MAKEDEPS += arch/x86_64/Makefile.$(PLATFORM)
54 include arch/x86_64/Makefile.$(PLATFORM)