mirrored from git://xenbits.xen.org/xen.git
-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware: provide a stand alone set of headers
The current build of the firmware relies on having 32bit compatible headers installed in order to build some of the 32bit firmware. Usually this can be solved by using the -ffreestanding compiler option which drops the usage of the system headers in favor of a private set of freestanding headers provided by the compiler itself that are not tied to libc. However such option is broken at least in the gcc compiler provided in Alpine Linux, as the system include path (ie: /usr/include) takes precedence over the gcc private include path: #include <...> search starts here: /usr/include /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/include And the headers in /usr/include are exclusively 64bit. Since -ffreestanding is currently broken on at least that distro, and for resilience against future compilers also having the option broken provide a set of stand alone 32bit headers required for the firmware build. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Release-Acked-by: Ian Jackson <iwj@xenproject.org>
- Loading branch information
Showing
6 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _STDARG_H_ | ||
#define _STDARG_H_ | ||
|
||
typedef __builtin_va_list va_list; | ||
#define va_copy(dest, src) __builtin_va_copy(dest, src) | ||
#define va_start(ap, last) __builtin_va_start(ap, last) | ||
#define va_end(ap) __builtin_va_end(ap) | ||
#define va_arg __builtin_va_arg | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef _STDBOOL_H_ | ||
#define _STDBOOL_H_ | ||
|
||
#define bool _Bool | ||
#define true 1 | ||
#define false 0 | ||
#define __bool_true_false_are_defined 1 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef _STDDEF_H_ | ||
#define _STDDEF_H_ | ||
|
||
typedef __SIZE_TYPE__ size_t; | ||
|
||
#define NULL ((void*)0) | ||
|
||
#define offsetof(t, m) __builtin_offsetof(t, m) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef _STDINT_H_ | ||
#define _STDINT_H_ | ||
|
||
#if defined(__LP64__) || defined(__P64__) | ||
#error "32bit only header" | ||
#endif | ||
|
||
typedef unsigned char uint8_t; | ||
typedef signed char int8_t; | ||
|
||
typedef unsigned short uint16_t; | ||
typedef signed short int16_t; | ||
|
||
typedef unsigned int uint32_t; | ||
typedef signed int int32_t; | ||
|
||
typedef unsigned long long uint64_t; | ||
typedef signed long long int64_t; | ||
|
||
#define INT8_MIN (-0x7f-1) | ||
#define INT16_MIN (-0x7fff-1) | ||
#define INT32_MIN (-0x7fffffff-1) | ||
#define INT64_MIN (-0x7fffffffffffffffll-1) | ||
|
||
#define INT8_MAX 0x7f | ||
#define INT16_MAX 0x7fff | ||
#define INT32_MAX 0x7fffffff | ||
#define INT64_MAX 0x7fffffffffffffffll | ||
|
||
#define UINT8_MAX 0xff | ||
#define UINT16_MAX 0xffff | ||
#define UINT32_MAX 0xffffffffu | ||
#define UINT64_MAX 0xffffffffffffffffull | ||
|
||
typedef uint32_t uintptr_t; | ||
|
||
#define UINTPTR_MAX UINT32_MAX | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters