summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support
diff options
context:
space:
mode:
authorAlexey Brodkin <alexey.brodkin@synopsys.com>2018-10-17 11:56:40 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-10-18 10:56:55 +0100
commite95caf1ebdfa29c9e1bc9c28ad0c47672c49fe99 (patch)
tree4c33da88d34e6f2bdac4124c9a41578f07340cd0 /meta/recipes-support
parentff74cc841a9eae31e435564db2d7acefb5d4340e (diff)
downloadpoky-e95caf1ebdfa29c9e1bc9c28ad0c47672c49fe99.tar.gz
libgpg-error: Add ARC support
(From OE-Core rev: 2d9dbcc638cc39b935b89b6e66ed216ea9b05d62) Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r--meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch298
-rw-r--r--meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch35
-rw-r--r--meta/recipes-support/libgpg-error/libgpg-error_1.32.bb9
3 files changed, 340 insertions, 2 deletions
diff --git a/meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch b/meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch
new file mode 100644
index 0000000000..03b0ce77ed
--- /dev/null
+++ b/meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch
@@ -0,0 +1,298 @@
1From d4fd6975671477721936060771aa4d7d07fb0910 Mon Sep 17 00:00:00 2001
2From: Werner Koch <wk@gnupg.org>
3Date: Tue, 18 Sep 2018 14:54:08 +0200
4Subject: [PATCH libgpg-error] syscfg: Support ARC CPUs and simplify aliasing
5 table.
6
7* src/mkheader.c (xmalloc): New.
8(xstrdup): Implement using xmalloc.
9(canon_host_triplet): Add supporr for arc CPU. Adjust alias table to
10also alias *-pc-*. Rename ibm to unknown. Add internal arg. Add
11unknown vendor hack.
12(main): New mode to just print the canonicalized form.
13* src/Makefile.am (lock_obj_pub): s/-(pc|ibm)-/-unknown/. Also rename
14files accordingly.
15--
16
17config.sub does no real aliasing and thus we would need to add several
18vendors to the alising tables despite that this has no technical
19meanding. Instead we now replace the vendor with "unknown" for the
204-part-"triplets". This change will make maintenace easier.
21
22Signed-off-by: Werner Koch <wk@gnupg.org>
23
24Upstream-Status: Backport [ http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commit;h=48c8f8ddfc80 ]
25---
26 src/Makefile.am | 16 ++--
27 src/mkheader.c | 92 ++++++++++++++++---
28 ...-gnu.h => lock-obj-pub.i686-unknown-gnu.h} | 0
29 ... lock-obj-pub.i686-unknown-kfreebsd-gnu.h} | 0
30 ... => lock-obj-pub.i686-unknown-linux-gnu.h} | 0
31 ...=> lock-obj-pub.s390x-unknown-linux-gnu.h} | 0
32 ...ock-obj-pub.x86_64-unknown-kfreebsd-gnu.h} | 0
33 ...> lock-obj-pub.x86_64-unknown-linux-gnu.h} | 0
34 ...ock-obj-pub.x86_64-unknown-linux-gnux32.h} | 0
35 ... lock-obj-pub.x86_64-unknown-linux-musl.h} | 0
36 10 files changed, 85 insertions(+), 23 deletions(-)
37 rename src/syscfg/{lock-obj-pub.i686-pc-gnu.h => lock-obj-pub.i686-unknown-gnu.h} (100%)
38 rename src/syscfg/{lock-obj-pub.i686-pc-kfreebsd-gnu.h => lock-obj-pub.i686-unknown-kfreebsd-gnu.h} (100%)
39 rename src/syscfg/{lock-obj-pub.i686-pc-linux-gnu.h => lock-obj-pub.i686-unknown-linux-gnu.h} (100%)
40 rename src/syscfg/{lock-obj-pub.s390x-ibm-linux-gnu.h => lock-obj-pub.s390x-unknown-linux-gnu.h} (100%)
41 rename src/syscfg/{lock-obj-pub.x86_64-pc-kfreebsd-gnu.h => lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h} (100%)
42 rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-gnu.h => lock-obj-pub.x86_64-unknown-linux-gnu.h} (100%)
43 rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-gnux32.h => lock-obj-pub.x86_64-unknown-linux-gnux32.h} (100%)
44 rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-musl.h => lock-obj-pub.x86_64-unknown-linux-musl.h} (100%)
45
46diff --git a/src/Makefile.am b/src/Makefile.am
47index 42998e46a3bc..8ec582ef99fb 100644
48--- a/src/Makefile.am
49+++ b/src/Makefile.am
50@@ -52,9 +52,9 @@ lock_obj_pub = \
51 syscfg/lock-obj-pub.arm-apple-darwin.h \
52 syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h \
53 syscfg/lock-obj-pub.i386-apple-darwin.h \
54- syscfg/lock-obj-pub.i686-pc-gnu.h \
55- syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h \
56- syscfg/lock-obj-pub.i686-pc-linux-gnu.h \
57+ syscfg/lock-obj-pub.i686-unknown-gnu.h \
58+ syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h \
59+ syscfg/lock-obj-pub.i686-unknown-linux-gnu.h \
60 syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h \
61 syscfg/lock-obj-pub.mips-unknown-linux-gnu.h \
62 syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \
63@@ -66,16 +66,16 @@ lock_obj_pub = \
64 syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \
65 syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h \
66 syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h \
67- syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h \
68+ syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h \
69 syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h \
70 syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h \
71 syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h \
72 syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h \
73 syscfg/lock-obj-pub.x86_64-apple-darwin.h \
74- syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h \
75- syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h \
76- syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h \
77- syscfg/lock-obj-pub.x86_64-pc-linux-musl.h \
78+ syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h \
79+ syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h \
80+ syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h \
81+ syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h \
82 syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h \
83 syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h \
84 syscfg/lock-obj-pub.mingw32.h
85diff --git a/src/mkheader.c b/src/mkheader.c
86index 2fc5fada66a4..7a38a1bec1a4 100644
87--- a/src/mkheader.c
88+++ b/src/mkheader.c
89@@ -51,17 +51,27 @@ xfree (void *a)
90
91
92 static char *
93-xstrdup (const char *string)
94+xmalloc (size_t n)
95 {
96 char *p;
97- size_t len = strlen (string) + 1;
98
99- p = malloc (len);
100+ p = malloc (n);
101 if (!p)
102 {
103 fputs (PGM ": out of core\n", stderr);
104 exit (1);
105 }
106+ return p;
107+}
108+
109+
110+static char *
111+xstrdup (const char *string)
112+{
113+ char *p;
114+ size_t len = strlen (string) + 1;
115+
116+ p = xmalloc (len);
117 memcpy (p, string, len);
118 return p;
119 }
120@@ -69,23 +79,31 @@ xstrdup (const char *string)
121
122 /* Return a malloced string with TRIPLET. If TRIPLET has an alias
123 return that instead. In general build-aux/config.sub should do the
124- aliasing but some returned triplets are anyway identical and thus we
125- use this function to map it to the canonical form. */
126+ aliasing but some returned triplets are anyway identical and thus
127+ we use this function to map it to the canonical form.
128+ NO_VENDOR_HACK is for internal use; caller must call with 0. */
129 static char *
130-canon_host_triplet (const char *triplet)
131+canon_host_triplet (const char *triplet, int no_vendor_hack)
132 {
133 struct {
134 const char *name;
135 const char *alias;
136 } tbl[] = {
137- {"i486-pc-linux-gnu", "i686-pc-linux-gnu" },
138+ {"i486-pc-linux-gnu", "i686-unknown-linux-gnu" },
139 {"i586-pc-linux-gnu" },
140- {"i486-pc-gnu", "i686-pc-gnu"},
141+ {"i686-pc-linux-gnu" },
142+ {"arc-oe-linux-uclibc" }, /* Other CPU but same struct. */
143+
144+ {"i486-pc-gnu", "i686-unknown-gnu"},
145 {"i586-pc-gnu"},
146- {"i486-pc-kfreebsd-gnu", "i686-pc-kfreebsd-gnu"},
147+ {"i686-pc-gnu"},
148+
149+ {"i486-pc-kfreebsd-gnu", "i686-unknown-kfreebsd-gnu"},
150 {"i586-pc-kfreebsd-gnu"},
151+ {"i686-pc-kfreebsd-gnu"},
152
153- {"x86_64-pc-linux-gnuhardened1", "x86_64-pc-linux-gnu" },
154+ {"x86_64-pc-linux-gnuhardened1", "x86_64-unknown-linux-gnu" },
155+ {"x86_64-pc-linux-gnu" },
156
157 {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
158
159@@ -98,6 +116,7 @@ canon_host_triplet (const char *triplet)
160 };
161 int i;
162 const char *lastalias = NULL;
163+ const char *s;
164
165 for (i=0; tbl[i].name; i++)
166 {
167@@ -110,6 +129,36 @@ canon_host_triplet (const char *triplet)
168 return xstrdup (lastalias);
169 }
170 }
171+ for (i=0, s=triplet; *s; s++)
172+ if (*s == '-')
173+ i++;
174+ if (i > 2 && !no_vendor_hack)
175+ {
176+ /* We have a 4 part "triplet": CPU-VENDOR-KERNEL-SYSTEM where
177+ * the last two parts replace the OS part of a real triplet.
178+ * The VENDOR part is then in general useless because
179+ * KERNEL-SYSTEM is specific enough. We now do a second pass by
180+ * replacing VENDOR with "unknown". */
181+ char *p;
182+ char *buf = xmalloc (strlen (triplet) + 7 + 1);
183+
184+ for (p=buf,s=triplet,i=0; *s; s++)
185+ {
186+ *p++ = *s;
187+ if (*s == '-' && ++i == 1)
188+ {
189+ memcpy (p, "unknown-",8);
190+ p += 8;
191+ for (s++; *s != '-'; s++)
192+ ;
193+ }
194+ }
195+ *p = 0;
196+ p = canon_host_triplet (buf, 1);
197+ xfree (buf);
198+ return p;
199+ }
200+
201 return xstrdup (triplet);
202 }
203
204@@ -558,7 +607,7 @@ write_special (const char *fname, int lnr, const char *tag)
205 int
206 main (int argc, char **argv)
207 {
208- FILE *fp;
209+ FILE *fp = NULL;
210 char line[LINESIZE];
211 int lnr = 0;
212 const char *fname, *s;
213@@ -571,11 +620,22 @@ main (int argc, char **argv)
214 argc--; argv++;
215 }
216
217- if (argc != 6)
218+ if (argc == 1)
219+ {
220+ /* Print just the canonicalized host triplet. */
221+ host_triplet = canon_host_triplet (argv[0], 0);
222+ printf ("%s\n", host_triplet);
223+ goto leave;
224+ }
225+ else if (argc == 6)
226+ ; /* Standard operation. */
227+ else
228 {
229 fputs ("usage: " PGM
230 " host_os host_triplet template.h config.h"
231- " version version_number\n",
232+ " version version_number\n"
233+ " " PGM
234+ " host_triplet\n",
235 stderr);
236 return 1;
237 }
238@@ -586,7 +646,7 @@ main (int argc, char **argv)
239 hdr_version = argv[4];
240 hdr_version_number = argv[5];
241
242- host_triplet = canon_host_triplet (host_triplet_raw);
243+ host_triplet = canon_host_triplet (host_triplet_raw, 0);
244
245 srcdir = malloc (strlen (fname) + 2 + 1);
246 if (!srcdir)
247@@ -677,13 +737,15 @@ main (int argc, char **argv)
248 "End:\n"
249 "*/\n", stdout);
250
251+ leave:
252 if (ferror (stdout))
253 {
254 fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
255 return 1;
256 }
257
258- fclose (fp);
259+ if (fp)
260+ fclose (fp);
261
262 xfree (host_triplet);
263 return 0;
264diff --git a/src/syscfg/lock-obj-pub.i686-pc-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-gnu.h
265similarity index 100%
266rename from src/syscfg/lock-obj-pub.i686-pc-gnu.h
267rename to src/syscfg/lock-obj-pub.i686-unknown-gnu.h
268diff --git a/src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h
269similarity index 100%
270rename from src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h
271rename to src/syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h
272diff --git a/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-linux-gnu.h
273similarity index 100%
274rename from src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h
275rename to src/syscfg/lock-obj-pub.i686-unknown-linux-gnu.h
276diff --git a/src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h b/src/syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h
277similarity index 100%
278rename from src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h
279rename to src/syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h
280diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h b/src/syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h
281similarity index 100%
282rename from src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h
283rename to src/syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h
284diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h b/src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h
285similarity index 100%
286rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h
287rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h
288diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h b/src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h
289similarity index 100%
290rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h
291rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h
292diff --git a/src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h b/src/syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h
293similarity index 100%
294rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h
295rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h
296--
2972.17.1
298
diff --git a/meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch b/meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch
new file mode 100644
index 0000000000..197652f283
--- /dev/null
+++ b/meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch
@@ -0,0 +1,35 @@
1From ae6a3f20345dac4b9daab8c39ac2d3fb3f2c21e3 Mon Sep 17 00:00:00 2001
2From: Werner Koch <wk@gnupg.org>
3Date: Fri, 21 Sep 2018 14:37:21 +0200
4Subject: [PATCH Libgpg-error] syscfg: Add support for arc-unknown-linux-gnu
5
6* src/mkheader.c (canon_host_triplet): Add to table.
7--
8
9Note that unknown in the above triplet is actually a wildcard for 4
10part triplets.
11
12Signed-off-by: Werner Koch <wk@gnupg.org>
13
14Upstream-Status: Backport [http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commit;h=f4f0da74f526d7e35cedbc2e93454df6440dbfa5]
15---
16 src/mkheader.c | 3 ++-
17 1 file changed, 2 insertions(+), 1 deletion(-)
18
19diff --git a/src/mkheader.c b/src/mkheader.c
20index 7a38a1bec1a4..a4866e96ef43 100644
21--- a/src/mkheader.c
22+++ b/src/mkheader.c
23@@ -92,7 +92,8 @@ canon_host_triplet (const char *triplet, int no_vendor_hack)
24 {"i486-pc-linux-gnu", "i686-unknown-linux-gnu" },
25 {"i586-pc-linux-gnu" },
26 {"i686-pc-linux-gnu" },
27- {"arc-oe-linux-uclibc" }, /* Other CPU but same struct. */
28+ {"arc-oe-linux-gnu" }, /* Other CPU but same struct. */
29+ {"arc-oe-linux-uclibc" }, /* and uclibc is also the same. */
30
31 {"i486-pc-gnu", "i686-unknown-gnu"},
32 {"i586-pc-gnu"},
33--
342.17.1
35
diff --git a/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb b/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
index a4c720be9d..4f3e3d86cc 100644
--- a/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
+++ b/meta/recipes-support/libgpg-error/libgpg-error_1.32.bb
@@ -14,6 +14,8 @@ SECTION = "libs"
14UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html" 14UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
15SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \ 15SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
16 file://pkgconfig.patch \ 16 file://pkgconfig.patch \
17 file://0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch \
18 file://0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch \
17 " 19 "
18SRC_URI[md5sum] = "ef3d928a5a453fa701ecc3bb22be1c64" 20SRC_URI[md5sum] = "ef3d928a5a453fa701ecc3bb22be1c64"
19SRC_URI[sha256sum] = "c345c5e73cc2332f8d50db84a2280abfb1d8f6d4f1858b9daa30404db44540ca" 21SRC_URI[sha256sum] = "c345c5e73cc2332f8d50db84a2280abfb1d8f6d4f1858b9daa30404db44540ca"
@@ -30,6 +32,9 @@ do_compile_prepend() {
30 if [ ${TARGET_OS} = "mingw32" ]; then 32 if [ ${TARGET_OS} = "mingw32" ]; then
31 # There are no arch specific syscfg files for mingw32 33 # There are no arch specific syscfg files for mingw32
32 TARGET_FILE= 34 TARGET_FILE=
35 elif [ ${TARGET_ARCH} = "arc" ]; then
36 # ARC syscfg file is automatically aliased to i686-pc-linux-gnu
37 TARGET_FILE=
33 elif [ ${TARGET_OS} != "linux" ]; then 38 elif [ ${TARGET_OS} != "linux" ]; then
34 TARGET_FILE=${TARGET_OS} 39 TARGET_FILE=${TARGET_OS}
35 fi 40 fi
@@ -38,11 +43,11 @@ do_compile_prepend() {
38 aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;; 43 aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;;
39 arm) TUPLE=arm-unknown-linux-gnueabi ;; 44 arm) TUPLE=arm-unknown-linux-gnueabi ;;
40 armeb) TUPLE=arm-unknown-linux-gnueabi ;; 45 armeb) TUPLE=arm-unknown-linux-gnueabi ;;
41 i586|i686) TUPLE=i686-pc-linux-gnu ;; 46 i586|i686) TUPLE=i686-unknown-linux-gnu;;
42 mips64*) TUPLE=mips64el-unknown-linux-gnuabi64 ;; 47 mips64*) TUPLE=mips64el-unknown-linux-gnuabi64 ;;
43 mips*el) TUPLE=mipsel-unknown-linux-gnu ;; 48 mips*el) TUPLE=mipsel-unknown-linux-gnu ;;
44 mips*) TUPLE=mips-unknown-linux-gnu ;; 49 mips*) TUPLE=mips-unknown-linux-gnu ;;
45 x86_64) TUPLE=x86_64-pc-linux-gnu ;; 50 x86_64) TUPLE=x86_64-unknown-linux-gnu ;;
46 *) TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;; 51 *) TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;;
47 esac 52 esac
48 53