Skip to content

Commit

Permalink
tools/firmware: Build firmware as -ffreestanding
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
andyhhp committed Mar 1, 2021
1 parent 570da54 commit 0eae016
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ addons:
- acpica-tools
- bin86
- bcc
- libc6-dev-i386
- libnl-3-dev
- ocaml-nox
- libfindlib-ocaml-dev
Expand Down
3 changes: 0 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/firmware/Rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ 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
2 changes: 1 addition & 1 deletion tools/firmware/hvmloader/32bitbios_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* this program; If not, see <http://www.gnu.org/licenses/>.
*/

#include <inttypes.h>
#include <stdint.h>
#include <xen/libelf/elfstructs.h>

#include "util.h"
Expand Down

0 comments on commit 0eae016

Please sign in to comment.