diff --git a/newlib.gcc14.fixes.patch b/newlib.gcc14.fixes.patch new file mode 100644 index 0000000..bdb3594 --- /dev/null +++ b/newlib.gcc14.fixes.patch @@ -0,0 +1,388 @@ +--- xen-4.18.0/stubdom/newlib-makedoc.patch.orig 2023-11-16 21:44:21.000000000 +0000 ++++ xen-4.18.0/stubdom/newlib-makedoc.patch 2024-02-01 20:32:40.565785056 +0000 +@@ -33,3 +33,385 @@ + #include + + #define DEF_SIZE 5000 ++--- ++ ++patch makedoc.c for gcc14 build ++ ++--- newlib-1.16.0/newlib/doc/makedoc.c.orig 2007-01-02 16:59:59.000000000 +0000 +++++ newlib-1.16.0/newlib/doc/makedoc.c 2024-02-01 20:26:32.415396758 +0000 ++@@ -63,25 +63,20 @@ ++ ++ ++ ++-static void DEFUN(init_string_with_size,(buffer, size), ++- string_type *buffer AND ++- unsigned int size ) +++static void init_string_with_size (string_type *buffer, unsigned int size) ++ { ++ buffer->write_idx = 0; ++ buffer->size = size; ++ buffer->ptr = malloc(size); ++ } ++ ++-static void DEFUN(init_string,(buffer), ++- string_type *buffer) +++static void init_string (string_type *buffer) ++ { ++ init_string_with_size(buffer, DEF_SIZE); ++ ++ } ++ ++-static int DEFUN(find, (str, what), ++- string_type *str AND ++- char *what) +++static int find (string_type *str, char *what) ++ { ++ unsigned int i; ++ char *p; ++@@ -97,30 +92,24 @@ ++ ++ } ++ ++-static void DEFUN(write_buffer,(buffer), ++- string_type *buffer) +++static void write_buffer (string_type *buffer) ++ { ++ fwrite(buffer->ptr, buffer->write_idx, 1, stdout); ++ } ++ ++ ++-static void DEFUN(delete_string,(buffer), ++- string_type *buffer) +++static void delete_string (string_type *buffer) ++ { ++ free(buffer->ptr); ++ } ++ ++ ++-static char *DEFUN(addr, (buffer, idx), ++- string_type *buffer AND ++- unsigned int idx) +++static char * addr (string_type *buffer, unsigned int idx) ++ { ++ return buffer->ptr + idx; ++ } ++ ++-static char DEFUN(at,(buffer, pos), ++- string_type *buffer AND ++- unsigned int pos) +++static char at (string_type *buffer, unsigned int pos) ++ { ++ if ( pos >= buffer->write_idx) ++ { ++@@ -129,9 +118,7 @@ ++ return buffer->ptr[pos]; ++ } ++ ++-static void DEFUN(catchar,(buffer, ch), ++- string_type *buffer AND ++- char ch) +++static void catchar (string_type *buffer, char ch) ++ { ++ if (buffer->write_idx == buffer->size) ++ { ++@@ -143,9 +130,7 @@ ++ } ++ ++ ++-static void DEFUN(overwrite_string,(dst, src), ++- string_type *dst AND ++- string_type *src) +++static void overwrite_string (string_type *dst, string_type *src) ++ { ++ free(dst->ptr); ++ dst->size = src->size; ++@@ -153,9 +138,7 @@ ++ dst->ptr = src->ptr; ++ } ++ ++-static void DEFUN(catstr,(dst, src), ++- string_type *dst AND ++- string_type *src) +++static void catstr ( string_type *dst, string_type *src) ++ { ++ unsigned int i; ++ for (i = 0; i < src->write_idx; i++) ++@@ -165,9 +148,7 @@ ++ } ++ ++ ++-static void DEFUN(cattext,(buffer, string), ++- string_type *buffer AND ++- char *string) +++static void cattext (string_type *buffer, char *string) ++ { ++ ++ while (*string) ++@@ -177,10 +158,7 @@ ++ } ++ } ++ ++-static void DEFUN(catbuf,(buffer, buf, len), ++- string_type *buffer AND ++- char *buf AND ++- unsigned int len) +++static void catbuf ( string_type *buffer, char *buf, unsigned int len) ++ { ++ ++ while (len--) ++@@ -192,10 +170,7 @@ ++ ++ ++ ++-static unsigned int ++-DEFUN(skip_white_and_stars,(src, idx), ++- string_type *src AND ++- unsigned int idx) +++static unsigned int skip_white_and_stars (string_type *src, unsigned int idx) ++ { ++ while (isspace(at(src,idx)) ++ || (at(src,idx) == '*' && at(src,idx +1) !='/')) ++@@ -216,10 +191,23 @@ ++ stinst_type *pc; ++ stinst_type sstack[STACK]; ++ stinst_type *ssp = &sstack[0]; ++-int istack[STACK]; ++-int *isp = &istack[0]; ++ ++-typedef int *word_type; +++#if defined(__PTRDIFF_TYPE__) +++typedef signed __PTRDIFF_TYPE__ intptr_t; +++typedef unsigned __PTRDIFF_TYPE__ uintptr_t; +++#else +++/* +++ * Fallback to hardcoded values, +++ * should be valid on cpu's with 32bit int/32bit void* +++ */ +++typedef signed long intptr_t; +++typedef unsigned long uintptr_t; +++#endif +++ +++uintptr_t istack[STACK]; +++uintptr_t *isp = &istack[0]; +++ +++typedef uintptr_t *word_type; ++ ++ ++ ++@@ -236,8 +224,7 @@ ++ typedef struct dict_struct dict_type; ++ #define WORD(x) static void x() ++ ++-static void DEFUN(exec,(word), ++- dict_type *word) +++static void exec (dict_type *word) ++ { ++ pc = word->code; ++ while (*pc) ++@@ -267,7 +254,7 @@ ++ { ++ isp++; ++ pc++; ++- *isp = (int)(*pc); +++ *isp = (uintptr_t)(*pc); ++ pc++; ++ ++ } ++@@ -294,10 +281,7 @@ ++ Blank lines are turned into one blank line ++ */ ++ ++-static void ++-DEFUN(remove_noncomments,(src,dst), ++- string_type *src AND ++- string_type *dst) +++static void remove_noncomments (string_type *src, string_type *dst) ++ { ++ unsigned int idx = 0; ++ ++@@ -349,8 +333,7 @@ ++ ++ */ ++ ++-static void ++-DEFUN_VOID(exfunstuff) +++static void exfunstuff (void) ++ { ++ unsigned int openp; ++ unsigned int fname; ++@@ -522,8 +505,7 @@ ++ } ++ ++ /* Mod tos so that only lines with leading dots remain */ ++-static void ++-DEFUN_VOID(outputdots) +++static void (outputdots (void)) ++ { ++ unsigned int idx = 0; ++ string_type out; ++@@ -772,10 +754,7 @@ ++ ++ } ++ /* A command is all upper case,and alone on a line */ ++-static int ++-DEFUN( iscommand,(ptr, idx), ++- string_type *ptr AND ++- unsigned int idx) +++static int iscommand (string_type *ptr, unsigned int idx) ++ { ++ unsigned int len = 0; ++ while (at(ptr,idx)) { ++@@ -797,10 +776,7 @@ ++ } ++ ++ ++-DEFUN(copy_past_newline,(ptr, idx, dst), ++- string_type *ptr AND ++- unsigned int idx AND ++- string_type *dst) +++unsigned int copy_past_newline (string_type *ptr, unsigned int idx, string_type *dst) ++ { ++ while (at(ptr, idx) && at(ptr, idx) != '\n') ++ { ++@@ -1060,10 +1036,7 @@ ++ ++ } ++ ++-char * ++-DEFUN(nextword,(string, word), ++- char *string AND ++- char **word) +++char * nextword (char *string, char **word) ++ { ++ char *word_start; ++ int idx; ++@@ -1138,9 +1111,7 @@ ++ ++ } ++ dict_type *root; ++-dict_type * ++-DEFUN(lookup_word,(word), ++- char *word) +++dict_type * lookup_word (char *word) ++ { ++ dict_type *ptr = root; ++ while (ptr) { ++@@ -1154,7 +1125,7 @@ ++ ++ } ++ ++-static void DEFUN_VOID(perform) +++static int perform (void) ++ { ++ tos = stack; ++ ++@@ -1192,9 +1163,7 @@ ++ } ++ } ++ ++-dict_type * ++-DEFUN(newentry,(word), ++- char *word) +++dict_type * newentry (char *word) ++ { ++ dict_type *new = (dict_type *)malloc(sizeof(dict_type)); ++ new->word = word; ++@@ -1208,10 +1177,7 @@ ++ } ++ ++ ++-unsigned int ++-DEFUN(add_to_definition,(entry, word), ++- dict_type *entry AND ++- stinst_type word) +++unsigned int add_to_definition (dict_type *entry, stinst_type word) ++ { ++ if (entry->code_end == entry->code_length) ++ { ++@@ -1232,9 +1198,7 @@ ++ ++ ++ void ++-DEFUN(add_intrinsic,(name, func), ++- char *name AND ++- void (*func)()) +++add_intrinsic (char *name, void (*func)(void)) ++ { ++ dict_type *new = newentry(name); ++ add_to_definition(new, func); ++@@ -1247,9 +1211,7 @@ ++ ++ } ++ ++-void ++-DEFUN(add_var,(name), ++- char *name) +++void add_var (char *name) ++ { ++ dict_type *new = newentry(name); ++ add_to_definition(new, push_number); ++@@ -1262,8 +1224,7 @@ ++ ++ ++ void ++-DEFUN(compile, (string), ++- char *string) +++compile (char *string) ++ ++ { ++ int jstack[STACK]; ++@@ -1315,11 +1276,11 @@ ++ /* Got a number, embedd the magic push number ++ function */ ++ add_to_definition(ptr, push_number); ++- add_to_definition(ptr, atol(word)); +++ add_to_definition(ptr, (stinst_type)atol(word)); ++ break; ++ default: ++ add_to_definition(ptr, call); ++- add_to_definition(ptr, lookup_word(word)); +++ add_to_definition(ptr, (stinst_type)lookup_word(word)); ++ } ++ ++ string = nextword(string, &word); ++@@ -1336,9 +1297,9 @@ ++ } ++ ++ ++-static void DEFUN_VOID(bang) +++static void bang (void) ++ { ++-*(int *)((isp[0])) = isp[-1]; +++*(uintptr_t *)((isp[0])) = isp[-1]; ++ isp-=2; ++ pc++; ++ ++@@ -1359,9 +1320,7 @@ ++ ++ ++ ++-static void DEFUN(read_in, (str, file), ++- string_type *str AND ++- FILE *file) +++static void read_in (string_type *str, FILE *file) ++ { ++ char buff[10000]; ++ unsigned int r; ++@@ -1378,15 +1337,13 @@ ++ } ++ ++ ++-static void DEFUN_VOID(usage) +++static void usage (void) ++ { ++ fprintf(stderr,"usage: -[d|i|g] file\n"); ++ exit(33); ++ } ++ ++-int DEFUN(main,(ac,av), ++-int ac AND ++-char *av[]) +++int main (int ac, char *av[]) ++ { ++ unsigned int i; ++ diff --git a/xen.gcc14.fixes.patch b/xen.gcc14.fixes.patch new file mode 100644 index 0000000..cc27089 --- /dev/null +++ b/xen.gcc14.fixes.patch @@ -0,0 +1,24 @@ +Work around newlib build problems with gcc14 + +--- xen-4.18.0/stubdom/Makefile.orig 2024-01-15 20:35:36.941740548 +0000 ++++ xen-4.18.0/stubdom/Makefile 2024-01-29 22:29:29.067367523 +0000 +@@ -45,6 +45,7 @@ + NEWLIB_CFLAGS+=-D_I386MACH_ALLOW_HW_INTERRUPTS + STUBDOM_SUPPORTED=1 + endif ++NEWLIB_CFLAGS+=-Wno-error=implicit-function-declaration + + CROSS_ROOT=cross-root-$(GNU_TARGET_ARCH) + CROSS_PREFIX=$(CURDIR)/$(CROSS_ROOT) +--- xen-4.18.0/extras/mini-os/include/posix/sys/mman.h.orig 2022-07-04 09:52:38.000000000 +0100 ++++ xen-4.18.0/extras/mini-os/include/posix/sys/mman.h 2024-02-01 23:00:19.923263409 +0000 +@@ -16,7 +16,7 @@ + + void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) asm("mmap64"); + int munmap(void *start, size_t length); +-static inline mlock(const void *addr, size_t len) { return 0; } +-static inline munlock(const void *addr, size_t len) { return 0; } ++static inline int mlock(const void *addr, size_t len) { return 0; } ++static inline int munlock(const void *addr, size_t len) { return 0; } + + #endif /* _POSIX_SYS_MMAN_H */ diff --git a/xen.spec b/xen.spec index 380064a..350fd29 100644 --- a/xen.spec +++ b/xen.spec @@ -55,7 +55,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 4.18.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2+ and LGPLv2+ and BSD URL: http://xen.org/ Source0: https://downloads.xenproject.org/release/xen/%{version}/xen-%{version}.tar.gz @@ -113,6 +113,8 @@ Patch47: xen.gcc13.fixes.patch Patch49: xen.python3.12.patch Patch50: xen.ocaml5.fixes.patch Patch51: xsa447.patch +Patch52: xen.gcc14.fixes.patch +Patch53: newlib.gcc14.fixes.patch %if %build_qemutrad @@ -127,9 +129,9 @@ BuildRequires: dev86 %endif BuildRequires: python3-devel ncurses-devel python3-setuptools BuildRequires: perl-interpreter perl-generators -%ifarch %{ix86} x86_64 +%ifarch x86_64 # so that x86_64 builds pick up glibc32 correctly -BuildRequires: /usr/include/gnu/stubs-32.h +BuildRequires: glibc32 %endif BuildRequires: gettext BuildRequires: gnutls-devel @@ -330,6 +332,8 @@ manage Xen virtual machines. %patch 50 -p1 %endif %patch 51 -p1 +%patch 52 -p1 +%patch 53 -p1 # qemu-xen-traditional patches pushd tools/qemu-xen-traditional @@ -936,6 +940,9 @@ fi %endif %changelog +* Sat Feb 03 2024 Michael Young - 4.18.0-4 +- build fixes for gcc14, replace stubs-32.h requirement with glibc32 + * Sat Jan 27 2024 Fedora Release Engineering - 4.18.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild