diff options
-rw-r--r-- | meta-oe/recipes-benchmark/lmbench/lmbench/0001-Fix-build-errors-related-to-incorrect-function-param.patch | 252 | ||||
-rw-r--r-- | meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb | 1 |
2 files changed, 253 insertions, 0 deletions
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Fix-build-errors-related-to-incorrect-function-param.patch b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Fix-build-errors-related-to-incorrect-function-param.patch new file mode 100644 index 0000000000..30f52023cd --- /dev/null +++ b/meta-oe/recipes-benchmark/lmbench/lmbench/0001-Fix-build-errors-related-to-incorrect-function-param.patch | |||
@@ -0,0 +1,252 @@ | |||
1 | From 8a6b5f649fe7f42aff4f69a8d99c522adb22f54c Mon Sep 17 00:00:00 2001 | ||
2 | From: "mark.yang" <mark.yang@lge.com> | ||
3 | Date: Thu, 10 Apr 2025 13:19:07 +0900 | ||
4 | Subject: [PATCH] Fix build errors related to incorrect function parameters in | ||
5 | gcc-15 | ||
6 | |||
7 | * see more details | ||
8 | http://errors.yoctoproject.org/Errors/Details/851798/ | ||
9 | |||
10 | lat_rpc.c:172:1: error: conflicting types for 'client_rpc_xact_1'; have 'char *(char *, CLIENT *)' {aka 'char *(char *, struct __rpc_client *)'} | ||
11 | 172 | client_rpc_xact_1(char *argp, CLIENT *clnt) | ||
12 | | ^~~~~~~~~~~~~~~~~ | ||
13 | bench.h:349:14: note: previous declaration of 'client_rpc_xact_1' with type 'char *(void)' | ||
14 | 349 | extern char *client_rpc_xact_1(); | ||
15 | | ^~~~~~~~~~~~~~~~~ | ||
16 | lat_rpc.c: In function 'rpc_xact_1': | ||
17 | lat_rpc.c:189:1: warning: old-style function definition [-Wold-style-definition] | ||
18 | 189 | rpc_xact_1(msg, transp) | ||
19 | | ^~~~~~~~~~ | ||
20 | lat_rpc.c:192:1: error: number of arguments doesn't match prototype | ||
21 | 192 | { | ||
22 | | ^ | ||
23 | bench.h:348:14: error: prototype declaration | ||
24 | 348 | extern char *rpc_xact_1(); | ||
25 | | ^~~~~~~~~~ | ||
26 | |||
27 | Fix errors due to old-style function declarations | ||
28 | |||
29 | The code was using old-style function declarations without proper prototypes, | ||
30 | which causes compilation errors with newer GCC versions. This patch updates | ||
31 | the function declarations to use modern C syntax with proper parameter types. | ||
32 | |||
33 | Upstream-Status: Submitted [https://sourceforge.net/p/lmbench/patches/3] | ||
34 | Signed-off-by: mark.yang <mark.yang@lge.com> | ||
35 | --- | ||
36 | src/bench.h | 4 ++-- | ||
37 | src/lat_rpc.c | 24 ++++++++++-------------- | ||
38 | src/lat_udp.c | 4 ++-- | ||
39 | src/lmdd.c | 18 +++++++++--------- | ||
40 | src/lmhttp.c | 4 ++-- | ||
41 | 5 files changed, 25 insertions(+), 29 deletions(-) | ||
42 | |||
43 | diff --git a/src/bench.h b/src/bench.h | ||
44 | index 1768ef7..4fc2822 100644 | ||
45 | --- a/src/bench.h | ||
46 | +++ b/src/bench.h | ||
47 | @@ -345,7 +345,7 @@ extern int sched_pin(int cpu); | ||
48 | #define XACT_VERS ((u_long)1) | ||
49 | #define RPC_XACT ((u_long)1) | ||
50 | #define RPC_EXIT ((u_long)2) | ||
51 | -extern char *rpc_xact_1(); | ||
52 | -extern char *client_rpc_xact_1(); | ||
53 | +extern char *rpc_xact_1(char *msg, struct svc_req *rqstp); | ||
54 | +extern char *client_rpc_xact_1(char *argp, CLIENT *clnt); | ||
55 | |||
56 | #endif /* _BENCH_H */ | ||
57 | diff --git a/src/lat_rpc.c b/src/lat_rpc.c | ||
58 | index 9c02192..e1450af 100644 | ||
59 | --- a/src/lat_rpc.c | ||
60 | +++ b/src/lat_rpc.c | ||
61 | @@ -185,17 +185,15 @@ client_rpc_xact_1(char *argp, CLIENT *clnt) | ||
62 | * The remote procedure[s] that will be called | ||
63 | */ | ||
64 | /* ARGSUSED */ | ||
65 | -char * | ||
66 | -rpc_xact_1(msg, transp) | ||
67 | - char *msg; | ||
68 | - register SVCXPRT *transp; | ||
69 | +char * | ||
70 | +rpc_xact_1(char *msg, struct svc_req *rqstp /* transp is unused */) | ||
71 | { | ||
72 | static char r = 123; | ||
73 | |||
74 | return &r; | ||
75 | } | ||
76 | |||
77 | -static void xact_prog_1(); | ||
78 | +static void xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp); | ||
79 | |||
80 | void | ||
81 | server_main() | ||
82 | @@ -233,16 +231,14 @@ server_main() | ||
83 | } | ||
84 | |||
85 | static void | ||
86 | -xact_prog_1(rqstp, transp) | ||
87 | - struct svc_req *rqstp; | ||
88 | - register SVCXPRT *transp; | ||
89 | +xact_prog_1(struct svc_req *rqstp, register SVCXPRT *transp) | ||
90 | { | ||
91 | union { | ||
92 | char rpc_xact_1_arg; | ||
93 | } argument; | ||
94 | char *result; | ||
95 | - bool_t (*xdr_argument)(), (*xdr_result)(); | ||
96 | - char *(*local)(); | ||
97 | + bool_t (*xdr_argument)(XDR *, void *), (*xdr_result)(XDR *, void *); | ||
98 | + char *(*local)(char *, struct svc_req *); | ||
99 | |||
100 | switch (rqstp->rq_proc) { | ||
101 | case NULLPROC: | ||
102 | @@ -250,9 +246,9 @@ xact_prog_1(rqstp, transp) | ||
103 | return; | ||
104 | |||
105 | case RPC_XACT: | ||
106 | - xdr_argument = xdr_char; | ||
107 | - xdr_result = xdr_char; | ||
108 | - local = (char *(*)()) rpc_xact_1; | ||
109 | + xdr_argument = (bool_t (*)(XDR *, void *))xdr_char; | ||
110 | + xdr_result = (bool_t (*)(XDR *, void *))xdr_char; | ||
111 | + local = rpc_xact_1; | ||
112 | break; | ||
113 | |||
114 | case RPC_EXIT: | ||
115 | @@ -269,7 +265,7 @@ xact_prog_1(rqstp, transp) | ||
116 | svcerr_decode(transp); | ||
117 | return; | ||
118 | } | ||
119 | - result = (*local)(&argument, rqstp); | ||
120 | + result = local(&argument.rpc_xact_1_arg, rqstp); | ||
121 | if (result != NULL && !svc_sendreply(transp, (xdrproc_t)xdr_result, result)) { | ||
122 | svcerr_systemerr(transp); | ||
123 | } | ||
124 | diff --git a/src/lat_udp.c b/src/lat_udp.c | ||
125 | index cdd2e9b..292d5c4 100644 | ||
126 | --- a/src/lat_udp.c | ||
127 | +++ b/src/lat_udp.c | ||
128 | @@ -19,7 +19,7 @@ char *id = "$Id$\n"; | ||
129 | |||
130 | void client_main(int ac, char **av); | ||
131 | void server_main(); | ||
132 | -void timeout(); | ||
133 | +void timeout(int sig); | ||
134 | void init(iter_t iterations, void* cookie); | ||
135 | void cleanup(iter_t iterations, void* cookie); | ||
136 | void doit(iter_t iterations, void* cookie); | ||
137 | @@ -164,7 +164,7 @@ cleanup(iter_t iterations, void* cookie) | ||
138 | } | ||
139 | |||
140 | void | ||
141 | -timeout() | ||
142 | +timeout(__attribute__((unused)) int sig) | ||
143 | { | ||
144 | fprintf(stderr, "Recv timed out\n"); | ||
145 | exit(1); | ||
146 | diff --git a/src/lmdd.c b/src/lmdd.c | ||
147 | index dee37b4..da64b04 100644 | ||
148 | --- a/src/lmdd.c | ||
149 | +++ b/src/lmdd.c | ||
150 | @@ -76,7 +76,7 @@ int norepeats = -1; | ||
151 | bds_msg *m1, *m2; | ||
152 | #endif | ||
153 | |||
154 | -uint64 getarg(); | ||
155 | +uint64 getarg(char *s, int ac, char **av); | ||
156 | int been_there(uint64 off); | ||
157 | int getfile(char *s, int ac, char **av); | ||
158 | |||
159 | @@ -148,7 +148,7 @@ char *cmds[] = { | ||
160 | |||
161 | |||
162 | void error(char *); | ||
163 | -void done(); | ||
164 | +void done(int sig); | ||
165 | #ifdef DBG | ||
166 | extern int dbg; | ||
167 | #endif | ||
168 | @@ -162,7 +162,7 @@ main(int ac, char **av) | ||
169 | int Fork, misses, mismatch, outpat, inpat, in, timeopen, gotcnt; | ||
170 | int slp; | ||
171 | uint64 skip, size, count; | ||
172 | - void chkarg(); | ||
173 | + void chkarg(char *arg); | ||
174 | int i; | ||
175 | uint64 off = 0; | ||
176 | int touch; | ||
177 | @@ -332,7 +332,7 @@ main(int ac, char **av) | ||
178 | register int moved; | ||
179 | |||
180 | if (gotcnt && count-- <= 0) { | ||
181 | - done(); | ||
182 | + done(0); | ||
183 | } | ||
184 | |||
185 | /* | ||
186 | @@ -445,7 +445,7 @@ main(int ac, char **av) | ||
187 | perror("read"); | ||
188 | } | ||
189 | if (moved <= 0) { | ||
190 | - done(); | ||
191 | + done(0); | ||
192 | } | ||
193 | if (inpat != -1) { | ||
194 | register int foo, cnt; | ||
195 | @@ -458,7 +458,7 @@ main(int ac, char **av) | ||
196 | (uint)(off + foo*sizeof(int)), | ||
197 | buf[foo]); | ||
198 | if (mismatch != -1 && --misses == 0) { | ||
199 | - done(); | ||
200 | + done(0); | ||
201 | } | ||
202 | } | ||
203 | } | ||
204 | @@ -523,7 +523,7 @@ main(int ac, char **av) | ||
205 | if (moved2 != moved) { | ||
206 | fprintf(stderr, "write: wanted=%d got=%d\n", | ||
207 | moved, moved2); | ||
208 | - done(); | ||
209 | + done(0); | ||
210 | } | ||
211 | if ((Wtmax != -1) || (Wtmin != -1)) { | ||
212 | int mics = stop(&start_tv, &stop_tv); | ||
213 | @@ -560,7 +560,7 @@ main(int ac, char **av) | ||
214 | perror("write"); | ||
215 | } | ||
216 | if (moved2 != moved) { | ||
217 | - done(); | ||
218 | + done(0); | ||
219 | } | ||
220 | |||
221 | if (touch) { | ||
222 | @@ -626,7 +626,7 @@ chkarg(char *arg) | ||
223 | } | ||
224 | |||
225 | void | ||
226 | -done(void) | ||
227 | +done(__attribute__((unused)) int sig) | ||
228 | { | ||
229 | int i; | ||
230 | int step; | ||
231 | diff --git a/src/lmhttp.c b/src/lmhttp.c | ||
232 | index 41d9949..c2f3cb9 100644 | ||
233 | --- a/src/lmhttp.c | ||
234 | +++ b/src/lmhttp.c | ||
235 | @@ -26,7 +26,7 @@ char *buf; | ||
236 | char *bufs[3]; | ||
237 | int Dflg, dflg, nflg, lflg, fflg, zflg; | ||
238 | int data, logfile; | ||
239 | -void die(); | ||
240 | +void die(int sig); | ||
241 | void worker(); | ||
242 | char *http_time(void); | ||
243 | char *date(time_t *tt); | ||
244 | @@ -387,7 +387,7 @@ logit(int sock, char *name, int size) | ||
245 | nbytes += len; | ||
246 | } | ||
247 | |||
248 | -void die() | ||
249 | +void die(__attribute__((unused)) int sig) | ||
250 | { | ||
251 | if (nbytes) { | ||
252 | write(logfile, logbuf, nbytes); | ||
diff --git a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb index 2533f6033c..acd4d6decf 100644 --- a/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb +++ b/meta-oe/recipes-benchmark/lmbench/lmbench_3.0-a9.bb | |||
@@ -29,6 +29,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/lmbench/lmbench-${PV}.tgz \ | |||
29 | file://0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch \ | 29 | file://0001-doc-Fix-typos-in-lat_unix_connect-manual-page.patch \ |
30 | file://0001-bench.h-Fix-typo-in-specifying-string.h.patch \ | 30 | file://0001-bench.h-Fix-typo-in-specifying-string.h.patch \ |
31 | file://0001-scripts-build-Fix-the-tests-to-build-with-clang15.patch \ | 31 | file://0001-scripts-build-Fix-the-tests-to-build-with-clang15.patch \ |
32 | file://0001-Fix-build-errors-related-to-incorrect-function-param.patch \ | ||
32 | " | 33 | " |
33 | SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" | 34 | SRC_URI[sha256sum] = "cbd5777d15f44eab7666dcac418054c3c09df99826961a397d9acf43d8a2a551" |
34 | 35 | ||