Bug#989453: Debian: gcc: add support for ARC

2021-06-07 Thread Vineet Gupta
On 6/5/21 4:12 AM, Matthias Klose wrote:
> Control: tags -1 + incomplete
> 
> These definitions have to go first to
> https://wiki.debian.org/Multiarch/Tuples
> 
> Please update.

Wiki page updated now.

Thx,
-Vineet


Bug#989453: Debian: gcc: add support for ARC

2021-06-04 Thread Vineet Gupta
Missed attaching patches in original report.
From b2bb3ff341a43a1abe033daa9d6fbf8bb6f86fab Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Wed, 3 Mar 2021 16:36:44 -0500
Subject: [PATCH 1/4] ARC/upstream: gcc driver default to hard-float

This change is already merged in mainline gcc as of 2021-06-02
commit 46d04271a498 "ARC: gcc driver default to hs38_linux"

Signed-off-by: Vineet Gupta 
---
 debian/patches/arc-hf-default.diff | 18 ++
 debian/rules.patch |  1 +
 2 files changed, 19 insertions(+)
 create mode 100755 debian/patches/arc-hf-default.diff

diff --git a/debian/patches/arc-hf-default.diff b/debian/patches/arc-hf-default.diff
new file mode 100755
index ..d162d20d9ec3
--- /dev/null
+++ b/debian/patches/arc-hf-default.diff
@@ -0,0 +1,18 @@
+#DP: build for hf as default (implied by -mcpu=hs38_linux)
+
+---
+ gcc/config/arc/arc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/gcc/config/arc/arc.h
 b/src/gcc/config/arc/arc.h
+@@ -34,7 +34,7 @@ along with GCC; see the file COPYING3.  If not see
+ #define SYMBOL_FLAG_CMEM	(SYMBOL_FLAG_MACH_DEP << 3)
+ 
+ #ifndef TARGET_CPU_DEFAULT
+-#define TARGET_CPU_DEFAULT	PROCESSOR_arc700
++#define TARGET_CPU_DEFAULT	PROCESSOR_hs38_linux
+ #endif
+ 
+ /* Check if this symbol has a long_call attribute in its declaration */
+
diff --git a/debian/rules.patch b/debian/rules.patch
index c4ae7a04c1a2..65fcbf8e4087 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -83,6 +83,7 @@ debian_patches += \
 	pr97250-3 \
 	pr97250-4 \
 	pr97714 \
+	arc-hf-default \
 
 ifneq (,$(filter $(distrelease),wheezy jessie stretch buster lucid precise trusty xenial bionic cosmic disco eoan))
   debian_patches += pr85678-revert
-- 
2.25.1

From c42aba1683087c2287f4f289270207ebe24e4a7f Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Wed, 24 Mar 2021 16:37:01 -0700
Subject: [PATCH 2/4] ARC/debian/rules2: gcc disable multilib

Signed-off-by: Vineet Gupta 
---
 debian/rules2 | 4 
 1 file changed, 4 insertions(+)

diff --git a/debian/rules2 b/debian/rules2
index 6a402f086592..cb07b861a35f 100644
--- a/debian/rules2
+++ b/debian/rules2
@@ -533,6 +533,10 @@ ifneq (,$(findstring riscv64-linux,$(DEB_TARGET_GNU_TYPE)))
   CONFARGS += --with-arch=rv64imafdc --with-abi=lp64d
 endif
 
+ifneq (,$(findstring arc-linux,$(DEB_TARGET_GNU_TYPE)))
+  CONFARGS += --disable-multilib
+endif
+
 ifneq (,$(findstring s390x-linux,$(DEB_TARGET_GNU_TYPE)))
   ifeq ($(derivative),Ubuntu)
 ifneq (,$(filter $(distrelease),xenial bionic disco eoan focal))
-- 
2.25.1

From fd969fd2af9a7d97f8ac6762ccb621380ea15943 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Fri, 26 Mar 2021 14:46:54 -0700
Subject: [PATCH 3/4] ARC/debian: gcc: defines for multilib/multiarch enabling

This is equivalent of following for arc
 - debian/patches/gcc-multiarch.diff
 - debian/patches/gcc-multilib-multiarch.diff

Signed-off-by: Vineet Gupta 
---
 debian/patches/gcc-multiarch-arc.diff | 12 
 debian/rules.patch|  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 debian/patches/gcc-multiarch-arc.diff

diff --git a/debian/patches/gcc-multiarch-arc.diff b/debian/patches/gcc-multiarch-arc.diff
new file mode 100644
index ..936883ae2285
--- /dev/null
+++ b/debian/patches/gcc-multiarch-arc.diff
@@ -0,0 +1,12 @@
+DP: ARC: inhibit multilibs, define MULTILIB_OSDIRNAMES/MULTIARCH_DIRNAME
+
+---
+--- a/src/gcc/config/arc/t-multilib-linux
 b/src/gcc/config/arc/t-multilib-linux
+@@ -23,3 +23,6 @@ MULTILIB_DIRNAMES = hs archs hs38 hs38_linux arc700 nps400
+ # Aliases:
+ MULTILIB_MATCHES += mcpu?arc700=mA7
+ MULTILIB_MATCHES += mcpu?arc700=mARC700
++
++MULTILIB_OSDIRNAMES =
++MULTIARCH_DIRNAME = $(call if_multiarch,arc-linux-gnu)
diff --git a/debian/rules.patch b/debian/rules.patch
index 65fcbf8e4087..5c8aa1cd90f7 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -228,7 +228,7 @@ ifeq (,$(filter 2.1%, $(shell dpkg-query -l libc-bin | awk '/^.i/ {print $$3}'))
   #debian_patches += pr67899
 endif
 
-debian_patches += gcc-multiarch
+debian_patches += gcc-multiarch gcc-multiarch-arc
 debian_patches += config-ml
 ifneq ($(single_package),yes)
   ifeq ($(with_multiarch_cxxheaders),yes)
-- 
2.25.1

From 34ee1efe6c89da1b021f355382b94c909480d079 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Thu, 1 Apr 2021 14:57:49 -0700
Subject: [PATCH 4/4] ARC/debian: gcc: add build toogles as for other arches

This is equivalent of following for arc
- debian/patches/gcc-hash-style-gnu.diff
- debian/patches/gcc-as-needed.diff

Signed-off-by: Vineet Gupta 
---
 debian/patches/gcc-hash-style-gnu-arc.diff | 17 +
 debian/rules.patch |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 debian/patches/gcc-hash-style-gnu-arc.diff

diff --git a/debian/patches/gcc-hash-style-gnu-arc.diff b/debian/patches/gcc-hash-style-gnu-arc.diff
new file m

Bug#989453: Debian: gcc: add support for ARC

2021-06-04 Thread Vineet Gupta
Source: gcc
Severity: normal
Tags: patch

Hi,

To bootstrap arc port we need following changes to debian:gcc.
These patches are based off of 10.2.1-6 as that's what rebootstrap 
builds are using.

- 0001-ARC-upstream-gcc-driver-default-to-hard-float.patch
 This change is already merged in mainline gcc as of 2021-06-02
 commit 46d04271a498 "ARC: gcc driver default to hs38_linux"

- 0002-ARC-debian-rules2-gcc-disable-multilib.patch

- 0003-ARC-debian-gcc-defines-for-multilib-multiarch-enabli.patch
 This is equivalent of following for arc
  - debian/patches/gcc-multiarch.diff
  - debian/patches/gcc-multilib-multiarch.diff

- 0004-ARC-debian-gcc-add-build-toogles-as-for-other-arches.patch
 This is equivalent of following for arc
 - debian/patches/gcc-hash-style-gnu.diff
 - debian/patches/gcc-as-needed.diff


Thx,
-Vineet


Bug#989444: Debian: jemalloc: add arc support

2021-06-03 Thread Vineet Gupta
Update: upstream change has just now been merged.

Thx,
-Vineet


Bug#989444: Debian: jemalloc: add arc support

2021-06-03 Thread Vineet Gupta
Source: jemalloc
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.

Merge request exist in upstream jemalloc:
https://github.com/jemalloc/jemalloc/pull/2070

And also in debian
https://salsa.debian.org/debian/jemalloc/-/merge_requests/5

Thx,
-Vineet


Bug#989443: Debian: libffi: update symbols for ARC

2021-06-03 Thread Vineet Gupta
Source: libffi
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.
Patch attached.

Thx,
-Vineet
--- a/debian/libffi7.symbols.orig	2021-04-02 04:04:04.290554369 +
+++ b/debian/libffi7.symbols	2021-04-02 04:05:46.914554369 +
@@ -1,6 +1,6 @@
 libffi.so.7 libffi7 #MINVER#
  (symver)LIBFFI_BASE_7.0 3.3~20180313
  (symver)LIBFFI_CLOSURE_7.0 3.3~20180313
- (symver|arch=!hppa !ia64 !m68k !nios2 !riscv64 !sh4)LIBFFI_GO_CLOSURE_7.0 3.3~20180313
- (symver|arch=!hppa !ia64 !m68k !mips !mipsel !mips64 !mips64el !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !sh4)LIBFFI_COMPLEX_7.0 3.3~20180313
+ (symver|arch=!arc !hppa !ia64 !m68k !nios2 !riscv64 !sh4)LIBFFI_GO_CLOSURE_7.0 3.3~20180313
+ (symver|arch=!arc !hppa !ia64 !m68k !mips !mipsel !mips64 !mips64el !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !sh4)LIBFFI_COMPLEX_7.0 3.3~20180313
  (symver)LIBFFI_BASE_7.1 3.3~20180313


Bug#989442: Debian: openssl: Add ARC target

2021-06-03 Thread Vineet Gupta
Source: openssl
Severity: normal
Tags: patch

Hi,

This is needed to bootstrap arc port.
Patch attached.

Thx,
-Vineet
From 3268f18d797fb807a91a71266243e37749711b81 Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Thu, 3 Jun 2021 12:12:46 -0700
Subject: [PATCH] ARC arc target

Signed-off-by: Vineet Gupta 
---
 debian/patches/debian-targets-arc.patch | 12 
 debian/patches/series   |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 debian/patches/debian-targets-arc.patch

diff --git a/debian/patches/debian-targets-arc.patch b/debian/patches/debian-targets-arc.patch
new file mode 100644
index ..66be6afece80
--- /dev/null
+++ b/debian/patches/debian-targets-arc.patch
@@ -0,0 +1,12 @@
+--- a/Configurations/20-debian.conf
 b/Configurations/20-debian.conf
+@@ -13,6 +13,9 @@ my %targets = (
+ 		inherit_from => [ "debian-alpha" ],
+ 		cflags => add("-mcpu=ev5"),
+ 	},
++	"debian-arc" => {
++		inherit_from => [ "linux-generic32", "debian" ],
++	},
+ 	"debian-arm64" => {
+ 		inherit_from => [ "linux-aarch64", "debian" ],
+ 	},
diff --git a/debian/patches/series b/debian/patches/series
index 54001c0d7f22..ebc70bc7101a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ no-symbolic.patch
 pic.patch
 c_rehash-compat.patch
 Set-systemwide-default-settings-for-libssl-users.patch
+debian-targets-arc.patch
-- 
2.25.1



Bug#989440: Debian: gmp: add support for arc

2021-06-03 Thread Vineet Gupta
Source: gmp
Severity: normal
Tags: patch

Hi,

To bootstrap arc port we need symbols file update in gmp.
Patch attached.

Thx,
-Vineet
From 5894e168f3a19e2f113f672697cf8bb078a65a9f Mon Sep 17 00:00:00 2001
From: Vineet Gupta 
Date: Thu, 3 Jun 2021 11:33:05 -0700
Subject: [PATCH] Update symbols file for arc

Signed-off-by: Vineet Gupta 
---
 debian/libgmp10.symbols | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/debian/libgmp10.symbols b/debian/libgmp10.symbols
index 966cdc558c49..568049034d51 100644
--- a/debian/libgmp10.symbols
+++ b/debian/libgmp10.symbols
@@ -218,7 +218,7 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_add_n_pentium@Base 2:5.1.1
  __gmpn_add_n_sub_n@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_n_x86@Base 2:5.1.1
- (arch=!hppa !mips !mipsel !m68k !nios2 !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_add_nc@Base 0
+ (arch=!arc !hppa !mips !mipsel !m68k !nios2 !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_add_nc@Base 0
  (arch=any-i386)__gmpn_add_nc_atom@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_k6@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_k7@Base 2:5.1.1
@@ -227,9 +227,9 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_add_nc_pentium@Base 2:5.1.1
  (arch=any-i386)__gmpn_add_nc_x86@Base 2:5.1.1
  (arch=any-amd64)__gmpn_addaddmul_1msb0@Base 0
- (arch=!hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh1_n@Base 2:6.2.0
+ (arch=!arc !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh1_n@Base 2:6.2.0
  (arch=any-i386)__gmpn_addlsh1_n_init@Base 2:5.1.1
- (arch=!armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh2_n@Base 2:6.2.0
+ (arch=!arc !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_addlsh2_n@Base 2:6.2.0
  (arch=any-i386)__gmpn_addlsh2_n_init@Base 2:5.1.1
  (arch=any-amd64)__gmpn_addlsh_n@Base 0
  __gmpn_addmul_1@Base 0
@@ -273,7 +273,7 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_brootinv@Base 2:5.1.1
  __gmpn_bsqrt@Base 2:5.1.1
  __gmpn_bsqrtinv@Base 2:5.1.1
- (arch=hurd-i386 i386 kfreebsd-i386 riscv64 s390x sh4 sparc64)__gmpn_clz_tab@Base 2:6.2.0
+ __gmpn_clz_tab@Base 2:6.2.0
  __gmpn_cmp@Base 0
  __gmpn_cnd_add_n@Base 2:6.0.0
  (arch=any-i386)__gmpn_cnd_add_n_atom@Base 2:5.1.1
@@ -398,7 +398,7 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_hgcd_reduce_itch@Base 2:5.1.1
  __gmpn_hgcd_step@Base 2:5.1.1
  __gmpn_invert@Base 0
- (arch=!hppa !mips !mipsel !mips64 !mips64el !m68k !nios2 !riscv64 !sparc !sparc64 !sh3 !sh4 !tilegx !any-i386)__gmpn_invert_limb@Base 0
+ (arch=!arc !hppa !mips !mipsel !mips64 !mips64el !m68k !nios2 !riscv64 !sparc !sparc64 !sh3 !sh4 !tilegx !any-i386)__gmpn_invert_limb@Base 0
  __gmpn_invertappr@Base 0
  __gmpn_ior_n@Base 0
  __gmpn_iorn_n@Base 0
@@ -508,7 +508,7 @@ libgmp.so.10 libgmp10 #MINVER#
  (arch=any-i386)__gmpn_mul_1_pentium@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1_pentium_mmx@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1_x86@Base 2:5.1.1
- (arch=!any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_mul_1c@Base 2:6.2.0
+ (arch=!any-i386 !arc !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_mul_1c@Base 2:6.2.0
  (arch=any-i386)__gmpn_mul_1c_atom_sse2@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1c_k6@Base 2:5.1.1
  (arch=any-i386)__gmpn_mul_1c_k7@Base 2:5.1.1
@@ -571,13 +571,13 @@ libgmp.so.10 libgmp10 #MINVER#
  __gmpn_redc_n@Base 0
  __gmpn_remove@Base 0
  __gmpn_rootrem@Base 0
- (arch=!alpha !any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsblsh1_n@Base 2:6.2.0
- (arch=!alpha !any-i386 !armel !armhf !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsblsh2_n@Base 2:6.2.0
- (arch=!alpha !arm64 !armel !armhf !hppa !ia64 !mips !mipsel !mips64 !mips64el !m68k !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_rsblsh_n@Base 0
- (arch=!alpha !any-i386 !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx)__gmpn_rsh1add_n@Base 2:6.2.0
- (arch=!alpha !arm64 !armel !armhf !hppa !ia64 !mips !mipsel !mips64 !mips64el !m68k !nios2 !powerpc !powerpcspe !ppc64 !ppc64el !riscv64 !s390x !sh3 !sh4 !sparc !sparc64 !tilegx !any-i386)__gmpn_rsh1add_nc@Base 0
- (arch=!alpha !any-i386 !hppa !m68k !mips !mips64 !mips64el !mipsel !nios2 !powerpc !powerpcspe !riscv64 !s390x !sh3 !sh4

Bug#980963: dpkg: Please add ARC architecture

2021-06-02 Thread Vineet Gupta
Hi Guillem,

On 5/27/21 8:50 PM, Guillem Jover wrote:
> I discussed this today with Vineet on IRC in #debian-bootstrap, to try
> to clarify some things, and this is the summary I think:
>
> * ARCv2 32-bit little-endian
>
>- The arch based on ARCv2 32-bit is going to be little-endian, and
>  ideally will be hard-float, but that's pending on a patch for gcc,
>  to flip the default from soft-float. From what I understand while
>  hard and soft-float are ABI compatible in the ISA and calling
>  convention sense, they are not ABI compatible in the object
>  linking sense, and while I guess this could also perhaps be lifted,
>  it's not currently the case. My concern is that adding the support
>  before the default has been switched might mean "ABI incompatible"
>  architectures if we cannot link objects. Vineet, mentioned that
>  they might be fine settling with soft-float in that case, even
>  with the performance penalty implied (in that case, personally I
>  think adding the -gnuhf triplet would be better, but I'd not be
>  going to be doing the work, so… :). The patch is supposed to be
>  sent upstream around next week or so. I'd prefer to wait what
>  ends up happening there, TBH, before committing the support to
>  dpkg. As I've mentioned I'm fine with committing it once it hits
>  upstream git though.
>- The triplet would be «arc-linux-gnu», the Debian architecture
>  would be «arc».

FWIW gcc patch is now in mainline (I've requested Claudiu for backport)

2021-06-02 46d04271a498 ARC: gcc driver default to hs38_linux

Thx,
-Vineet



Bug#980963: dpkg: Please add ARC architecture

2021-05-24 Thread Vineet Gupta
Hi Guillem,

On 3/26/21 10:39 AM, Vineet Gupta wrote:
> On 3/4/21 3:56 PM, Vineet Gupta wrote:
>>> Also just to make sure, the GNU triplets are:
>>>
>>>     arc-linux-gnu
>>>     arceb-linux-gnu
>>> No ABI modifiers (stuff like “eabi”) for the libc part (“gnu“) right?
>> Actually it seems we are missing hardfloat here: ARC glibc/gcc support
>> it very well and should be default for any reasonable performance.
>>
>> So I think we should add
>>      arc-linux-gnuhf
>>      arceb-linux-gnuhf
>>
>> BTW I have oce question: where does one select what default toggles to
>> build the entire software stack with (say -mcpu etc). Does this rely
>> on toolchain driver default to DRTH. One of my problems with
>> rebootstrap was gcc driver defaulting to our legacy cpu. I've cured it
>> there (and planning to upstream the gcc driver patch).
> So here's the lay of the land, apologies for the long email, and if
> some/most of below is not directly relevant to dpkg bug, but I'll
> provide the background so we are all on same page.
>
> We've had 3 revisions of the ISA and ensuing multiple processors in last
> 15 years:
>
> ISA Implementations/Processors (Linux capable)
> -- ---
> ARCompact    ARC700
> ARCv2    HS38x/HS48x
> ARCv3:32-bit  HS58MP
> ARCv3:64-bit  HS68MP
>
> - ARCompact is legacy and no new development needed including debian port.
> - Code for one ISA is not compatible with priors, mainly due to addition
> of new instructions. In fact given the configurability of the ISA itself
> (for better or worse), one could end up 2 non-compatible variants of
> same ISA (think double load/store instructions in ARCv2). But the port
> can assume the all encompassing super-set of the ISA as baseline.
> - ARCv3 is currently under development / pre-production but should be
> kept in mind as it is knocking on the door already.
>
> In terms of the ABI critical flavors: there's little/big endian and
> soft/hard-float.
> - Again big endian debian is not needed - mainly because of number of
> customer engagements and resourcing needed to support it
> - ARCv2 hard-float ABI is same as soft - FPU shares the same register
> file so the calling conventions are same. However the triplet is
> different arc-linux-gnuhf [1] as libraries for hard won't run on a
> soft-float system due to lack of emulation etc.
> - ARCv3 does have a dedicated FP register file so there's soft and hard ABIs
>
> So given all of this, I'd like to propose ARCv2 port with hard-float as
> baseline. We don't bother with Big-endian. A soft-float would be
> desirable for debugging and fall-back but not necessary from feature pov.
>
> I'm open to port names as maintainers feel appropriate - but stick with
> current triplets arc-gnu-linux / arc-gnu-linuxhf for ARCv2.
> For ARCv3, we could have arc64* / arc32*
>
> Please let me know if this makes sense.
>
> Once we agree, we can start off with requesting changes to GNU config
> project.

Further to my msg on IRC, we've gotten pretty far along with ARC 
rebootstrap [1]. It seems to build 151 packages before failing for perl 
and I see similar outcome for riscv64 (which is weird as perl should be 
supported there.

Anyhow this is just a polite ping to make some progress on ARC.

Thx,
-Vineet

[1] https://salsa.debian.org/vineetgarc/rebootstrap


Bug#980963: dpkg: Please add ARC architecture

2021-03-26 Thread Vineet Gupta
On 3/4/21 3:56 PM, Vineet Gupta wrote:
>> Also just to make sure, the GNU triplets are:
>>
>>    arc-linux-gnu
>>    arceb-linux-gnu
>> No ABI modifiers (stuff like “eabi”) for the libc part (“gnu“) right?
>
> Actually it seems we are missing hardfloat here: ARC glibc/gcc support 
> it very well and should be default for any reasonable performance.
>
> So I think we should add
>     arc-linux-gnuhf
>     arceb-linux-gnuhf
>
> BTW I have oce question: where does one select what default toggles to 
> build the entire software stack with (say -mcpu etc). Does this rely 
> on toolchain driver default to DRTH. One of my problems with 
> rebootstrap was gcc driver defaulting to our legacy cpu. I've cured it 
> there (and planning to upstream the gcc driver patch).

So here's the lay of the land, apologies for the long email, and if 
some/most of below is not directly relevant to dpkg bug, but I'll 
provide the background so we are all on same page.

We've had 3 revisions of the ISA and ensuing multiple processors in last 
15 years:

ISA Implementations/Processors (Linux capable)
-- ---
ARCompact    ARC700
ARCv2    HS38x/HS48x
ARCv3:32-bit  HS58MP
ARCv3:64-bit  HS68MP

- ARCompact is legacy and no new development needed including debian port.
- Code for one ISA is not compatible with priors, mainly due to addition 
of new instructions. In fact given the configurability of the ISA itself 
(for better or worse), one could end up 2 non-compatible variants of 
same ISA (think double load/store instructions in ARCv2). But the port 
can assume the all encompassing super-set of the ISA as baseline.
- ARCv3 is currently under development / pre-production but should be 
kept in mind as it is knocking on the door already.

In terms of the ABI critical flavors: there's little/big endian and 
soft/hard-float.
- Again big endian debian is not needed - mainly because of number of 
customer engagements and resourcing needed to support it
- ARCv2 hard-float ABI is same as soft - FPU shares the same register 
file so the calling conventions are same. However the triplet is 
different arc-linux-gnuhf [1] as libraries for hard won't run on a 
soft-float system due to lack of emulation etc.
- ARCv3 does have a dedicated FP register file so there's soft and hard ABIs

So given all of this, I'd like to propose ARCv2 port with hard-float as 
baseline. We don't bother with Big-endian. A soft-float would be 
desirable for debugging and fall-back but not necessary from feature pov.

I'm open to port names as maintainers feel appropriate - but stick with 
current triplets arc-gnu-linux / arc-gnu-linuxhf for ARCv2.
For ARCv3, we could have arc64* / arc32*

Please let me know if this makes sense.

Once we agree, we can start off with requesting changes to GNU config 
project.

Thx,
-Vineet

[1] I don't see the arc hf explicitly @ 
https://git.savannah.gnu.org/cgit/config.git/tree/testsuite/config-sub.data



Bug#980963: dpkg: Please add ARC architecture

2021-03-04 Thread Vineet Gupta

Hi Guillem,

On 3/4/21 5:55 AM, Guillem Jover wrote:

Hi!

On Sun, 2021-01-24 at 23:36:52 +0300, Alexey Brodkin wrote:

Package: dpkg
Version: 1.19.7ubuntu3-1~202101232134~ubuntu20.04.1
Severity: wishlist
Tags: patch



ARC architecture seem to match requirements for being added to the dpkg
(https://wiki.debian.org/Teams/Dpkg/FAQ#Q._Can_we_add_support_for_new_dpkg_architectures.3F):

  * GNU triplet is there since 2013,
see: 
https://git.savannah.gnu.org/cgit/config.git/commit/?id=986360de6e412cbed27dbe2dbfb64ddbd18e7370
  * Binutils, GCC & uClibc support ARC for many years now,
glibc 2.32 finally gained ARC support, see 
https://lists.gnu.org/archive/html/info-gnu/2020-08/msg2.html


Sorry, didn't reply up to now due to the freeze, this not looking
ready yet (as glibc is not even in Debian), but mostly because it
slipped my mind, but that kind of blocks progress on your side.
So let's see. :)

Or, were you looking to get this included for bullseye? (I think this
would not qualify, but, I think we might have done exceptions in such
cases in the past.)


We don' have a timelime, but the sooner the better ;-)
I just want to flush out any missing pieces from ARC side of the things.


Is the ABI fully stabilized now?


It is. One thing to note is that ARC follows the 64-bit time_t/offsets, 
for 32-bit arches, enabled by glibc 2.32 (and that is the only glibc ABI 
we support). FWIW RV32 being th eonly other 32-bit arch (so far) to do 
that. I'm not sure if the debian ecosystem is prepared for this in 
general (for 32-bit arches). At the time fixes were neede in simplest of 
things like busybox so I'm wondering if what support if needed elsewhere 
or is it there already.




>From 96523e18473b56743bf2f7d308c2d786f337e52e Mon Sep 17 00:00:00 2001
From: Alexey Brodkin 
Date: Sun, 24 Jan 2021 00:34:52 +0300
Subject: [PATCH] Add ARC architecture



diff --git a/data/cputable b/data/cputable
index 9f2a8e0e4..114a66ecb 100644
--- a/data/cputable
+++ b/data/cputable
@@ -20,6 +20,8 @@ i386  i686(i[34567]86|pentium)32  
little
  ia64  ia64ia6464  little
  alpha alpha   alpha.* 64  little
  amd64 x86_64  (amd64|x86_64)  64  little
+arcarc arc.*   32  little
+arceb  arc arceb.* 32  big
  armeb armeb   arm.*b  32  big
  arm   arm arm.*   32  little
  arm64 aarch64 aarch64 64  little


This looked incorrect, as it ends up not being a bijective relation,
so the lines need to be swapped. The problem is that the comments do
not explain this nor the test suite checks. So I improved both with the
attached patches, which I'll commit into master once I open it up for
1.21.x.


Thx. We are debian noobs so please feel free to massage them for 
correctness and/or feel free to ask us to rework.




Also just to make sure, the GNU triplets are:

   arc-linux-gnu
   arceb-linux-gnu
No ABI modifiers (stuff like “eabi”) for the libc part (“gnu“) right?


Actually it seems we are missing hardfloat here: ARC glibc/gcc support 
it very well and should be default for any reasonable performance.


So I think we should add
arc-linux-gnuhf
arceb-linux-gnuhf

BTW I have oce question: where does one select what default toggles to 
build the entire software stack with (say -mcpu etc). Does this rely on 
toolchain driver default to DRTH. One of my problems with rebootstrap 
was gcc driver defaulting to our legacy cpu. I've cured it there (and 
planning to upstream the gcc driver patch).


Thx,
-Vineet



Bug#980963: dpkg: Please add ARC architecture

2021-03-03 Thread Vineet Gupta
On Wed, 3 Mar 2021 19:04:36 +0100 Helmut Grohne  wrote:
 > On Sat, Feb 06, 2021 at 07:25:35PM +, Alexey Brodkin wrote:
 > > Any chances to get updates on this one some time soon?
 >
 > No. The triplet cannot be changed once added. Therefore, the addition is
 > often deferred. The absence of the triplet can easily be worked around.
 > A bootstrap can be prototyped already. A major missing piece though is
 > glibc 2.32 being packaged in Debian. That likely is a prerequisite for
 > resolving this bug.
 >
 > Things that often need architecture-specific support for a new
 > architecture include:
 > * guile-X.Y (cross support)
 > * libgc
 > * libxcrypt (symbols)
 > * nspr
 > * openssl (packaging)
 >
 > Are any of these fixed or confirmed working for arc?
 >
 > I suggest that you coordinate with Vineet Gupta as he is already working
 > on this.

The current WIP is at

https://github.com/foss-for-synopsys-dwc-arc-processors/rebootstrap.git

The deal breaker is glibc support since debian is at 2.31 while ARC port was 
merged in 2.32. So here we patch in the entire ARC port :-)