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
|
From 0eae016b6e3dce69e3fb86aca5c4f221591a2f12 Mon Sep 17 00:00:00 2001
From: Andrew Cooper <andrew.cooper3@citrix.com>
Date: Thu, 25 Feb 2021 19:15:08 +0000
Subject: [PATCH] tools/firmware: Build firmware as -ffreestanding
firmware should always have been -ffreestanding, as it doesn't execute in the
host environment. -ffreestanding implies -fno-builtin, so replace the option.
inttypes.h isn't a freestanding header, but the 32bitbios_support.c only wants
the stdint.h types so switch to the more appropriate include.
This removes the build time dependency on a 32bit libc just to compile the
hvmloader and friends.
Update README and the TravisCI configuration.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Ian Jackson <iwj@xenproject.org>
Release-Acked-by: Ian Jackson <iwj@xenproject.org>
Applied to m-v Xen 4.14 series: Christopher Clark <christopher.w.clark@gmail.com>
---
.travis.yml | 1 -
README | 3 ---
tools/firmware/Rules.mk | 2 +-
tools/firmware/hvmloader/32bitbios_support.c | 2 +-
4 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 15ca9e9047..2362475f7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,7 +58,6 @@ addons:
- acpica-tools
- bin86
- bcc
- - libc6-dev-i386
- libnl-3-dev
- ocaml-nox
- libfindlib-ocaml-dev
diff --git a/README b/README
index 6e15242ae1..8c99c30986 100644
--- a/README
+++ b/README
@@ -62,9 +62,6 @@ provided by your OS distributor:
* GNU bison and GNU flex
* GNU gettext
* ACPI ASL compiler (iasl)
- * Libc multiarch package (e.g. libc6-dev-i386 / glibc-devel.i686).
- Required when building on a 64-bit platform to build
- 32-bit components which are enabled on a default build.
In addition to the above there are a number of optional build
prerequisites. Omitting these will cause the related features to be
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index cb388b7011..9f78a7dec9 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -16,7 +16,7 @@ CFLAGS += -Werror
$(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
# Extra CFLAGS suitable for an embedded type of environment.
-CFLAGS += -fno-builtin -msoft-float
+CFLAGS += -ffreestanding -msoft-float
# Use our own set of stand alone headers to build firmware.
#
diff --git a/tools/firmware/hvmloader/32bitbios_support.c b/tools/firmware/hvmloader/32bitbios_support.c
index 114135022e..ef681d4f57 100644
--- a/tools/firmware/hvmloader/32bitbios_support.c
+++ b/tools/firmware/hvmloader/32bitbios_support.c
@@ -20,7 +20,7 @@
* this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <inttypes.h>
+#include <stdint.h>
#include <elf.h>
#ifdef __sun__
#include <sys/machelf.h>
--
2.25.1
|