x86: Add ACPI table support to QEMU
[oweals/u-boot.git] / arch / x86 / config.mk
1 #
2 # (C) Copyright 2000-2002
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier:      GPL-2.0+
6 #
7
8 CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
9
10 PLATFORM_CPPFLAGS += -fno-strict-aliasing
11 PLATFORM_CPPFLAGS += -fomit-frame-pointer
12 PF_CPPFLAGS_X86   := $(call cc-option, -fno-toplevel-reorder, \
13                        $(call cc-option, -fno-unit-at-a-time)) \
14                      $(call cc-option, -mpreferred-stack-boundary=2)
15
16 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86)
17 PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
18 PLATFORM_CPPFLAGS += -march=i386 -m32
19
20 PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
21
22 PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -m elf_i386
23
24 LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
25 LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
26
27 # This is used in the top-level Makefile which does not include
28 # PLATFORM_LDFLAGS
29 LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined
30
31 OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
32         -j .rel -j .rela -j .reloc
33
34 CFLAGS_NON_EFI := -mregparm=3
35 CFLAGS_EFI := -fpic -fshort-wchar
36
37 ifeq ($(CONFIG_EFI_STUB_64BIT),)
38 CFLAGS_EFI += $(call cc-option, -mno-red-zone)
39 EFIARCH = ia32
40 EFIPAYLOAD_BFDTARGET = elf32-i386
41 else
42 EFIARCH = x86_64
43 EFIPAYLOAD_BFDTARGET = elf64-x86-64
44 endif
45
46 EFIPAYLOAD_BFDARCH = i386
47
48 LDSCRIPT_EFI := $(srctree)/$(CPUDIR)/efi/elf_$(EFIARCH)_efi.lds
49 EFISTUB := crt0-efi-$(EFIARCH).o reloc_$(EFIARCH).o
50 OBJCOPYFLAGS_EFI += --target=efi-app-$(EFIARCH)
51
52 CPPFLAGS_REMOVE_crt0-efi-$(EFIARCH).o += $(CFLAGS_NON_EFI)
53 CPPFLAGS_crt0-efi-$(EFIARCH).o += $(CFLAGS_EFI)
54
55 ifeq ($(CONFIG_EFI_APP),y)
56
57 PLATFORM_CPPFLAGS += $(CFLAGS_EFI)
58 LDFLAGS_FINAL += -znocombreloc -shared
59 LDSCRIPT := $(LDSCRIPT_EFI)
60
61 else
62
63 PLATFORM_CPPFLAGS += $(CFLAGS_NON_EFI)
64 PLATFORM_LDFLAGS += --emit-relocs
65 LDFLAGS_FINAL += --gc-sections -pie
66
67 endif