summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Baryshkov <dmitry.baryshkov@linaro.org>2024-06-04 01:50:44 +0300
committerKhem Raj <raj.khem@gmail.com>2024-06-04 23:49:47 -0700
commit868ca4d3a7d3ff29b87b6e9f11abc8d3099e9d61 (patch)
treee91a7227f90fbf31cbf54ae641c9f33e3180f63e
parent91054de77789f65415bdafa023a2f4ff3edb56eb (diff)
downloadmeta-openembedded-868ca4d3a7d3ff29b87b6e9f11abc8d3099e9d61.tar.gz
dhrystone: fix building with the GCC 14
Update dhrystone sources to use C89 instead of K&R C in order to fix build issues with the recent GCC. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone-c89.patch242
-rw-r--r--meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb4
2 files changed, 245 insertions, 1 deletions
diff --git a/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone-c89.patch b/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone-c89.patch
new file mode 100644
index 000000000..faf710fe1
--- /dev/null
+++ b/meta-oe/recipes-benchmark/dhrystone/dhrystone-2.1/dhrystone-c89.patch
@@ -0,0 +1,242 @@
1dhrystone: make it speak C89
2
3Update Dhrystone sources to stop using K&R C and use something close to C89.
4This fixes compilation errors reported by the GCC 14.
5
6Upstream-Status: Pending
7Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
8
9Index: dhrystone-2.1/dhry.h
10===================================================================
11--- dhrystone-2.1.orig/dhry.h
12+++ dhrystone-2.1/dhry.h
13@@ -423,3 +423,13 @@ typedef struct record
14 #ifndef HZ
15 extern long HZ;
16 #endif
17+
18+void Proc_2 (One_Fifty *Int_Par_Ref);
19+void Proc_3 (Rec_Pointer *Ptr_Ref_Par);
20+void Proc_4();
21+void Proc_5();
22+void Proc_6 (Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par);
23+void Proc_7 (One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val, One_Fifty *Int_Par_Ref);
24+void Proc_8 (Arr_1_Dim Arr_1_Par_Ref, Arr_2_Dim Arr_2_Par_Ref, int Int_1_Par_Val, int Int_2_Par_Val);
25+
26+Boolean Func_2 (Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref);
27Index: dhrystone-2.1/dhry_1.c
28===================================================================
29--- dhrystone-2.1.orig/dhry_1.c
30+++ dhrystone-2.1/dhry_1.c
31@@ -14,6 +14,8 @@
32 *
33 ****************************************************************************
34 */
35+#include <stdlib.h>
36+#include <string.h>
37
38 #include "dhry.h"
39
40@@ -28,7 +30,6 @@ char Ch_1_Glob,
41 int Arr_1_Glob [50];
42 int Arr_2_Glob [50] [50];
43
44-extern char *malloc ();
45 Enumeration Func_1 ();
46 /* forward declaration necessary since Enumeration may not simply be int */
47
48@@ -41,6 +42,8 @@ Enumeration Func_1 ();
49 Boolean Reg = true;
50 #endif
51
52+void Proc_1 (REG Rec_Pointer Ptr_Val_Par);
53+
54 /* variables for time measurement: */
55
56 #ifdef TIMES
57@@ -70,7 +73,7 @@ float Microseconds,
58 /* end of variables for time measurement */
59
60
61-main ()
62+int main (void)
63 /*****/
64
65 /* main program, corresponds to procedures */
66@@ -218,7 +221,7 @@ main ()
67 printf ("Arr_2_Glob[8][7]: %d\n", Arr_2_Glob[8][7]);
68 printf (" should be: Number_Of_Runs + 10\n");
69 printf ("Ptr_Glob->\n");
70- printf (" Ptr_Comp: %d\n", (int) Ptr_Glob->Ptr_Comp);
71+ printf (" Ptr_Comp: %lu\n", (unsigned long) Ptr_Glob->Ptr_Comp);
72 printf (" should be: (implementation-dependent)\n");
73 printf (" Discr: %d\n", Ptr_Glob->Discr);
74 printf (" should be: %d\n", 0);
75@@ -229,7 +232,7 @@ main ()
76 printf (" Str_Comp: %s\n", Ptr_Glob->variant.var_1.Str_Comp);
77 printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
78 printf ("Next_Ptr_Glob->\n");
79- printf (" Ptr_Comp: %d\n", (int) Next_Ptr_Glob->Ptr_Comp);
80+ printf (" Ptr_Comp: %lu\n", (unsigned long) Next_Ptr_Glob->Ptr_Comp);
81 printf (" should be: (implementation-dependent), same as above\n");
82 printf (" Discr: %d\n", Next_Ptr_Glob->Discr);
83 printf (" should be: %d\n", 0);
84@@ -280,14 +283,13 @@ main ()
85 printf ("%6.1f \n", Dhrystones_Per_Second);
86 printf ("\n");
87 }
88-
89+ return 0;
90 }
91
92
93-Proc_1 (Ptr_Val_Par)
94+void Proc_1 (REG Rec_Pointer Ptr_Val_Par)
95 /******************/
96
97-REG Rec_Pointer Ptr_Val_Par;
98 /* executed once */
99 {
100 REG Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
101@@ -318,12 +320,10 @@ REG Rec_Pointer Ptr_Val_Par;
102 } /* Proc_1 */
103
104
105-Proc_2 (Int_Par_Ref)
106+void Proc_2 (One_Fifty *Int_Par_Ref)
107 /******************/
108 /* executed once */
109 /* *Int_Par_Ref == 1, becomes 4 */
110-
111-One_Fifty *Int_Par_Ref;
112 {
113 One_Fifty Int_Loc;
114 Enumeration Enum_Loc;
115@@ -341,13 +341,10 @@ One_Fifty *Int_Par_Ref;
116 } /* Proc_2 */
117
118
119-Proc_3 (Ptr_Ref_Par)
120+void Proc_3 (Rec_Pointer *Ptr_Ref_Par)
121 /******************/
122 /* executed once */
123 /* Ptr_Ref_Par becomes Ptr_Glob */
124-
125-Rec_Pointer *Ptr_Ref_Par;
126-
127 {
128 if (Ptr_Glob != Null)
129 /* then, executed */
130@@ -356,7 +353,7 @@ Rec_Pointer *Ptr_Ref_Par;
131 } /* Proc_3 */
132
133
134-Proc_4 () /* without parameters */
135+void Proc_4 () /* without parameters */
136 /*******/
137 /* executed once */
138 {
139@@ -368,7 +365,7 @@ Proc_4 () /* without parameters */
140 } /* Proc_4 */
141
142
143-Proc_5 () /* without parameters */
144+void Proc_5 () /* without parameters */
145 /*******/
146 /* executed once */
147 {
148Index: dhrystone-2.1/dhry_2.c
149===================================================================
150--- dhrystone-2.1.orig/dhry_2.c
151+++ dhrystone-2.1/dhry_2.c
152@@ -14,6 +14,7 @@
153 *
154 ****************************************************************************
155 */
156+#include <string.h>
157
158 #include "dhry.h"
159
160@@ -26,14 +27,14 @@
161 extern int Int_Glob;
162 extern char Ch_1_Glob;
163
164+Boolean Func_3 (Enumeration Enum_Par_Val);
165
166-Proc_6 (Enum_Val_Par, Enum_Ref_Par)
167+
168+void Proc_6 (Enumeration Enum_Val_Par, Enumeration *Enum_Ref_Par)
169 /*********************************/
170 /* executed once */
171 /* Enum_Val_Par == Ident_3, Enum_Ref_Par becomes Ident_2 */
172
173-Enumeration Enum_Val_Par;
174-Enumeration *Enum_Ref_Par;
175 {
176 *Enum_Ref_Par = Enum_Val_Par;
177 if (! Func_3 (Enum_Val_Par))
178@@ -61,7 +62,7 @@ Enumeration *Enum_Ref_Par;
179 } /* Proc_6 */
180
181
182-Proc_7 (Int_1_Par_Val, Int_2_Par_Val, Int_Par_Ref)
183+void Proc_7 (One_Fifty Int_1_Par_Val, One_Fifty Int_2_Par_Val, One_Fifty *Int_Par_Ref)
184 /**********************************************/
185 /* executed three times */
186 /* first call: Int_1_Par_Val == 2, Int_2_Par_Val == 3, */
187@@ -70,9 +71,6 @@ Proc_7 (Int_1_Par_Val, Int_2_Par_Val, In
188 /* Int_Par_Ref becomes 17 */
189 /* third call: Int_1_Par_Val == 6, Int_2_Par_Val == 10, */
190 /* Int_Par_Ref becomes 18 */
191-One_Fifty Int_1_Par_Val;
192-One_Fifty Int_2_Par_Val;
193-One_Fifty *Int_Par_Ref;
194 {
195 One_Fifty Int_Loc;
196
197@@ -81,15 +79,11 @@ One_Fifty *Int_Par_Ref;
198 } /* Proc_7 */
199
200
201-Proc_8 (Arr_1_Par_Ref, Arr_2_Par_Ref, Int_1_Par_Val, Int_2_Par_Val)
202+void Proc_8 (Arr_1_Dim Arr_1_Par_Ref, Arr_2_Dim Arr_2_Par_Ref, int Int_1_Par_Val, int Int_2_Par_Val)
203 /*********************************************************************/
204 /* executed once */
205 /* Int_Par_Val_1 == 3 */
206 /* Int_Par_Val_2 == 7 */
207-Arr_1_Dim Arr_1_Par_Ref;
208-Arr_2_Dim Arr_2_Par_Ref;
209-int Int_1_Par_Val;
210-int Int_2_Par_Val;
211 {
212 REG One_Fifty Int_Index;
213 REG One_Fifty Int_Loc;
214@@ -132,14 +126,11 @@ Capital_Letter Ch_2_Par_Val;
215 } /* Func_1 */
216
217
218-Boolean Func_2 (Str_1_Par_Ref, Str_2_Par_Ref)
219+Boolean Func_2 (Str_30 Str_1_Par_Ref, Str_30 Str_2_Par_Ref)
220 /*************************************************/
221 /* executed once */
222 /* Str_1_Par_Ref == "DHRYSTONE PROGRAM, 1'ST STRING" */
223 /* Str_2_Par_Ref == "DHRYSTONE PROGRAM, 2'ND STRING" */
224-
225-Str_30 Str_1_Par_Ref;
226-Str_30 Str_2_Par_Ref;
227 {
228 REG One_Thirty Int_Loc;
229 Capital_Letter Ch_Loc;
230@@ -174,11 +165,10 @@ Str_30 Str_2_Par_Ref;
231 } /* Func_2 */
232
233
234-Boolean Func_3 (Enum_Par_Val)
235+Boolean Func_3 (Enumeration Enum_Par_Val)
236 /***************************/
237 /* executed once */
238 /* Enum_Par_Val == Ident_3 */
239-Enumeration Enum_Par_Val;
240 {
241 Enumeration Enum_Loc;
242
diff --git a/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb b/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb
index d809a564e..5d27acbdc 100644
--- a/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb
+++ b/meta-oe/recipes-benchmark/dhrystone/dhrystone_2.1.bb
@@ -3,7 +3,9 @@ LICENSE = "PD"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/PD;md5=b3597d12946881e13cb3b548d1173851" 3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/PD;md5=b3597d12946881e13cb3b548d1173851"
4 4
5SRC_URI = "http://www.netlib.org/benchmark/dhry-c;downloadfilename=dhry-c.shar \ 5SRC_URI = "http://www.netlib.org/benchmark/dhry-c;downloadfilename=dhry-c.shar \
6 file://dhrystone.patch" 6 file://dhrystone.patch \
7 file://dhrystone-c89.patch \
8"
7SRC_URI[md5sum] = "75aa5909c174eed98c134be2f56307da" 9SRC_URI[md5sum] = "75aa5909c174eed98c134be2f56307da"
8SRC_URI[sha256sum] = "038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e" 10SRC_URI[sha256sum] = "038a7e9169787125c3451a6c941f3aca5db2d2f3863871afcdce154ef17f4e3e"
9 11