2 # Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
3 # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
4 # Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
5 # Copyright (c) 2015, Hewlett-Packard Development Company, L.P.<BR>
6 # (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
8 # This program and the accompanying materials
9 # are licensed and made available under the terms and conditions of the BSD License
10 # which accompanies this distribution. The full text of the license may be found at
11 # http://opensource.org/licenses/bsd-license.php
13 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 #The following has been adapted from the BaseTools/Conf/tools_def.template file
18 #and is used to direct the edk2 build to use coreboot's crossgcc toolchain
19 #rather than the host machine's toolchain
21 DEFINE COREBOOT_IA32_PREFIX = ENV(GCC_CC_x86_32)
22 DEFINE COREBOOT_X64_PREFIX = ENV(GCC_CC_x86_64)
23 DEFINE COREBOOT_ARM_PREFIX = ENV(GCC_CC_arm)
24 DEFINE COREBOOT_ARM64_PREFIX = ENV(GCC_CC_arm64)
26 DEFINE COREBOOT_IA32_OBJCOPY = ENV(OBJCOPY_x86_32)
27 DEFINE COREBOOT_X64_OBJCOPY = ENV(OBJCOPY_x86_64)
28 DEFINE COREBOOT_ARM_OBJCOPY = ENV(OBJCOPY_arm)
29 DEFINE COREBOOT_ARM64_OBJCOPY = ENV(OBJCOPY_arm64)
31 ####################################################################################
33 # COREBOOT - This configuration is used to compile under Linux to produce
34 # PE/COFF binaries using coreboot's toolchain.
36 ##################################################################################
38 *_COREBOOT_*_*_FAMILY = GCC
40 *_COREBOOT_*_MAKE_PATH = make
41 *_COREBOOT_*_*_DLL = ENV(GCC5_DLL)
42 *_COREBOOT_*_ASL_PATH = DEF(UNIX_IASL_BIN)
44 *_COREBOOT_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
45 *_COREBOOT_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
46 *_COREBOOT_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
47 *_COREBOOT_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
48 *_COREBOOT_*_APP_FLAGS =
49 *_COREBOOT_*_ASL_FLAGS = DEF(IASL_FLAGS)
50 *_COREBOOT_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
53 # COREBOOT IA32 definitions
55 *_COREBOOT_IA32_OBJCOPY_PATH = DEF(COREBOOT_IA32_OBJCOPY)
56 *_COREBOOT_IA32_CC_PATH = DEF(COREBOOT_IA32_PREFIX)
57 *_COREBOOT_IA32_SLINK_PATH = DEF(COREBOOT_IA32_PREFIX)-ar
58 *_COREBOOT_IA32_DLINK_PATH = DEF(COREBOOT_IA32_PREFIX)
59 *_COREBOOT_IA32_ASLDLINK_PATH = DEF(COREBOOT_IA32_PREFIX)
60 *_COREBOOT_IA32_ASM_PATH = DEF(COREBOOT_IA32_PREFIX)
61 *_COREBOOT_IA32_PP_PATH = DEF(COREBOOT_IA32_PREFIX)
62 *_COREBOOT_IA32_VFRPP_PATH = DEF(COREBOOT_IA32_PREFIX)
63 *_COREBOOT_IA32_ASLCC_PATH = DEF(COREBOOT_IA32_PREFIX)
64 *_COREBOOT_IA32_ASLPP_PATH = DEF(COREBOOT_IA32_PREFIX)
65 *_COREBOOT_IA32_RC_PATH = DEF(COREBOOT_IA32_OBJCOPY)
67 *_COREBOOT_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32 -fno-lto
68 *_COREBOOT_IA32_ASLDLINK_FLAGS = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_i386
69 *_COREBOOT_IA32_ASM_FLAGS = DEF(GCC5_ASM_FLAGS) -m32 -march=i386
70 *_COREBOOT_IA32_DLINK2_FLAGS = DEF(GCC5_IA32_DLINK2_FLAGS)
71 *_COREBOOT_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
72 *_COREBOOT_IA32_OBJCOPY_FLAGS =
73 *_COREBOOT_IA32_NASM_FLAGS = -f elf32
75 DEBUG_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os
76 DEBUG_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 -z common-page-size=0x1000
78 RELEASE_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -flto -Os -Wno-unused-but-set-variable
79 RELEASE_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -flto -Os -Wl,-m,elf_i386,--oformat=elf32-i386 -z common-page-size=0x1000
81 NOOPT_COREBOOT_IA32_CC_FLAGS = DEF(GCC5_IA32_CC_FLAGS) -O0
82 NOOPT_COREBOOT_IA32_DLINK_FLAGS = DEF(GCC5_IA32_X64_DLINK_FLAGS) -Wl,-m,elf_i386,--oformat=elf32-i386 -O0 -z common-page-size=0x1000
85 # COREBOOT X64 definitions
87 *_COREBOOT_X64_OBJCOPY_PATH = DEF(COREBOOT_X64_OBJCOPY)
88 *_COREBOOT_X64_CC_PATH = DEF(COREBOOT_X64_PREFIX)
89 *_COREBOOT_X64_SLINK_PATH = DEF(COREBOOT_X64_PREFIX)-ar
90 *_COREBOOT_X64_DLINK_PATH = DEF(COREBOOT_X64_PREFIX)
91 *_COREBOOT_X64_ASLDLINK_PATH = DEF(COREBOOT_X64_PREFIX)
92 *_COREBOOT_X64_ASM_PATH = DEF(COREBOOT_X64_PREFIX)
93 *_COREBOOT_X64_PP_PATH = DEF(COREBOOT_X64_PREFIX)
94 *_COREBOOT_X64_VFRPP_PATH = DEF(COREBOOT_X64_PREFIX)
95 *_COREBOOT_X64_ASLCC_PATH = DEF(COREBOOT_X64_PREFIX)
96 *_COREBOOT_X64_ASLPP_PATH = DEF(COREBOOT_X64_PREFIX)
97 *_COREBOOT_X64_RC_PATH = DEF(COREBOOT_X64_OBJCOPY)
99 *_COREBOOT_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64 -fno-lto
100 *_COREBOOT_X64_ASLDLINK_FLAGS = DEF(GCC5_IA32_X64_ASLDLINK_FLAGS) -Wl,-m,elf_x86_64
101 *_COREBOOT_X64_ASM_FLAGS = DEF(GCC5_ASM_FLAGS) -m64
102 *_COREBOOT_X64_DLINK2_FLAGS = DEF(GCC5_X64_DLINK2_FLAGS)
103 *_COREBOOT_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
104 *_COREBOOT_X64_OBJCOPY_FLAGS =
105 *_COREBOOT_X64_NASM_FLAGS = -f elf64
107 DEBUG_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os
108 DEBUG_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os -z common-page-size=0x1000
110 RELEASE_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -flto -DUSING_LTO -Os -Wno-unused-but-set-variable
111 RELEASE_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -flto -Os -z common-page-size=0x1000
113 NOOPT_COREBOOT_X64_CC_FLAGS = DEF(GCC5_X64_CC_FLAGS) -O0
114 NOOPT_COREBOOT_X64_DLINK_FLAGS = DEF(GCC5_X64_DLINK_FLAGS) -O0 -z common-page-size=0x1000
117 # COREBOOT ARM definitions
119 *_COREBOOT_ARM_CC_PATH = ENV(COREBOOT_ARM_PREFIX)
120 *_COREBOOT_ARM_SLINK_PATH = ENV(COREBOOT_ARM_PREFIX)-ar
121 *_COREBOOT_ARM_DLINK_PATH = ENV(COREBOOT_ARM_PREFIX)
122 *_COREBOOT_ARM_ASLDLINK_PATH = ENV(COREBOOT_ARM_PREFIX)
123 *_COREBOOT_ARM_ASM_PATH = ENV(COREBOOT_ARM_PREFIX)
124 *_COREBOOT_ARM_PP_PATH = ENV(COREBOOT_ARM_PREFIX)
125 *_COREBOOT_ARM_VFRPP_PATH = ENV(COREBOOT_ARM_PREFIX)
126 *_COREBOOT_ARM_ASLCC_PATH = ENV(COREBOOT_ARM_PREFIX)
127 *_COREBOOT_ARM_ASLPP_PATH = ENV(COREBOOT_ARM_PREFIX)
128 *_COREBOOT_ARM_RC_PATH = ENV(COREBOOT_ARM_OBJCOPY)
130 *_COREBOOT_ARM_ARCHCC_FLAGS = -mthumb
131 *_COREBOOT_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
132 *_COREBOOT_ARM_ASLDLINK_FLAGS = DEF(GCC5_ARM_ASLDLINK_FLAGS)
133 *_COREBOOT_ARM_ASM_FLAGS = DEF(GCC5_ARM_ASM_FLAGS)
134 *_COREBOOT_ARM_DLINK2_FLAGS = DEF(GCC5_ARM_DLINK2_FLAGS)
135 *_COREBOOT_ARM_PLATFORM_FLAGS = -march=armv7-a
136 *_COREBOOT_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
137 *_COREBOOT_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS)
138 *_COREBOOT_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
139 *_COREBOOT_ARM_CC_XIPFLAGS = DEF(GCC5_ARM_CC_XIPFLAGS)
141 DEBUG_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0
142 DEBUG_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -z common-page-size=0x1000
144 RELEASE_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -flto -Wno-unused-but-set-variable
145 RELEASE_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-arm -Wl,-plugin-opt=-pass-through=-llto-arm -z common-page-size=0x1000
147 NOOPT_COREBOOT_ARM_CC_FLAGS = DEF(GCC5_ARM_CC_FLAGS) -O0
148 NOOPT_COREBOOT_ARM_DLINK_FLAGS = DEF(GCC5_ARM_DLINK_FLAGS) -O0 -z common-page-size=0x1000
151 # COREBOOT AARCH64 definitions
153 *_COREBOOT_AARCH64_CC_PATH = ENV(COREBOOT_ARM64_PREFIX)
154 *_COREBOOT_AARCH64_SLINK_PATH = ENV(COREBOOT_ARM64_PREFIX)-ar
155 *_COREBOOT_AARCH64_DLINK_PATH = ENV(COREBOOT_ARM64_PREFIX)
156 *_COREBOOT_AARCH64_ASLDLINK_PATH = ENV(COREBOOT_ARM64_PREFIX)
157 *_COREBOOT_AARCH64_ASM_PATH = ENV(COREBOOT_ARM64_PREFIX)
158 *_COREBOOT_AARCH64_PP_PATH = ENV(COREBOOT_ARM64_PREFIX)
159 *_COREBOOT_AARCH64_VFRPP_PATH = ENV(COREBOOT_ARM64_PREFIX)
160 *_COREBOOT_AARCH64_ASLCC_PATH = ENV(COREBOOT_ARM64_PREFIX)
161 *_COREBOOT_AARCH64_ASLPP_PATH = ENV(COREBOOT_ARM64_PREFIX)
162 *_COREBOOT_AARCH64_RC_PATH = ENV(COREBOOT_ARM64_OBJCOPY)
164 *_COREBOOT_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
165 *_COREBOOT_AARCH64_ASLDLINK_FLAGS = DEF(GCC5_AARCH64_ASLDLINK_FLAGS)
166 *_COREBOOT_AARCH64_ASM_FLAGS = DEF(GCC5_AARCH64_ASM_FLAGS)
167 *_COREBOOT_AARCH64_DLINK2_FLAGS = DEF(GCC5_AARCH64_DLINK2_FLAGS)
168 *_COREBOOT_AARCH64_PLATFORM_FLAGS =
169 *_COREBOOT_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
170 *_COREBOOT_AARCH64_RC_FLAGS = DEF(GCC_AARCH64_RC_FLAGS)
171 *_COREBOOT_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
172 *_COREBOOT_AARCH64_CC_XIPFLAGS = DEF(GCC5_AARCH64_CC_XIPFLAGS)
174 DEBUG_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small
175 DEBUG_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000
176 DEBUG_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20
178 RELEASE_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -flto -Wno-unused-but-set-variable -mcmodel=tiny -fomit-frame-pointer
179 RELEASE_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(WORKSPACE)/ArmPkg/Library/GccLto -llto-aarch64 -Wl,-plugin-opt=-pass-through=-llto-aarch64 -z common-page-size=0x1000
181 NOOPT_COREBOOT_AARCH64_CC_FLAGS = DEF(GCC5_AARCH64_CC_FLAGS) -O0 -mcmodel=small
182 NOOPT_COREBOOT_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -z common-page-size=0x1000 -O0
183 NOOPT_COREBOOT_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 -O0