projects/aports·blob master · refs

231 lines · 6.2 KiB

1From koen.kooi at linaro.org Sat Apr 11 01:23:22 2015
2From: koen.kooi at linaro.org (Koen Kooi)
3Date: Sat, 11 Apr 2015 10:23:22 +0200
4Subject: [systemd-devel] [gummiboot][PATCH 1/5] Makefile: support non-x86
5 builds
6Message-ID: <[email protected]>
7
8Move the no-mmx/no-sse CFLAGS to X86-64 and IA32 defines in preparation
9for ARM32 and Aarch64 support.
10
11Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
12---
13 Makefile.am | 12 +++++++++---
14 1 file changed, 9 insertions(+), 3 deletions(-)
15
16diff --git a/Makefile.am b/Makefile.am
17index 6568a35..2cca313 100644
18--- a/Makefile.am
19+++ b/Makefile.am
20@@ -94,17 +94,23 @@ efi_cflags = \
21 -ffreestanding \
22 -fno-strict-aliasing \
23 -fno-stack-protector \
24- -Wsign-compare \
25- -mno-sse \
26- -mno-mmx
27+ -Wsign-compare
28
29 if ARCH_X86_64
30 efi_cflags += \
31 -mno-red-zone \
32+ -mno-sse \
33+ -mno-mmx
34 -DEFI_FUNCTION_WRAPPER \
35 -DGNU_EFI_USE_MS_ABI
36 endif
37
38+if ARCH_IA32
39+efi_cflags += \
40+ -mno-sse \
41+ -mno-mmx
42+endif
43+
44 efi_ldflags = \
45 $(EFI_LDFLAGS) \
46 -T $(EFI_LDS_DIR)/elf_$(ARCH)_efi.lds \
47--
482.0.1
49
50
51From koen.kooi at linaro.org Sat Apr 11 01:23:23 2015
52From: koen.kooi at linaro.org (Koen Kooi)
53Date: Sat, 11 Apr 2015 10:23:23 +0200
54Subject: [systemd-devel] [gummiboot][PATCH 2/5] util: use x86 ASM only on
55 x86(-64) platforms.
56In-Reply-To: <[email protected]>
57References: <[email protected]>
58Message-ID: <[email protected]>
59
60Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
61---
62 src/efi/util.c | 4 +++-
63 1 file changed, 3 insertions(+), 1 deletion(-)
64
65diff --git a/src/efi/util.c b/src/efi/util.c
66index ba5ed7d..689bc7c 100644
67--- a/src/efi/util.c
68+++ b/src/efi/util.c
69@@ -33,7 +33,9 @@ UINT64 ticks_read(VOID) {
70 __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
71 return (d << 32) | a;
72 }
73-#else
74+#endif
75+
76+#ifdef __i386__
77 UINT64 ticks_read(VOID) {
78 UINT64 val;
79 __asm__ volatile ("rdtsc" : "=A" (val));
80--
812.0.1
82
83
84From koen.kooi at linaro.org Sat Apr 11 01:23:24 2015
85From: koen.kooi at linaro.org (Koen Kooi)
86Date: Sat, 11 Apr 2015 10:23:24 +0200
87Subject: [systemd-devel] [gummiboot][PATCH 3/5] configure: add AARCH64
88 support
89In-Reply-To: <[email protected]>
90References: <[email protected]>
91Message-ID: <[email protected]>
92
93This is just plumbing to add ARCH_AARCH64 for makefile tests and
94defining the machine name.
95
96Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
97---
98 configure.ac | 4 ++++
99 1 file changed, 4 insertions(+)
100
101diff --git a/configure.ac b/configure.ac
102index 27bbe1d..c2077b1 100644
103--- a/configure.ac
104+++ b/configure.ac
105@@ -51,6 +51,7 @@ dnl Define ARCH_<NAME> conditionals
106 SET_ARCH(IA32, i*86*)
107 SET_ARCH(X86_64, x86_64*)
108 SET_ARCH(IA64, ia64*)
109+SET_ARCH(AARCH64, aarch64*)
110
111 ARCH=`echo $host | sed "s/\(-\).*$//"`
112
113@@ -61,6 +62,9 @@ AM_COND_IF(ARCH_IA32, [
114 AM_COND_IF(ARCH_X86_64, [
115 MACHINE_TYPE_NAME=x64])
116
117+AM_COND_IF(ARCH_AARCH64, [
118+ MACHINE_TYPE_NAME=aa64])
119+
120 AC_SUBST([ARCH])
121 AC_SUBST([MACHINE_TYPE_NAME])
122
123--
1242.0.1
125
126
127From koen.kooi at linaro.org Sat Apr 11 01:23:25 2015
128From: koen.kooi at linaro.org (Koen Kooi)
129Date: Sat, 11 Apr 2015 10:23:25 +0200
130Subject: [systemd-devel] [gummiboot][PATCH 4/5] util: confine x86 asm to x86
131 architectures
132In-Reply-To: <[email protected]>
133References: <[email protected]>
134Message-ID: <[email protected]>
135
136Also add a stub function that just returns '1' to avoid missing symbols.
137
138Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
139---
140 src/efi/util.c | 9 ++++++---
141 1 file changed, 6 insertions(+), 3 deletions(-)
142
143diff --git a/src/efi/util.c b/src/efi/util.c
144index 689bc7c..6ce1f18 100644
145--- a/src/efi/util.c
146+++ b/src/efi/util.c
147@@ -33,14 +33,17 @@ UINT64 ticks_read(VOID) {
148 __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
149 return (d << 32) | a;
150 }
151-#endif
152-
153-#ifdef __i386__
154+#elif __i386__
155 UINT64 ticks_read(VOID) {
156 UINT64 val;
157 __asm__ volatile ("rdtsc" : "=A" (val));
158 return val;
159 }
160+#else
161+UINT64 ticks_read(VOID) {
162+ UINT64 val = 1;
163+ return val;
164+}
165 #endif
166
167 /* count TSC ticks during a millisecond delay */
168--
1692.0.1
170
171
172From koen.kooi at linaro.org Sat Apr 11 01:23:26 2015
173From: koen.kooi at linaro.org (Koen Kooi)
174Date: Sat, 11 Apr 2015 10:23:26 +0200
175Subject: [systemd-devel] [gummiboot][PATCH 5/5] Makefile.am: Add support for
176 AARCH64
177In-Reply-To: <[email protected]>
178References: <[email protected]>
179Message-ID: <[email protected]>
180
181Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
182binary trick gnu-efi and the Red Hat shimloader are using.
183
184Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
185---
186 Makefile.am | 15 +++++++++++++--
187 1 file changed, 13 insertions(+), 2 deletions(-)
188
189diff --git a/Makefile.am b/Makefile.am
190index 2cca313..eba5ec4 100644
191--- a/Makefile.am
192+++ b/Makefile.am
193@@ -121,6 +121,17 @@ efi_ldflags = \
194 -L $(EFI_LIB_DIR) \
195 $(EFI_LDS_DIR)/crt0-efi-$(ARCH).o
196
197+# Aarch64 and ARM32 don't have an EFI capable objcopy
198+if ARCH_AARCH64
199+efi_ldflags += \
200+ --defsym=EFI_SUBSYSTEM=0xa
201+
202+FORMAT = -O binary
203+else
204+FORMAT = --target=efi-app-$(ARCH)
205+endif
206+
207+
208 # ------------------------------------------------------------------------------
209 gummiboot_headers = \
210 src/efi/util.h \
211@@ -156,7 +167,7 @@ $(gummiboot_solib): $(gummiboot_objects)
212 $(gummiboot): $(gummiboot_solib)
213 $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
214 -j .dynsym -j .rel -j .rela -j .reloc \
215- --target=efi-app-$(ARCH) $< $@
216+ $(FORMAT) $< $@
217
218 # ------------------------------------------------------------------------------
219 stub_headers = \
220@@ -191,7 +202,7 @@ $(stub_solib): $(stub_objects)
221 $(stub): $(stub_solib)
222 $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
223 -j .dynsym -j .rel -j .rela -j .reloc \
224- --target=efi-app-$(ARCH) $< $@
225+ $(FORMAT) $< $@
226
227 # ------------------------------------------------------------------------------
228 CLEANFILES += test-disk.img
229--
2302.0.1
231