summaryrefslogtreecommitdiff
path: root/meta-openembedded/meta-networking/recipes-daemons/vblade/files/gcc-10.patch
blob: 9a42aa3699be0cde60bcf8d1564b2c4461f035d8 (plain)
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
84
85
From af17efc862b9acfd63ce2ecb21f75ed890a93a5d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=C3=B6lbl?= <koelblandreas@freenet.de>
Date: Thu, 9 Jul 2020 14:29:18 +0200
Subject: [PATCH] Fix linkage of global identifiers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Align the code to the standard and modern compilers.

Upstream-Status: Submitted [https://github.com/OpenAoE/vblade/pull/15]
Signed-off-by: Andreas Kölbl <koelblandreas@freenet.de>
---
 dat.c    | 12 ++++++++++++
 dat.h    | 19 ++++++++++---------
 makefile |  7 +++++--
 3 files changed, 27 insertions(+), 11 deletions(-)
 create mode 100644 dat.c

--- /dev/null
+++ b/dat.c
@@ -0,0 +1,12 @@
+/* dat.c: Global memory for vblade AoE target */
+#include "dat.h"
+
+int	shelf, slot;
+ulong	aoetag;
+uchar	mac[6];
+int	bfd;		// block file descriptor
+int	sfd;		// socket file descriptor
+vlong	size;		// size of vblade
+vlong	offset;
+char	*progname;
+char	serial[Nserial+1];
--- a/dat.h
+++ b/dat.h
@@ -1,4 +1,5 @@
 /* dat.h: include file for vblade AoE target */
+#include <sys/types.h>
 
 #define	nil	((void *)0)
 /*
@@ -163,12 +164,12 @@ enum {
 	Nserial= 20,
 };
 
-int	shelf, slot;
-ulong	aoetag;
-uchar	mac[6];
-int	bfd;		// block file descriptor
-int	sfd;		// socket file descriptor
-vlong	size;		// size of vblade
-vlong	offset;
-char	*progname;
-char	serial[Nserial+1];
+extern int	shelf, slot;
+extern ulong	aoetag;
+extern uchar	mac[6];
+extern int	bfd;		// block file descriptor
+extern int	sfd;		// socket file descriptor
+extern vlong	size;		// size of vblade
+extern vlong	offset;
+extern char	*progname;
+extern char	serial[Nserial+1];
--- a/makefile
+++ b/makefile
@@ -8,7 +8,7 @@ sbindir = ${prefix}/sbin
 sharedir = ${prefix}/share
 mandir = ${sharedir}/man
 
-O=aoe.o bpf.o ${PLATFORM}.o ata.o
+O=aoe.o bpf.o ${PLATFORM}.o ata.o dat.o
 
 vblade: $O
 	${CC} ${LDFLAGS} -o vblade $O
@@ -25,6 +25,9 @@ ata.o : ata.c config.h dat.h fns.h makef
 bpf.o : bpf.c
 	${CC} ${CFLAGS} -c $<
 
+dat.o : dat.c
+	${CC} ${CFLAGS} -c $<
+
 config.h : config/config.h.in makefile
 	@if ${CC} ${CFLAGS} config/u64.c > /dev/null 2>&1; then \
 	  sh -xc "cp config/config.h.in config.h"; \