Skip to contentSkip to conversation

Introduce ARC port of OpenEmbedded

PATCH New Alexey Brodkin 3 participants 12 messages Sep 21, 2018 – Sep 22, 2018 Synopsys ARC architecture

lore
Share & tools
lore
#0 lore raw

v3 cover Introduce ARC port of OpenEmbedded

DesignWare ARC Processors are a family of 32-bit CPUs from Synopsys. This series introduces basic support for ARC architecture in OpenEmbedded.

As of today latest upstream GCC and Binutils are perfectly usable for building packages for ARC so we just need a couple of fixes.

Glibc for ARC is under review and we're working hard to get it accepted in the next upstream release. For now we'll use latest code-base back-ported on top of 2.28 release via meta-synopsys.

More platform and architecture specific bits could be found in meta-synopsys layer here (please refer to the "master" branch):
https://github.com/foss-for-synopsys-dwc-arc-processors/meta-synopsys

Changes v2 -> v3:
* libgpg-error: Use proper upstream fix for ARC Glibc tools
* libgpg-error: Fix header name for x86_64

Changes v1 -> v2:
* Added upstream status for all patches
* Rebased on today's master

Alexey Brodkin (8):
siteinfo: Define data for ARC
kernel-arch.bbclass: Add ARC to kernel arch map
openssl: Add support for ARC
libgpg-error: Add ARC support
icu: Add ARC support
gcc: Disable libitm for ARC
binutils: Fix Glibc building for ARC
gcc: Fix specs generation for ARC

Antoine Tenart (1):
nspr: Add ARC support

 meta/classes/kernel-arch.bbclass                   |   1 +
 meta/classes/siteinfo.bbclass                      |   2 +
 .../openssl/openssl10_1.0.2p.bb                    |   2 +-
 meta/recipes-connectivity/openssl/openssl_1.1.1.bb |   2 +-
 meta/recipes-devtools/binutils/binutils-2.31.inc   |   4 +
 ...location-where-GOT-information-is-collect.patch | 201 ++++++++++++++
 ...bustness.-Return-FALSE-in-case-of-NULL-po.patch |  38 +++
 ...lobal-symbol-is-not-an-indirect-or-warnin.patch |  46 ++++
 ...tion-was-still-being-generated-when-symbo.patch |  40 +++
 meta/recipes-devtools/gcc/gcc-8.2.inc              |   1 +
 .../gcc/gcc-8.2/0041-ARC-fix-spec-gen.patch        |  44 +++
 meta/recipes-devtools/gcc/gcc-runtime.inc          |   1 +
 .../icu/icu/0002-Add-ARC-support.patch             |  27 ++
 meta/recipes-support/icu/icu_62.1.bb               |   1 +
 ...port-ARC-CPUs-and-simplify-aliasing-table.patch | 298 +++++++++++++++++++++
 ...cfg-Add-support-for-arc-unknown-linux-gnu.patch |  35 +++
 .../libgpg-error/libgpg-error_1.32.bb              |   7 +-
 .../nspr/nspr/0004-Add-ARC-support.patch           |  88 ++++++
 meta/recipes-support/nspr/nspr_4.19.bb             |   1 +
 meta/site/arc-common                               |  11 +
 20 files changed, 847 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0018-Refactored-location-where-GOT-information-is-collect.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0019-Improved-robustness.-Return-FALSE-in-case-of-NULL-po.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0020-Make-sure-global-symbol-is-not-an-indirect-or-warnin.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0021-PLT-information-was-still-being-generated-when-symbo.patch
 create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0041-ARC-fix-spec-gen.patch
 create mode 100644 meta/recipes-support/icu/icu/0002-Add-ARC-support.patch
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch
 create mode 100644 meta/recipes-support/nspr/nspr/0004-Add-ARC-support.patch
 create mode 100644 meta/site/arc-common
Signature · 1 line
2.16.2
#1 lore raw

PATCH v3 1/9 siteinfo: Define data for ARC

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

Changes v1 -> v2:
* Merged changes in meta/classes/siteinfo.bbclass & meta/site/arc-common

 meta/classes/siteinfo.bbclass |  2 ++
 meta/site/arc-common          | 11 +++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 meta/site/arc-common
meta/classes/siteinfo.bbclass +2 -0
index 86bb853be2..dccf122b12 100644
@@ -20,6 +20,8 @@ def siteinfo_data(d):
         "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch
         "aarch64": "endian-little bit-64 arm-common arm-64",
         "aarch64_be": "endian-big bit-64 arm-common arm-64",
+        "arc": "endian-little bit-32 arc-common",
+        "arceb": "endian-big bit-32 arc-common",
         "arm": "endian-little bit-32 arm-common arm-32",
         "armeb": "endian-big bit-32 arm-common arm-32",
         "avr32": "endian-big bit-32 avr32-common",
meta/site/arc-common new file +11 -0
new file mode 100644
index 0000000000..d3c721a8bb
@@ -0,0 +1,11 @@
+# general
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=4
+ac_cv_alignof_unsigned_long=4
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
Signature · 1 line
2.16.2
#2 lore raw

PATCH v3 2/9 kernel-arch.bbclass: Add ARC to kernel arch map

In reply to Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

No changes in v2.

 meta/classes/kernel-arch.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/kernel-arch.bbclass +1 -0
index 09793fc9c2..2b52a63c64 100644
@@ -22,6 +22,7 @@ def map_kernel_arch(a, d):
     valid_archs = d.getVar('valid_archs').split()
 
     if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
+    elif re.match('arceb$', a):                 return 'arc'
     elif re.match('armeb$', a):                 return 'arm'
     elif re.match('aarch64$', a):               return 'arm64'
     elif re.match('aarch64_be$', a):            return 'arm64'
Signature · 1 line
2.16.2
#3 lore raw

PATCH v3 3/9 openssl: Add support for ARC

In reply to Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

No changes in v2.

 meta/recipes-connectivity/openssl/openssl10_1.0.2p.bb | 2 +-
 meta/recipes-connectivity/openssl/openssl_1.1.1.bb    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
meta/recipes-connectivity/openssl/openssl10_1.0.2p.bb +1 -1
index b7297fce02..84e086c2f6 100644
@@ -164,7 +164,7 @@ do_configure () {
 	linux-mips*)
 		target=debian-mips
 		;;
-	linux-microblaze* | linux-nios2* | linux-gnu*ilp32**)
+	linux-microblaze* | linux-nios2* | linux-gnu*ilp32** | linux-arc*)
 		target=linux-generic32
 		;;
 	linux-powerpc)
meta/recipes-connectivity/openssl/openssl_1.1.1.bb +1 -1
index 09b2c01024..73bcb27160 100644
@@ -78,7 +78,7 @@ do_configure () {
 	linux-*-mips64 | linux-mips64 | linux-*-mips64el | linux-mips64el)
 		target=linux64-mips64
 		;;
-	linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4)
+	linux-microblaze* | linux-nios2* | linux-sh3 | linux-sh4 | linux-arc*)
 		target=linux-generic32
 		;;
 	linux-powerpc)
Signature · 1 line
2.16.2
#4 lore raw

PATCH v3 4/9 nspr: Add ARC support

In reply to Alexey Brodkin

From: Antoine Tenart <[email protected]>

[Alexey: Rebased on top of other patches like RiscV, NIOS2 etc]

Signed-off-by Antoine Tenart <antoine.tenart at bootlin.com>
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

Changes v1 -> v2:

* Added upstream status

 .../nspr/nspr/0004-Add-ARC-support.patch           | 88 ++++++++++++++++++++++
 meta/recipes-support/nspr/nspr_4.19.bb             |  1 +
 2 files changed, 89 insertions(+)
 create mode 100644 meta/recipes-support/nspr/nspr/0004-Add-ARC-support.patch
meta/recipes-support/nspr/nspr/0004-Add-ARC-support.patch new file +88 -0
new file mode 100644
index 0000000000..9d686017df
@@ -0,0 +1,88 @@
+From 6cb5b0be8837222a1e01745f2cf57cd0e593186d Mon Sep 17 00:00:00 2001
+From: Antoine Tenart <antoine.tenart at free-electrons.com>
+Date: Mon, 23 Oct 2017 10:28:20 +0200
+Subject: [PATCH] Add ARC support
+
+[Alexey: Rebased on top of other patches like RiscV, NIOS2 etc].
+
+Signed-off-by: Antoine Tenart <antoine.tenart at bootlin.com>
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+
+Upstream-Status: Submitted [ https://bugzilla.mozilla.org/show_bug.cgi?id=1492378 ]
+---
+ pr/include/md/_linux.cfg | 45 ++++++++++++++++++++++++++++++++++++++++
+ pr/include/md/_linux.h   |  2 ++
+ 2 files changed, 47 insertions(+)
+
+diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg
+index fec8525378dc..5f4fa0eac783 100644
+--- a/pr/include/md/_linux.cfg
++++ b/pr/include/md/_linux.cfg
+@@ -1157,6 +1157,51 @@
+ #define PR_BYTES_PER_WORD_LOG2  3
+ #define PR_BYTES_PER_DWORD_LOG2 3
+ 
++#elif defined(__arc__)
++
++#define IS_LITTLE_ENDIAN 1
++#undef  IS_BIG_ENDIAN
++
++#define PR_BYTES_PER_BYTE   1
++#define PR_BYTES_PER_SHORT  2
++#define PR_BYTES_PER_INT    4
++#define PR_BYTES_PER_INT64  8
++#define PR_BYTES_PER_LONG   4
++#define PR_BYTES_PER_FLOAT  4
++#define PR_BYTES_PER_DOUBLE 8
++#define PR_BYTES_PER_WORD   4
++#define PR_BYTES_PER_DWORD  8
++
++#define PR_BITS_PER_BYTE    8
++#define PR_BITS_PER_SHORT   16
++#define PR_BITS_PER_INT     32
++#define PR_BITS_PER_INT64   64
++#define PR_BITS_PER_LONG    32
++#define PR_BITS_PER_FLOAT   32
++#define PR_BITS_PER_DOUBLE  64
++#define PR_BITS_PER_WORD    32
++
++#define PR_BITS_PER_BYTE_LOG2   3
++#define PR_BITS_PER_SHORT_LOG2  4
++#define PR_BITS_PER_INT_LOG2    5
++#define PR_BITS_PER_INT64_LOG2  6
++#define PR_BITS_PER_LONG_LOG2   5
++#define PR_BITS_PER_FLOAT_LOG2  5
++#define PR_BITS_PER_DOUBLE_LOG2 6
++#define PR_BITS_PER_WORD_LOG2   5
++
++#define PR_ALIGN_OF_SHORT   2
++#define PR_ALIGN_OF_INT     4
++#define PR_ALIGN_OF_LONG    4
++#define PR_ALIGN_OF_INT64   4
++#define PR_ALIGN_OF_FLOAT   4
++#define PR_ALIGN_OF_DOUBLE  4
++#define PR_ALIGN_OF_POINTER 4
++#define PR_ALIGN_OF_WORD    4
++
++#define PR_BYTES_PER_WORD_LOG2   2
++#define PR_BYTES_PER_DWORD_LOG2  3
++
+ #else
+ 
+ #error "Unknown CPU architecture"
+diff --git a/pr/include/md/_linux.h b/pr/include/md/_linux.h
+index 8e04fad479a1..628b1217e9c8 100644
+--- a/pr/include/md/_linux.h
++++ b/pr/include/md/_linux.h
+@@ -63,6 +63,8 @@
+ #define _PR_SI_ARCHITECTURE "riscv32"
+ #elif defined(__riscv) && (__riscv_xlen == 64)
+ #define _PR_SI_ARCHITECTURE "riscv64"
++#elif defined(__arc__)
++#define _PR_SI_ARCHITECTURE "arc"
+ #else
+ #error "Unknown CPU architecture"
+ #endif
+-- 
+2.17.1
+
meta/recipes-support/nspr/nspr_4.19.bb +1 -0
index b5264be2a0..0212be7f40 100644
@@ -12,6 +12,7 @@ SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz
            file://0002-Add-nios2-support.patch \
            file://0001-md-Fix-build-with-musl.patch \
            file://0003-Add-type-definitions-for-the-RISC-V-architecture.patch \
+           file://0004-Add-ARC-support.patch \
            file://nspr.pc.in \
 "
 
Signature · 1 line
2.16.2
#5 lore raw

PATCH v3 5/9 libgpg-error: Add ARC support

In reply to Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Werner Koch <wk at gnupg.org>

---

Changes v2 -> v3:
* Use proper [recently upstreamed] fix for ARC Glibc toolchain
* Fix compilation for x86_64 due to renamed header

Changes v1 -> v2:

* Added upstream status

 ...port-ARC-CPUs-and-simplify-aliasing-table.patch | 298 +++++++++++++++++++++
 ...cfg-Add-support-for-arc-unknown-linux-gnu.patch |  35 +++
 .../libgpg-error/libgpg-error_1.32.bb              |   7 +-
 3 files changed, 339 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch
 create mode 100644 meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch
meta/recipes-support/libgpg-error/libgpg-error/0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch new file +298 -0
new file mode 100644
index 0000000000..03b0ce77ed
@@ -0,0 +1,298 @@
+From d4fd6975671477721936060771aa4d7d07fb0910 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk at gnupg.org>
+Date: Tue, 18 Sep 2018 14:54:08 +0200
+Subject: [PATCH libgpg-error] syscfg: Support ARC CPUs and simplify aliasing
+ table.
+
+* src/mkheader.c (xmalloc): New.
+(xstrdup): Implement using xmalloc.
+(canon_host_triplet): Add supporr for arc CPU.  Adjust alias table to
+also alias *-pc-*.  Rename ibm to unknown. Add internal arg.  Add
+unknown vendor hack.
+(main): New mode to just print the canonicalized form.
+* src/Makefile.am (lock_obj_pub): s/-(pc|ibm)-/-unknown/.  Also rename
+files accordingly.
+--
+
+config.sub does no real aliasing and thus we would need to add several
+vendors to the alising tables despite that this has no technical
+meanding.  Instead we now replace the vendor with "unknown" for the
+4-part-"triplets".  This change will make maintenace easier.
+
+Signed-off-by: Werner Koch <wk at gnupg.org>
+
+Upstream-Status: Backport [ http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commit;h=48c8f8ddfc80 ]
+---
+ src/Makefile.am                               | 16 ++--
+ src/mkheader.c                                | 92 ++++++++++++++++---
+ ...-gnu.h => lock-obj-pub.i686-unknown-gnu.h} |  0
+ ... lock-obj-pub.i686-unknown-kfreebsd-gnu.h} |  0
+ ... => lock-obj-pub.i686-unknown-linux-gnu.h} |  0
+ ...=> lock-obj-pub.s390x-unknown-linux-gnu.h} |  0
+ ...ock-obj-pub.x86_64-unknown-kfreebsd-gnu.h} |  0
+ ...> lock-obj-pub.x86_64-unknown-linux-gnu.h} |  0
+ ...ock-obj-pub.x86_64-unknown-linux-gnux32.h} |  0
+ ... lock-obj-pub.x86_64-unknown-linux-musl.h} |  0
+ 10 files changed, 85 insertions(+), 23 deletions(-)
+ rename src/syscfg/{lock-obj-pub.i686-pc-gnu.h => lock-obj-pub.i686-unknown-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.i686-pc-kfreebsd-gnu.h => lock-obj-pub.i686-unknown-kfreebsd-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.i686-pc-linux-gnu.h => lock-obj-pub.i686-unknown-linux-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.s390x-ibm-linux-gnu.h => lock-obj-pub.s390x-unknown-linux-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.x86_64-pc-kfreebsd-gnu.h => lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-gnu.h => lock-obj-pub.x86_64-unknown-linux-gnu.h} (100%)
+ rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-gnux32.h => lock-obj-pub.x86_64-unknown-linux-gnux32.h} (100%)
+ rename src/syscfg/{lock-obj-pub.x86_64-pc-linux-musl.h => lock-obj-pub.x86_64-unknown-linux-musl.h} (100%)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 42998e46a3bc..8ec582ef99fb 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,9 +52,9 @@ lock_obj_pub = \
+ 	syscfg/lock-obj-pub.arm-apple-darwin.h              \
+         syscfg/lock-obj-pub.hppa-unknown-linux-gnu.h        \
+ 	syscfg/lock-obj-pub.i386-apple-darwin.h             \
+-        syscfg/lock-obj-pub.i686-pc-gnu.h                   \
+-        syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h          \
+-        syscfg/lock-obj-pub.i686-pc-linux-gnu.h             \
++        syscfg/lock-obj-pub.i686-unknown-gnu.h              \
++        syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h     \
++        syscfg/lock-obj-pub.i686-unknown-linux-gnu.h        \
+         syscfg/lock-obj-pub.m68k-unknown-linux-gnu.h        \
+         syscfg/lock-obj-pub.mips-unknown-linux-gnu.h        \
+         syscfg/lock-obj-pub.mips64el-unknown-linux-gnuabi64.h \
+@@ -66,16 +66,16 @@ lock_obj_pub = \
+ 	syscfg/lock-obj-pub.powerpc64le-unknown-linux-gnu.h \
+ 	syscfg/lock-obj-pub.powerpc-unknown-linux-gnuspe.h  \
+ 	syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h     \
+-        syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h           \
++        syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h       \
+         syscfg/lock-obj-pub.sh3-unknown-linux-gnu.h         \
+         syscfg/lock-obj-pub.sh4-unknown-linux-gnu.h         \
+         syscfg/lock-obj-pub.sparc-unknown-linux-gnu.h       \
+         syscfg/lock-obj-pub.sparc64-unknown-linux-gnu.h     \
+ 	syscfg/lock-obj-pub.x86_64-apple-darwin.h           \
+-        syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h        \
+-        syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h           \
+-        syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h        \
+-        syscfg/lock-obj-pub.x86_64-pc-linux-musl.h          \
++        syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h   \
++        syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h      \
++        syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h   \
++        syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h     \
+ 	syscfg/lock-obj-pub.tilegx-unknown-linux-gnu.h      \
+ 	syscfg/lock-obj-pub.ia64-unknown-linux-gnu.h        \
+ 	syscfg/lock-obj-pub.mingw32.h
+diff --git a/src/mkheader.c b/src/mkheader.c
+index 2fc5fada66a4..7a38a1bec1a4 100644
+--- a/src/mkheader.c
++++ b/src/mkheader.c
+@@ -51,17 +51,27 @@ xfree (void *a)
+ 
+ 
+ static char *
+-xstrdup (const char *string)
++xmalloc (size_t n)
+ {
+   char *p;
+-  size_t len = strlen (string) + 1;
+ 
+-  p = malloc (len);
++  p = malloc (n);
+   if (!p)
+     {
+       fputs (PGM ": out of core\n", stderr);
+       exit (1);
+     }
++  return p;
++}
++
++
++static char *
++xstrdup (const char *string)
++{
++  char *p;
++  size_t len = strlen (string) + 1;
++
++  p = xmalloc (len);
+   memcpy (p, string, len);
+   return p;
+ }
+@@ -69,23 +79,31 @@ xstrdup (const char *string)
+ 
+ /* Return a malloced string with TRIPLET.  If TRIPLET has an alias
+    return that instead.  In general build-aux/config.sub should do the
+-   aliasing but some returned triplets are anyway identical and thus we
+-   use this function to map it to the canonical form.  */
++   aliasing but some returned triplets are anyway identical and thus
++   we use this function to map it to the canonical form.
++   NO_VENDOR_HACK is for internal use; caller must call with 0. */
+ static char *
+-canon_host_triplet (const char *triplet)
++canon_host_triplet (const char *triplet, int no_vendor_hack)
+ {
+   struct {
+     const char *name;
+     const char *alias;
+   } tbl[] = {
+-    {"i486-pc-linux-gnu", "i686-pc-linux-gnu" },
++    {"i486-pc-linux-gnu", "i686-unknown-linux-gnu" },
+     {"i586-pc-linux-gnu" },
+-    {"i486-pc-gnu", "i686-pc-gnu"},
++    {"i686-pc-linux-gnu" },
++    {"arc-oe-linux-uclibc" }, /* Other CPU but same struct.  */
++
++    {"i486-pc-gnu", "i686-unknown-gnu"},
+     {"i586-pc-gnu"},
+-    {"i486-pc-kfreebsd-gnu", "i686-pc-kfreebsd-gnu"},
++    {"i686-pc-gnu"},
++
++    {"i486-pc-kfreebsd-gnu", "i686-unknown-kfreebsd-gnu"},
+     {"i586-pc-kfreebsd-gnu"},
++    {"i686-pc-kfreebsd-gnu"},
+ 
+-    {"x86_64-pc-linux-gnuhardened1", "x86_64-pc-linux-gnu" },
++    {"x86_64-pc-linux-gnuhardened1", "x86_64-unknown-linux-gnu" },
++    {"x86_64-pc-linux-gnu" },
+ 
+     {"powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnu" },
+ 
+@@ -98,6 +116,7 @@ canon_host_triplet (const char *triplet)
+   };
+   int i;
+   const char *lastalias = NULL;
++  const char *s;
+ 
+   for (i=0; tbl[i].name; i++)
+     {
+@@ -110,6 +129,36 @@ canon_host_triplet (const char *triplet)
+           return xstrdup (lastalias);
+         }
+     }
++  for (i=0, s=triplet; *s; s++)
++    if (*s == '-')
++      i++;
++  if (i > 2 && !no_vendor_hack)
++    {
++      /* We have a 4 part "triplet": CPU-VENDOR-KERNEL-SYSTEM where
++       * the last two parts replace the OS part of a real triplet.
++       * The VENDOR part is then in general useless because
++       * KERNEL-SYSTEM is specific enough.  We now do a second pass by
++       * replacing VENDOR with "unknown".  */
++      char *p;
++      char *buf = xmalloc (strlen (triplet) + 7 + 1);
++
++      for (p=buf,s=triplet,i=0; *s; s++)
++        {
++          *p++ = *s;
++          if (*s == '-' && ++i == 1)
++            {
++              memcpy (p, "unknown-",8);
++              p += 8;
++              for (s++; *s != '-'; s++)
++                ;
++            }
++        }
++      *p = 0;
++      p = canon_host_triplet (buf, 1);
++      xfree (buf);
++      return p;
++    }
++
+   return xstrdup (triplet);
+ }
+ 
+@@ -558,7 +607,7 @@ write_special (const char *fname, int lnr, const char *tag)
+ int
+ main (int argc, char **argv)
+ {
+-  FILE *fp;
++  FILE *fp = NULL;
+   char line[LINESIZE];
+   int lnr = 0;
+   const char *fname, *s;
+@@ -571,11 +620,22 @@ main (int argc, char **argv)
+       argc--; argv++;
+     }
+ 
+-  if (argc != 6)
++  if (argc == 1)
++    {
++      /* Print just the canonicalized host triplet.  */
++      host_triplet = canon_host_triplet (argv[0], 0);
++      printf ("%s\n", host_triplet);
++      goto leave;
++    }
++  else if (argc == 6)
++    ; /* Standard operation.  */
++  else
+     {
+       fputs ("usage: " PGM
+              " host_os host_triplet template.h config.h"
+-             " version version_number\n",
++             " version version_number\n"
++             "       " PGM
++             " host_triplet\n",
+              stderr);
+       return 1;
+     }
+@@ -586,7 +646,7 @@ main (int argc, char **argv)
+   hdr_version = argv[4];
+   hdr_version_number = argv[5];
+ 
+-  host_triplet = canon_host_triplet (host_triplet_raw);
++  host_triplet = canon_host_triplet (host_triplet_raw, 0);
+ 
+   srcdir = malloc (strlen (fname) + 2 + 1);
+   if (!srcdir)
+@@ -677,13 +737,15 @@ main (int argc, char **argv)
+          "End:\n"
+          "*/\n", stdout);
+ 
++ leave:
+   if (ferror (stdout))
+     {
+       fprintf (stderr, PGM ": error writing to stdout: %s\n", strerror (errno));
+       return 1;
+     }
+ 
+-  fclose (fp);
++  if (fp)
++    fclose (fp);
+ 
+   xfree (host_triplet);
+   return 0;
+diff --git a/src/syscfg/lock-obj-pub.i686-pc-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-gnu.h
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.i686-pc-gnu.h
+rename to src/syscfg/lock-obj-pub.i686-unknown-gnu.h
+diff --git a/src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.i686-pc-kfreebsd-gnu.h
+rename to src/syscfg/lock-obj-pub.i686-unknown-kfreebsd-gnu.h
+diff --git a/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h b/src/syscfg/lock-obj-pub.i686-unknown-linux-gnu.h
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h
+rename to src/syscfg/lock-obj-pub.i686-unknown-linux-gnu.h
+diff --git a/src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h b/src/syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.s390x-ibm-linux-gnu.h
+rename to src/syscfg/lock-obj-pub.s390x-unknown-linux-gnu.h
+diff --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
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.x86_64-pc-kfreebsd-gnu.h
+rename to src/syscfg/lock-obj-pub.x86_64-unknown-kfreebsd-gnu.h
+diff --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
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h
+rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnu.h
+diff --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
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-gnux32.h
+rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-gnux32.h
+diff --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
+similarity index 100%
+rename from src/syscfg/lock-obj-pub.x86_64-pc-linux-musl.h
+rename to src/syscfg/lock-obj-pub.x86_64-unknown-linux-musl.h
+-- 
+2.17.1
+
meta/recipes-support/libgpg-error/libgpg-error/0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch new file +35 -0
new file mode 100644
index 0000000000..197652f283
@@ -0,0 +1,35 @@
+From ae6a3f20345dac4b9daab8c39ac2d3fb3f2c21e3 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk at gnupg.org>
+Date: Fri, 21 Sep 2018 14:37:21 +0200
+Subject: [PATCH Libgpg-error] syscfg: Add support for arc-unknown-linux-gnu
+
+* src/mkheader.c (canon_host_triplet): Add to table.
+--
+
+Note that unknown in the above triplet is actually a wildcard for 4
+part triplets.
+
+Signed-off-by: Werner Koch <wk at gnupg.org>
+
+Upstream-Status: Backport [http://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=commit;h=f4f0da74f526d7e35cedbc2e93454df6440dbfa5]
+---
+ src/mkheader.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/mkheader.c b/src/mkheader.c
+index 7a38a1bec1a4..a4866e96ef43 100644
+--- a/src/mkheader.c
++++ b/src/mkheader.c
+@@ -92,7 +92,8 @@ canon_host_triplet (const char *triplet, int no_vendor_hack)
+     {"i486-pc-linux-gnu", "i686-unknown-linux-gnu" },
+     {"i586-pc-linux-gnu" },
+     {"i686-pc-linux-gnu" },
+-    {"arc-oe-linux-uclibc" }, /* Other CPU but same struct.  */
++    {"arc-oe-linux-gnu"    }, /* Other CPU but same struct.  */
++    {"arc-oe-linux-uclibc" }, /* and uclibc is also the same.  */
+ 
+     {"i486-pc-gnu", "i686-unknown-gnu"},
+     {"i586-pc-gnu"},
+-- 
+2.17.1
+
meta/recipes-support/libgpg-error/libgpg-error_1.32.bb +6 -1
index a4c720be9d..3e39c556eb 100644
@@ -14,6 +14,8 @@ SECTION = "libs"
 UPSTREAM_CHECK_URI = "https://gnupg.org/download/index.html"
 SRC_URI = "${GNUPG_MIRROR}/libgpg-error/libgpg-error-${PV}.tar.bz2 \
            file://pkgconfig.patch \
+           file://0001-syscfg-Support-ARC-CPUs-and-simplify-aliasing-table.patch \
+           file://0002-syscfg-Add-support-for-arc-unknown-linux-gnu.patch \
 	  "
 SRC_URI[md5sum] = "ef3d928a5a453fa701ecc3bb22be1c64"
 SRC_URI[sha256sum] = "c345c5e73cc2332f8d50db84a2280abfb1d8f6d4f1858b9daa30404db44540ca"
@@ -30,6 +32,9 @@ do_compile_prepend() {
 	if [ ${TARGET_OS} = "mingw32" ]; then
 		# There are no arch specific syscfg files for mingw32
 		TARGET_FILE=
+	elif [ ${TARGET_ARCH} = "arc" ]; then
+		# ARC syscfg file is automatically aliased to i686-pc-linux-gnu
+		TARGET_FILE=
 	elif [ ${TARGET_OS} != "linux" ]; then
 		TARGET_FILE=${TARGET_OS}
 	fi
@@ -42,7 +47,7 @@ do_compile_prepend() {
 	  mips64*)    TUPLE=mips64el-unknown-linux-gnuabi64 ;;
 	  mips*el)    TUPLE=mipsel-unknown-linux-gnu ;;
 	  mips*)      TUPLE=mips-unknown-linux-gnu ;;
-	  x86_64)     TUPLE=x86_64-pc-linux-gnu ;;
+	  x86_64)     TUPLE=x86_64-unknown-linux-gnu ;;
 	  *)          TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;;
 	esac
 
Signature · 1 line
2.16.2
#6 lore raw

PATCH v3 5/9 libgpg-error: Add ARC support

Quoted 5 lines · Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Werner Koch <wk at gnupg.org>

---

Quoted 7 lines

Changes v2 -> v3:
* Use proper [recently upstreamed] fix for ARC Glibc toolchain
* Fix compilation for x86_64 due to renamed header

Changes v1 -> v2:

* Added upstream status

Its still breaking on the autobuilder:

https://autobuilder.yoctoproject.org/typhoon/#/builders/21/builds/72/st
eps/7/logs/step1b

I think its for i586 which needs fixing similarly to x86_64.

I did pull the simpler less risky pieces in for 2.6 but this experience is making me nervous about the remaining patches which should perhaps wait until 2.7.

Cheers,

Richard

#7 lore raw

PATCH v3 5/9 libgpg-error: Add ARC support

Quoted 17 lines · Richard Purdie
Quoted 5 lines · Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>
Cc Ross Burton <ross.burton at intel.com>
Cc Werner Koch <wk at gnupg.org>

---

Quoted 7 lines

Changes v2 -> v3:
* Use proper [recently upstreamed] fix for ARC Glibc toolchain
* Fix compilation for x86_64 due to renamed header

Changes v1 -> v2:

* Added upstream status

Its still breaking on the autobuilder:

Quoted 8 lines

https://autobuilder.yoctoproject.org/typhoon/#/builders/21/builds/72/st
eps/7/logs/step1b

I think its for i586 which needs fixing similarly to x86_64.

I did pull the simpler less risky pieces in for 2.6 but this experience is making me nervous about the remaining patches which should perhaps wait until 2.7.

I think this should be fine. Lets take the ones we have going for now

Quoted 9 lines

Cheers,

Richard
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#8 lore raw

PATCH v3 6/9 icu: Add ARC support

In reply to Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

Changes v1 -> v2:

* Added upstream status

 .../icu/icu/0002-Add-ARC-support.patch             | 27 ++++++++++++++++++++++
 meta/recipes-support/icu/icu_62.1.bb               |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-support/icu/icu/0002-Add-ARC-support.patch
meta/recipes-support/icu/icu/0002-Add-ARC-support.patch new file +27 -0
new file mode 100644
index 0000000000..20e3d8356c
@@ -0,0 +1,27 @@
+From fcfd57105b4bdb30d906df152ef01748fa95daff Mon Sep 17 00:00:00 2001
+From: Alexey Brodkin <abrodkin at synopsys.com>
+Date: Thu, 13 Sep 2018 17:13:20 +0300
+Subject: [PATCH] icu: Add ARC support
+
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+
+Upstream-Status: Submitted [ https://github.com/unicode-org/icu/pull/149 ]
+---
+ i18n/double-conversion-utils.h                 | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/i18n/double-conversion-utils.h b/i18n/double-conversion-utils.h
+index 57fc49b231a3..0bd3e8340673 100644
+--- a/i18n/double-conversion-utils.h
++++ b/i18n/double-conversion-utils.h
+@@ -86,7 +86,7 @@ inline void abort_noreturn() { abort(); }
+     defined(__SH4__) || defined(__alpha__) || \
+     defined(_MIPS_ARCH_MIPS32R2) || \
+     defined(__AARCH64EL__) || defined(__aarch64__) || \
+-    defined(__riscv)
++    defined(__riscv) || defined(__arc__)
+ #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
+ #elif defined(__mc68000__)
+ #undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS
+2.17.1
+
meta/recipes-support/icu/icu_62.1.bb +1 -0
index ec9db7de84..4e3750b997 100644
@@ -16,6 +16,7 @@ BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV
 SRC_URI = "${BASE_SRC_URI} \
            file://icu-pkgdata-large-cmd.patch \
            file://fix-install-manx.patch \
+           file://0002-Add-ARC-support.patch \
            "
 
 SRC_URI_append_class-target = "\
Signature · 1 line
2.16.2
#9 lore raw

PATCH v3 7/9 gcc: Disable libitm for ARC

In reply to Alexey Brodkin

The libitm is not supported on ARC, so disable it

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

No changes in v2.

 meta/recipes-devtools/gcc/gcc-runtime.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/gcc/gcc-runtime.inc +1 -0
index 72b8081cd3..9e7e7c5b3d 100644
@@ -17,6 +17,7 @@ EXTRA_OECONF_PATHS = "\
 EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
 
 RUNTIMELIBITM = "libitm"
+RUNTIMELIBITM_arc = ""
 RUNTIMELIBITM_mipsarch = ""
 RUNTIMELIBITM_nios2 = ""
 RUNTIMELIBITM_microblaze = ""
Signature · 1 line
2.16.2
#10 lore raw

PATCH v3 8/9 binutils: Fix Glibc building for ARC

In reply to Alexey Brodkin
Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

Changes v1 -> v2:

* Added upstream status

 meta/recipes-devtools/binutils/binutils-2.31.inc   |   4 +
 ...location-where-GOT-information-is-collect.patch | 201 +++++++++++++++++++++
 ...bustness.-Return-FALSE-in-case-of-NULL-po.patch |  38 ++++
 ...lobal-symbol-is-not-an-indirect-or-warnin.patch |  46 +++++
 ...tion-was-still-being-generated-when-symbo.patch |  40 ++++
 5 files changed, 329 insertions(+)
 create mode 100644 meta/recipes-devtools/binutils/binutils/0018-Refactored-location-where-GOT-information-is-collect.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0019-Improved-robustness.-Return-FALSE-in-case-of-NULL-po.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0020-Make-sure-global-symbol-is-not-an-indirect-or-warnin.patch
 create mode 100644 meta/recipes-devtools/binutils/binutils/0021-PLT-information-was-still-being-generated-when-symbo.patch
meta/recipes-devtools/binutils/binutils-2.31.inc +4 -0
index bc951d73e4..76add0fe4b 100644
@@ -37,6 +37,10 @@ SRC_URI = "\
      file://0015-sync-with-OE-libtool-changes.patch \
      file://0016-add-i386pep-emulation-for-x86_64.patch \
      file://0017-improve-check-for-input-file-matching-output-file.patch \
+     file://0018-Refactored-location-where-GOT-information-is-collect.patch \
+     file://0019-Improved-robustness.-Return-FALSE-in-case-of-NULL-po.patch \
+     file://0020-Make-sure-global-symbol-is-not-an-indirect-or-warnin.patch \
+     file://0021-PLT-information-was-still-being-generated-when-symbo.patch \
 "
 S  = "${WORKDIR}/git"
 
meta/recipes-devtools/binutils/binutils/0018-Refactored-location-where-GOT-information-is-collect.patch new file +201 -0

201 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0019-Improved-robustness.-Return-FALSE-in-case-of-NULL-po.patch new file +38 -0
new file mode 100644
index 0000000000..6a58ee06ac
@@ -0,0 +1,38 @@
+From 955176bd999fe80c5b937ab8786665079e35c387 Mon Sep 17 00:00:00 2001
+From: Cupertino Miranda <cmiranda at synopsys.com>
+Date: Fri, 2 Mar 2018 17:33:48 +0100
+Subject: [PATCH] Improved robustness. Return FALSE in case of NULL pointer.
+
+bfd/
+2018-03-01  Cupertino Miranda <cmiranda at synopsys.com>
+
+	* elf32-arc.c (elf_arc_finish_dynamic_symbol) Return FALSE in case
+	arc_htab is NULL.
+
+Signed-off-by: Cupertino Miranda <cmiranda at synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+[Romain: rebase on top of 2.31]
+Signed-off-by: Romain Naour <romain.naour at gmail.com>
+
+Upstream-Status: Pending
+---
+ bfd/elf32-arc.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
+index ab84de43815..33fc72cff6e 100644
+--- a/bfd/elf32-arc.c
++++ b/bfd/elf32-arc.c
+@@ -2420,6 +2420,9 @@ elf_arc_finish_dynamic_symbol (bfd * output_bfd,
+     {
+       struct elf_arc_link_hash_table *arc_htab = elf_arc_hash_table (info);
+ 
++      if(arc_htab == NULL)
++	return FALSE;
++
+       if (h->dynindx == -1
+ 	  || (h->root.type != bfd_link_hash_defined
+ 	      && h->root.type != bfd_link_hash_defweak)
+-- 
+2.14.4
+
meta/recipes-devtools/binutils/binutils/0020-Make-sure-global-symbol-is-not-an-indirect-or-warnin.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-devtools/binutils/binutils/0021-PLT-information-was-still-being-generated-when-symbo.patch new file +40 -0
new file mode 100644
index 0000000000..9e942399c0
@@ -0,0 +1,40 @@
+From e4861c68067cb2166b4c2bb9c052abeb6ad9aaa1 Mon Sep 17 00:00:00 2001
+From: Cupertino Miranda <cmiranda at synopsys.com>
+Date: Fri, 2 Mar 2018 17:44:29 +0100
+Subject: [PATCH] PLT information was still being generated when symbol was
+ forced_local.
+
+A change upstream reveiled this issue, triggering an assert when linking glibc.
+
+bfd/
+2018-03-01  Cupertino Miranda <cmiranda at synopsys.com>
+
+	* elf32-arc.c (elf_arc_check_relocs): Changed.
+
+Signed-off-by: Cupertino Miranda <cmiranda at synopsys.com>
+Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
+[Romain: rebase on top of 2.31]
+Signed-off-by: Romain Naour <romain.naour at gmail.com>
+
+Upstream-Status: Pending
+---
+ bfd/elf32-arc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
+index 9b72c5b4f4f..b40b463d34d 100644
+--- a/bfd/elf32-arc.c
++++ b/bfd/elf32-arc.c
+@@ -2041,7 +2041,8 @@ elf_arc_check_relocs (bfd *			 abfd,
+ 	  if (h == NULL)
+ 	    continue;
+ 	  else
+-	    h->needs_plt = 1;
++	    if(h->forced_local == 0)
++	      h->needs_plt = 1;
+ 	}
+ 
+       /* Add info to the symbol got_entry_list.  */
+-- 
+2.14.4
+
Signature · 1 line
2.16.2
#11 lore raw

PATCH v3 9/9 gcc: Fix specs generation for ARC

In reply to Alexey Brodkin

GCC's built-in spec for LD is missing a space after "--eh-frame-hdr" thus with the next option merged together they are not understood by LD and so LD fails.

Back-port from upstream GCC, see:
https://github.com/gcc-mirror/gcc/commit/892142379c6b99fe8c3ebdfe0b79e2a435228c1d

Signed-off-by Alexey Brodkin <abrodkin at synopsys.com>

---

No changes in v3.

Changes v1 -> v2:

* Added upstream status

 meta/recipes-devtools/gcc/gcc-8.2.inc              |  1 +
 .../gcc/gcc-8.2/0041-ARC-fix-spec-gen.patch        | 44 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc-8.2/0041-ARC-fix-spec-gen.patch
meta/recipes-devtools/gcc/gcc-8.2.inc +1 -0
index 889187e9c4..866a77558b 100644
@@ -69,6 +69,7 @@ SRC_URI = "\
            file://0038-fix-segmentation-fault-in-precompiled-header-generat.patch \
            file://0039-Fix-for-testsuite-failure.patch \
            file://0040-Re-introduce-spe-commandline-options.patch \
+           file://0041-ARC-fix-spec-gen.patch \
            ${BACKPORTS} \
 "
 BACKPORTS = "\
meta/recipes-devtools/gcc/gcc-8.2/0041-ARC-fix-spec-gen.patch new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.16.2