diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-03-16 15:21:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-17 17:09:22 +0000 |
commit | c140e7c4dba2ba860542887e84e7f8499fcef800 (patch) | |
tree | e2b2fbc4793fa39bc26a7ae5baff0130f8cf3f4b /meta/recipes-support/gmp/gmp | |
parent | 0f1c2f7cc56b244ba31ed94f9bcb9d4cf8d540ff (diff) | |
download | poky-c140e7c4dba2ba860542887e84e7f8499fcef800.tar.gz |
gmp: Fix build with older gcc versions
The fix to make this work with GCC15/C23 caused problems with older gcc versions.
Add a fix for that.
(From OE-Core rev: 08fce47470c629cbdd85a5ad486bc79b05afa44b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/gmp/gmp')
-rw-r--r-- | meta/recipes-support/gmp/gmp/0001-acinclude.m4-Add-parameter-names-in-prototype-for-g.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-support/gmp/gmp/0001-acinclude.m4-Add-parameter-names-in-prototype-for-g.patch b/meta/recipes-support/gmp/gmp/0001-acinclude.m4-Add-parameter-names-in-prototype-for-g.patch new file mode 100644 index 0000000000..ae2411fd1b --- /dev/null +++ b/meta/recipes-support/gmp/gmp/0001-acinclude.m4-Add-parameter-names-in-prototype-for-g.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 1744e433a16fb39a55c4c771b8ecb02246aa5b99 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 15 Mar 2025 09:40:06 -0700 | ||
4 | Subject: [PATCH] acinclude.m4: Add parameter names in prototype for g(). | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | This allows it to compile with older gcc e.g. gcc-10 | ||
10 | which does not have allow parameter name omission, it results | ||
11 | in | ||
12 | |||
13 | a.c: In function āgā: | ||
14 | a.c:3:8: error: parameter name omitted | ||
15 | 3 | void g(int,t1 const*,t1,t2,t1 const*,int){} | ||
16 | | ^~~ | ||
17 | |||
18 | this was added to gcc via [1] thats why it is supported in | ||
19 | newer gcc. | ||
20 | |||
21 | Adding the parameter names make it compatible with | ||
22 | old and new gcc | ||
23 | |||
24 | [1] https://gcc.gnu.org/pipermail/gcc-cvs/2020-October/336068.html | ||
25 | |||
26 | Upstream-Status: Submitted [https://gmplib.org/list-archives/gmp-devel/2025-March/006294.html] | ||
27 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
28 | --- | ||
29 | ChangeLog | ||
30 | |||
31 | 2025-03-15 Khem Raj <raj.khem@gmail.com> | ||
32 | |||
33 | * acinclude.m4: Add parameter names to function prototype. | ||
34 | |||
35 | acinclude.m4 | 2 +- | ||
36 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
37 | |||
38 | diff --git a/acinclude.m4 b/acinclude.m4 | ||
39 | index 4fca12de2..b9d1eacfe 100644 | ||
40 | --- a/acinclude.m4 | ||
41 | +++ b/acinclude.m4 | ||
42 | @@ -609,7 +609,7 @@ GMP_PROG_CC_WORKS_PART([$1], [long long reliability test 1], | ||
43 | |||
44 | #if defined (__GNUC__) && ! defined (__cplusplus) | ||
45 | typedef unsigned long long t1;typedef t1*t2; | ||
46 | -void g(int,t1 const*,t1,t2,t1 const*,int){} | ||
47 | +void g(int a,t1 const* b,t1 c,t2 d,t1 const* e,int f){} | ||
48 | void h(){} | ||
49 | static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0) | ||
50 | {t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;} | ||