blob: e27f84abdad8651dd39437a238139ef36359f4d4 [file] [log] [blame]
wdenk2262cfe2002-11-18 00:14:45 +00001#
2# (C) Copyright 2000-2002
3# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenk2262cfe2002-11-18 00:14:45 +00006#
7
Wolfgang Denk8ae86b72011-02-04 14:25:17 +01008CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
Mike Frysinger262ae0a2009-09-03 23:12:47 -04009
Graeme Russ5c161652010-10-07 20:03:23 +110010PLATFORM_CPPFLAGS += -fno-strict-aliasing
Graeme Russ5c161652010-10-07 20:03:23 +110011PLATFORM_CPPFLAGS += -fomit-frame-pointer
Masahiro Yamadaf6941832014-02-26 14:51:01 +090012PF_CPPFLAGS_X86 := $(call cc-option, -fno-toplevel-reorder, \
Wolfgang Denkcca4e4a2011-11-01 20:54:02 +000013 $(call cc-option, -fno-unit-at-a-time)) \
Wolfgang Denkcca4e4a2011-11-01 20:54:02 +000014 $(call cc-option, -mpreferred-stack-boundary=2)
Ben Stoltz3f1c0462015-08-04 12:33:42 -060015
Wolfgang Denkcca4e4a2011-11-01 20:54:02 +000016PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_X86)
Graeme Russa85f53c2011-02-12 15:11:21 +110017PLATFORM_CPPFLAGS += -fno-dwarf2-cfi-asm
Vasili Galkadbb72342014-06-10 16:14:56 +030018PLATFORM_CPPFLAGS += -march=i386 -m32
Graeme Russd664adb2010-10-07 20:03:20 +110019
Graeme Russa85f53c2011-02-12 15:11:21 +110020PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
21
Ben Stoltz3f1c0462015-08-04 12:33:42 -060022PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -m elf_i386
Graeme Russa85f53c2011-02-12 15:11:21 +110023
Gabe Black36b24092011-11-16 23:01:37 +000024LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
25LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
Ben Stoltz3f1c0462015-08-04 12:33:42 -060026
27OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
28 -j .rel -j .rela -j .reloc
29
30CFLAGS_NON_EFI := -mregparm=3
31CFLAGS_EFI := -fpic -fshort-wchar
32
33EFIARCH = ia32
34
35LDSCRIPT_EFI := $(srctree)/$(CPUDIR)/efi/elf_$(EFIARCH)_efi.lds
36OBJCOPYFLAGS_EFI += --target=efi-app-$(EFIARCH)
37
38ifeq ($(CONFIG_EFI_APP),y)
39
40PLATFORM_CPPFLAGS += $(CFLAGS_EFI)
41LDFLAGS_FINAL += -znocombreloc -shared
42LDSCRIPT := $(LDSCRIPT_EFI)
43
44else
45
46PLATFORM_CPPFLAGS += $(CFLAGS_NON_EFI)
47PLATFORM_LDFLAGS += --emit-relocs
48LDFLAGS_FINAL += --gc-sections -pie
49
50endif