]> git.pld-linux.org Git - packages/xen.git/blob - gcc10.patch
0a5c5465c2d979a73acaf19c05df610c95aba0f7
[packages/xen.git] / gcc10.patch
1 --- xen-4.13.0/tools/xenstore/utils.h.orig      2019-12-17 14:23:09.000000000 +0000
2 +++ xen-4.13.0/tools/xenstore/utils.h   2020-01-21 21:13:05.108957447 +0000
3 @@ -24,7 +24,7 @@
4  void barf(const char *fmt, ...) __attribute__((noreturn));
5  void barf_perror(const char *fmt, ...) __attribute__((noreturn));
6  
7 -void (*xprintf)(const char *fmt, ...);
8 +extern void (*xprintf)(const char *fmt, ...);
9  
10  #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_args)
11  
12 --- xen-4.13.0/tools/xenstore/xenstored_core.h.orig     2020-01-21 21:15:19.243931307 +0000
13 +++ xen-4.13.0/tools/xenstore/xenstored_core.h  2020-01-21 21:38:35.340617819 +0000
14 @@ -204,7 +204,7 @@
15  /* Open a pipe for signal handling */
16  void init_pipe(int reopen_log_pipe[2]);
17  
18 -xengnttab_handle **xgt_handle;
19 +extern xengnttab_handle **xgt_handle;
20  
21  int remember_string(struct hashtable *hash, const char *str);
22  
23 --- xen-4.13.0/tools/libxl/libxlu_pci.c.orig    2019-12-17 14:23:09.000000000 +0000
24 +++ xen-4.13.0/tools/libxl/libxlu_pci.c 2020-01-21 21:56:26.812212916 +0000
25 @@ -48,7 +48,7 @@
26  int xlu_pci_parse_bdf(XLU_Config *cfg, libxl_device_pci *pcidev, const char *str)
27  {
28      unsigned state = STATE_DOMAIN;
29 -    unsigned dom, bus, dev, func, vslot = 0;
30 +    unsigned dom = 0, bus = 0, dev = 0, func = 0, vslot = 0;
31      char *buf2, *tok, *ptr, *end, *optkey = NULL;
32  
33      if ( NULL == (buf2 = ptr = strdup(str)) )
34 --- xen-4.13.0/tools/libxl/libxl_utils.c.orig   2019-12-17 14:23:09.000000000 +0000
35 +++ xen-4.13.0/tools/libxl/libxl_utils.c        2020-01-21 22:34:52.096300774 +0000
36 @@ -1259,7 +1259,7 @@
37      }
38      memset(un, 0, sizeof(struct sockaddr_un));
39      un->sun_family = AF_UNIX;
40 -    strncpy(un->sun_path, path, sizeof(un->sun_path));
41 +    strncpy(un->sun_path, path, sizeof(un->sun_path)-1);
42      return 0;
43  }
44  
45 --- xen-4.13.0/tools/debugger/kdd/kdd.h.orig    2019-12-17 14:23:09.000000000 +0000
46 +++ xen-4.13.0/tools/debugger/kdd/kdd.h 2020-01-21 23:35:55.458605582 +0000
47 @@ -323,7 +323,7 @@
48          kdd_msg msg;
49          kdd_reg reg;
50          kdd_stc stc;
51 -        uint8_t payload[0];
52 +        uint8_t payload[65535];
53      };
54  } PACKED kdd_pkt;
55  
56 --- xen-4.13.0/tools/xenpmd/Makefile.orig       2019-12-17 14:23:09.000000000 +0000
57 +++ xen-4.13.0/tools/xenpmd/Makefile    2020-01-22 22:13:16.564873608 +0000
58 @@ -3,6 +3,7 @@
59  
60  CFLAGS += -Werror
61  CFLAGS += $(CFLAGS_libxenstore)
62 +CFLAGS += -Wno-error=format-truncation
63  
64  LDLIBS += $(LDLIBS_libxenstore)
65  
66 --- xen-4.13.1/tools/firmware/etherboot/Config~ 2020-05-14 14:19:32.000000000 +0200
67 +++ xen-4.13.1/tools/firmware/etherboot/Config  2020-06-07 17:14:49.704183136 +0200
68 @@ -7,3 +7,5 @@
69  
70  CFLAGS += -UCONSOLE_SERIAL
71  CFLAGS += -DCONSOLE_SERIAL=1
72 +
73 +CFLAGS += -Wno-error=array-bounds -Wno-error=enum-conversion
74 --- xen-4.13.1/stubdom/Makefile~        2020-06-07 17:54:17.000000000 +0200
75 +++ xen-4.13.1/stubdom/Makefile 2020-06-07 17:57:37.373200925 +0200
76 @@ -232,6 +232,7 @@
77         patch -d $@ -p1 < vtpm-cmake-Wextra.patch
78         patch -d $@ -p1 < vtpm-implicit-fallthrough.patch
79         patch -d $@ -p1 < vtpm_TPM_ChangeAuthAsymFinish.patch
80 +       patch -d $@ -p1 < vtpm-gcc10.patch
81         mkdir $@/build
82         cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
83         touch $@
84 --- xen-4.13.1/stubdom/vtpm-gcc10.patch~        2020-06-07 17:54:17.000000000 +0200
85 +++ xen-4.13.1/stubdom/vtpm-gcc10.patch 2020-06-07 17:57:37.373200925 +0200
86 @@ -0,0 +1,47 @@
87 +--- tpm_emulator-x86_64/tpm/tpm_emulator_extern.h~     2011-12-20 19:30:06.000000000 +0100
88 ++++ tpm_emulator-x86_64/tpm/tpm_emulator_extern.h      2020-06-07 17:52:04.278217629 +0200
89 +@@ -29,7 +29,7 @@
90 +   TPM_LOG_ERROR
91 + };
92
93 +-void (*tpm_log)(int priority, const char *fmt, ...);
94 ++extern void (*tpm_log)(int priority, const char *fmt, ...);
95
96 + #if defined(_WIN32) || defined(_WIN64)
97 + #define __BFILE__ ((strrchr(__FILE__, '\\') ? : __FILE__ - 1) + 1)
98 +@@ -44,27 +44,27 @@
99 + #define error(fmt, ...) tpm_log(TPM_LOG_ERROR, "%s:%d: Error: " fmt "\n", \
100 +                                 __BFILE__, __LINE__, ## __VA_ARGS__)
101 + /* initialization */
102 +-int (*tpm_extern_init)(void);
103 +-void (*tpm_extern_release)(void);
104 ++extern int (*tpm_extern_init)(void);
105 ++extern void (*tpm_extern_release)(void);
106
107 + /* memory allocation */
108
109 +-void* (*tpm_malloc)(size_t size);
110 ++extern void* (*tpm_malloc)(size_t size);
111
112 +-void (*tpm_free)(/*const*/ void *ptr);
113 ++extern void (*tpm_free)(/*const*/ void *ptr);
114
115 + /* random numbers */
116
117 +-void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
118 ++extern void (*tpm_get_extern_random_bytes)(void *buf, size_t nbytes);
119
120 + /* usec since last call */
121
122 +-uint64_t (*tpm_get_ticks)(void);
123 ++extern uint64_t (*tpm_get_ticks)(void);
124
125 + /* file handling */
126
127 +-int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
128 +-int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
129 ++extern int (*tpm_write_to_storage)(uint8_t *data, size_t data_length);
130 ++extern int (*tpm_read_from_storage)(uint8_t **data, size_t *data_length);
131
132 + #endif /* _TPM_EMULATOR_EXTERN_H_ */
133
134 --- xen-4.13.1/stubdom/vtpmmgr/vtpmmgr.h.orig   2020-06-07 18:20:43.261215712 +0200
135 +++ xen-4.13.1/stubdom/vtpmmgr/vtpmmgr.h        2020-06-07 18:20:56.731170041 +0200
136 @@ -50,11 +50,6 @@
137  #define RSA_KEY_SIZE 0x0800
138  #define RSA_CIPHER_SIZE (RSA_KEY_SIZE / 8)
139  
140 -enum {
141 -    TPM1_HARDWARE = 1,
142 -    TPM2_HARDWARE,
143 -} tpm_version;
144 -
145  struct tpm_hardware_version {
146      int hw_version;
147  };
148 --- xen-4.13.1/stubdom/vtpmmgr/vtpmmgr.c~       2020-05-14 14:19:32.000000000 +0200
149 +++ xen-4.13.1/stubdom/vtpmmgr/vtpmmgr.c        2020-06-07 18:23:14.950766928 +0200
150 @@ -45,6 +45,11 @@
151  #include "vtpmmgr.h"
152  #include "tcg.h"
153  
154 +enum {
155 +    TPM1_HARDWARE = 1,
156 +    TPM2_HARDWARE,
157 +} tpm_version;
158 +
159  struct tpm_hardware_version hardware_version = {
160      .hw_version = TPM1_HARDWARE,
161  };
This page took 0.115938 seconds and 2 git commands to generate.