summaryrefslogtreecommitdiff
path: root/kernels/xen/ovmf-gcc4.9-basetools.patch
blob: 7af48e8ac27c9c2cd74332110819fe7dc29d41cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index f99ddf6..f9e1e6c 100644
--- a/ovmf-dir/BaseTools/Conf/tools_def.template
+++ b/ovmf-dir/BaseTools/Conf/tools_def.template
@@ -159,6 +159,12 @@
 DEFINE GCC47_IA32_PREFIX       = /usr/bin/
 DEFINE GCC47_X64_PREFIX        = /usr/bin/
 
+DEFINE GCC48_IA32_PREFIX       = /usr/bin/
+DEFINE GCC48_X64_PREFIX        = /usr/bin/
+
+DEFINE GCC49_IA32_PREFIX       = /usr/bin/
+DEFINE GCC49_X64_PREFIX        = /usr/bin/
+
 DEFINE UNIX_IASL_BIN           = /usr/bin/iasl
 #DEFINE UNIX_IASL_BIN           = $(HOME)/programs/iasl
 DEFINE WIN_ASL_BIN_DIR         = C:\ASL
@@ -307,6 +310,12 @@ DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G
 #                             Required to build platforms or ACPI tables:
 #                               Intel(r) ACPI Compiler v20101013 from
 #                               http://www.acpica.org/downloads/previous_releases.php
+#   GCC49       -Linux-  Requires:
+#                             GCC 4.9
+#                        Optional:
+#                             Required to build platforms or ACPI tables:
+#                               Intel(r) ACPI Compiler v20101013 from
+#                               http://www.acpica.org/downloads/previous_releases.php
 #   ELFGCC      -Linux-  Requires:
 #                             GCC(this tool chain uses whatever version of gcc and binutils that is installed in /usr/bin)
 #                        Optional:
@@ -3216,6 +3225,23 @@ DEFINE GCC48_AARCH64_DLINK_FLAGS     = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
 DEFINE GCC48_ARM_ASLDLINK_FLAGS      = DEF(GCC47_ARM_ASLDLINK_FLAGS)
 DEFINE GCC48_AARCH64_ASLDLINK_FLAGS  = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
 
+DEFINE GCC_ARM_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --entry ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
+DEFINE GCC49_IA32_CC_FLAGS           = DEF(GCC47_IA32_CC_FLAGS)
+DEFINE GCC49_X64_CC_FLAGS            = DEF(GCC47_X64_CC_FLAGS)
+DEFINE GCC49_IA32_X64_DLINK_COMMON   = -nostdlib -n -q --gc-sections --script=$(EDK_TOOLS_PATH)/Scripts/gcc4.9-ld-script
+DEFINE GCC49_IA32_X64_ASLDLINK_FLAGS = DEF(GCC49_IA32_X64_DLINK_COMMON) --entry ReferenceAcpiTable -u ReferenceAcpiTable
+DEFINE GCC49_IA32_X64_DLINK_FLAGS    = DEF(GCC49_IA32_X64_DLINK_COMMON) --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
+DEFINE GCC49_X64_DLINK_FLAGS         = DEF(GCC49_IA32_X64_DLINK_FLAGS)  -melf_x86_64 --oformat=elf64-x86-64
+DEFINE GCC49_ASM_FLAGS               = DEF(GCC47_ASM_FLAGS)
+DEFINE GCC49_ARM_ASM_FLAGS           = DEF(GCC47_ARM_ASM_FLAGS)
+DEFINE GCC49_AARCH64_ASM_FLAGS       = DEF(GCC47_AARCH64_ASM_FLAGS)
+DEFINE GCC49_ARM_CC_FLAGS            = DEF(GCC47_ARM_CC_FLAGS)
+DEFINE GCC49_AARCH64_CC_FLAGS        = DEF(GCC47_AARCH64_CC_FLAGS)
+DEFINE GCC49_ARM_DLINK_FLAGS         = DEF(GCC47_ARM_DLINK_FLAGS)
+DEFINE GCC49_AARCH64_DLINK_FLAGS     = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
+DEFINE GCC49_ARM_ASLDLINK_FLAGS      = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) --oformat=elf32-littlearm
+DEFINE GCC49_AARCH64_ASLDLINK_FLAGS  = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
+
 ####################################################################################
 #
 # Unix GCC And Intel Linux ACPI Compiler
@@ -3769,6 +3794,126 @@ RELEASE_GCC48_AARCH64_CC_FLAGS   = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s
 
 ####################################################################################
 #
+# GCC 4.9 - This configuration is used to compile under Linux to produce
+#           PE/COFF binaries using GCC 4.9.
+#
+####################################################################################
+*_GCC49_*_*_FAMILY               = GCC
+
+*_GCC49_*_MAKE_PATH                    = make
+*_GCC49_*_ASL_PATH                     = DEF(UNIX_IASL_BIN)
+
+*_GCC49_*_PP_FLAGS                     = DEF(GCC_PP_FLAGS)
+*_GCC49_*_ASLPP_FLAGS                  = DEF(GCC_ASLPP_FLAGS)
+*_GCC49_*_ASLCC_FLAGS                  = DEF(GCC_ASLCC_FLAGS)
+*_GCC49_*_VFRPP_FLAGS                  = DEF(GCC_VFRPP_FLAGS)
+*_GCC49_*_APP_FLAGS                    =
+*_GCC49_*_ASL_FLAGS                    = DEF(IASL_FLAGS)
+*_GCC49_*_ASL_OUTFLAGS                 = DEF(IASL_OUTFLAGS)
+
+##################
+# GCC49 IA32 definitions
+##################
+*_GCC49_IA32_OBJCOPY_PATH         = DEF(GCC49_IA32_PREFIX)objcopy
+*_GCC49_IA32_CC_PATH              = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_SLINK_PATH           = DEF(GCC49_IA32_PREFIX)ar
+*_GCC49_IA32_DLINK_PATH           = DEF(GCC49_IA32_PREFIX)ld
+*_GCC49_IA32_ASLDLINK_PATH        = DEF(GCC49_IA32_PREFIX)ld
+*_GCC49_IA32_ASM_PATH             = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_PP_PATH              = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_VFRPP_PATH           = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_ASLCC_PATH           = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_ASLPP_PATH           = DEF(GCC49_IA32_PREFIX)gcc
+*_GCC49_IA32_RC_PATH              = DEF(GCC49_IA32_PREFIX)objcopy
+
+*_GCC49_IA32_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m32
+*_GCC49_IA32_ASLDLINK_FLAGS       = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
+*_GCC49_IA32_ASM_FLAGS            = DEF(GCC49_ASM_FLAGS) -m32 -march=i386
+*_GCC49_IA32_CC_FLAGS             = DEF(GCC49_IA32_CC_FLAGS) -Os
+*_GCC49_IA32_DLINK_FLAGS          = DEF(GCC49_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
+*_GCC49_IA32_RC_FLAGS             = DEF(GCC_IA32_RC_FLAGS)
+*_GCC49_IA32_OBJCOPY_FLAGS        = 
+
+##################
+# GCC49 X64 definitions
+##################
+*_GCC49_X64_OBJCOPY_PATH         = DEF(GCC49_X64_PREFIX)objcopy
+*_GCC49_X64_CC_PATH              = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_SLINK_PATH           = DEF(GCC49_X64_PREFIX)ar
+*_GCC49_X64_DLINK_PATH           = DEF(GCC49_X64_PREFIX)ld
+*_GCC49_X64_ASLDLINK_PATH        = DEF(GCC49_X64_PREFIX)ld
+*_GCC49_X64_ASM_PATH             = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_PP_PATH              = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_VFRPP_PATH           = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_ASLCC_PATH           = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_ASLPP_PATH           = DEF(GCC49_X64_PREFIX)gcc
+*_GCC49_X64_RC_PATH              = DEF(GCC49_X64_PREFIX)objcopy
+
+*_GCC49_X64_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS) -m64
+*_GCC49_X64_ASLDLINK_FLAGS       = DEF(GCC49_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
+*_GCC49_X64_ASM_FLAGS            = DEF(GCC49_ASM_FLAGS) -m64
+*_GCC49_X64_CC_FLAGS             = DEF(GCC49_X64_CC_FLAGS)
+*_GCC49_X64_DLINK_FLAGS          = DEF(GCC49_X64_DLINK_FLAGS)
+*_GCC49_X64_RC_FLAGS             = DEF(GCC_X64_RC_FLAGS)
+*_GCC49_X64_OBJCOPY_FLAGS        = 
+
+##################
+# GCC49 ARM definitions
+##################
+*_GCC49_ARM_CC_PATH              = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_SLINK_PATH           = ENV(GCC49_ARM_PREFIX)ar
+*_GCC49_ARM_DLINK_PATH           = ENV(GCC49_ARM_PREFIX)ld
+*_GCC49_ARM_ASLDLINK_PATH        = ENV(GCC49_ARM_PREFIX)ld
+*_GCC49_ARM_ASM_PATH             = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_PP_PATH              = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_VFRPP_PATH           = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_ASLCC_PATH           = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_ASLPP_PATH           = ENV(GCC49_ARM_PREFIX)gcc
+*_GCC49_ARM_RC_PATH              = ENV(GCC49_ARM_PREFIX)objcopy
+
+*_GCC49_ARM_ARCHCC_FLAGS         = -mthumb
+*_GCC49_ARM_PLATFORM_FLAGS       = -march=armv7-a
+
+*_GCC49_ARM_ASLCC_FLAGS          = DEF(GCC_ASLCC_FLAGS)
+*_GCC49_ARM_ASLDLINK_FLAGS       = DEF(GCC49_ARM_ASLDLINK_FLAGS)
+*_GCC49_ARM_ASM_FLAGS            = DEF(GCC49_ARM_ASM_FLAGS)
+*_GCC49_ARM_DLINK_FLAGS          = DEF(GCC49_ARM_DLINK_FLAGS)
+*_GCC49_ARM_PLATFORM_FLAGS       = -march=armv7-a
+*_GCC49_ARM_PP_FLAGS             = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_GCC49_ARM_RC_FLAGS             = DEF(GCC_ARM_RC_FLAGS)
+*_GCC49_ARM_VFRPP_FLAGS          = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+
+  DEBUG_GCC49_ARM_CC_FLAGS       = DEF(GCC49_ARM_CC_FLAGS) -O0
+RELEASE_GCC49_ARM_CC_FLAGS       = DEF(GCC49_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+
+##################
+# GCC49 AARCH64 definitions
+##################
+*_GCC49_AARCH64_CC_PATH          = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_SLINK_PATH       = ENV(GCC49_AARCH64_PREFIX)ar
+*_GCC49_AARCH64_DLINK_PATH       = ENV(GCC49_AARCH64_PREFIX)ld
+*_GCC49_AARCH64_ASLDLINK_PATH    = ENV(GCC49_AARCH64_PREFIX)ld
+*_GCC49_AARCH64_ASM_PATH         = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_PP_PATH          = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_VFRPP_PATH       = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_ASLCC_PATH       = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_ASLPP_PATH       = ENV(GCC49_AARCH64_PREFIX)gcc
+*_GCC49_AARCH64_RC_PATH          = ENV(GCC49_AARCH64_PREFIX)objcopy
+
+*_GCC49_AARCH64_ASLCC_FLAGS      = DEF(GCC_ASLCC_FLAGS)
+*_GCC49_AARCH64_ASLDLINK_FLAGS   = DEF(GCC49_AARCH64_ASLDLINK_FLAGS)
+*_GCC49_AARCH64_ASM_FLAGS        = DEF(GCC49_AARCH64_ASM_FLAGS)
+*_GCC49_AARCH64_DLINK_FLAGS      = DEF(GCC49_AARCH64_DLINK_FLAGS)
+*_GCC49_AARCH64_PLATFORM_FLAGS   =
+*_GCC49_AARCH64_PP_FLAGS         = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_GCC49_AARCH64_RC_FLAGS         = DEF(GCC_AARCH64_RC_FLAGS)
+*_GCC49_AARCH64_VFRPP_FLAGS      = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+
+  DEBUG_GCC49_AARCH64_CC_FLAGS   = DEF(GCC49_AARCH64_CC_FLAGS) -O0
+RELEASE_GCC49_AARCH64_CC_FLAGS   = DEF(GCC49_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable
+
+####################################################################################
+#
 # Cygwin GCC And Intel ACPI Compiler
 #
 ####################################################################################
diff --git a/BaseTools/Scripts/gcc4.9-ld-script b/BaseTools/Scripts/gcc4.9-ld-script
new file mode 100644
index 0000000..b692328
--- /dev/null
+++ b/ovmf-dir/BaseTools/Scripts/gcc4.9-ld-script
@@ -0,0 +1,44 @@
+/* OUTPUT_FORMAT(efi-bsdrv-x86_64) */
+SECTIONS
+{
+  /* . = 0 + SIZEOF_HEADERS; */
+  . = 0x280;
+  .text ALIGN(0x20) :
+  {
+    *(.text .stub .text.* .gnu.linkonce.t.*)
+    . = ALIGN(0x20);
+  } =0x90909090
+  .data ALIGN(0x40) :
+  {
+    *(
+      .rodata .rodata.* .gnu.linkonce.r.*
+      .data .data.* .gnu.linkonce.d.*
+      .bss .bss.*
+      *COM*
+    )
+    . = ALIGN(0x20);
+  }
+  .eh_frame ALIGN(0x20) :
+  {
+    KEEP (*(.eh_frame))
+  }
+  .got ALIGN(0x20) :
+  {
+    *(.got .got.*)
+    . = ALIGN(0x20);
+  }
+  .rela ALIGN(0x20) :
+  {
+    *(.rela .rela.*)
+  }
+  /DISCARD/ : {
+    *(.note.GNU-stack) *(.gnu_debuglink)
+    *(.interp)
+    *(.dynsym)
+    *(.dynstr)
+    *(.dynamic)
+    *(.hash)
+    *(.comment)
+  }
+}
+