From patchwork Thu Aug 18 05:52:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zakharov Vlad X-Patchwork-Id: 660333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sFFdL1tgZz9t0F for ; Thu, 18 Aug 2016 15:53:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 970E18B0E7; Thu, 18 Aug 2016 05:53:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a2DjdxKCGh_y; Thu, 18 Aug 2016 05:53:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2DB6B8A092; Thu, 18 Aug 2016 05:53:23 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 752481C26B5 for ; Thu, 18 Aug 2016 05:53:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 732478BC51 for ; Thu, 18 Aug 2016 05:53:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DphT6KwOI8MB for ; Thu, 18 Aug 2016 05:53:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.synopsys.com (smtprelay4.synopsys.com [198.182.47.9]) by whitealder.osuosl.org (Postfix) with ESMTPS id C14EF87625 for ; Thu, 18 Aug 2016 05:53:20 +0000 (UTC) Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id C284824E0BBB; Wed, 17 Aug 2016 22:53:19 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id B1C164E213; Wed, 17 Aug 2016 22:53:19 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id 7316D4E202; Wed, 17 Aug 2016 22:53:19 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 5664CA10; Wed, 17 Aug 2016 22:53:19 -0700 (PDT) Received: from vzakhar-8460.internal.synopsys.com (vzakhar-8460.internal.synopsys.com [10.121.14.111]) by mailhost.synopsys.com (Postfix) with ESMTP id 8516C9F7; Wed, 17 Aug 2016 22:53:17 -0700 (PDT) From: Vlad Zakharov To: buildroot@busybox.net Date: Thu, 18 Aug 2016 08:52:33 +0300 Message-Id: <1471499553-6145-1-git-send-email-vzakhar@synopsys.com> X-Mailer: git-send-email 2.5.5 Cc: Thomas Petazzoni , Vlad Zakharov , Alexey Brodkin , Eugeniy Paltsev Subject: [Buildroot] [PATCH v2] uclibc: ARC: Support syscall ABI v4 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When used with GCC 6 ABIv4 is used. Missing this patch leads to numerous runtime errors. The patch has already been accepted in uclibc-ng: http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=3e40f9669279f005f7154892539166f5081fbcb2 So the patch should be removed after update to a new version of uclibc-ng. Signed-off-by: Vlad Zakharov --- Changes v1-v2: Added commit message and signed-off-by to the attached patch. .../uclibc/0003-ARC-Support-syscall-ABI-v4.patch | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 package/uclibc/0003-ARC-Support-syscall-ABI-v4.patch diff --git a/package/uclibc/0003-ARC-Support-syscall-ABI-v4.patch b/package/uclibc/0003-ARC-Support-syscall-ABI-v4.patch new file mode 100644 index 0000000..f0a5ae7 --- /dev/null +++ b/package/uclibc/0003-ARC-Support-syscall-ABI-v4.patch @@ -0,0 +1,54 @@ +From 3e40f9669279f005f7154892539166f5081fbcb2 Mon Sep 17 00:00:00 2001 +From: Vineet Gupta +Date: Tue, 16 Aug 2016 15:04:27 -0700 +Subject: [PATCH] ARC: Support syscall ABI v4 + +The syscall ABI includes the gcc functional calling ABI since a syscall +implies userland caller and kernel callee. + +The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in +even-odd register pairs, (potentially punching reg holes when passing such +values as args). This was partly driven by the fact that the double-word +LDD/STD instructions in ARCv2 expect the register alignment and thus gcc +forcing this avoids extra MOV at the cost of a few unused register (which we +have plenty anyways). + +This however was rejected as part of upstreaming gcc port to HS. So the new +ABI v4 doesn't enforce the even-odd reg restriction. + +Do note that for ARCompact ISA builds v3 and v4 are practically the same in +terms of gcc code generation. + +This change is dormant for now (gcc 4.8.x based tools) and will only kick +in with switch to gcc 6.x based tools. + +Signed-off-by: Vineet Gupta +--- + libc/sysdeps/linux/arc/bits/uClibc_arch_features.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h +index 5160724..94e089d 100755 +--- a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h ++++ b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h +@@ -41,8 +41,14 @@ + /* The default ';' is a comment on ARC. */ + #define __UCLIBC_ASM_LINE_SEP__ ` + +-/* does your target align 64bit values in register pairs ? (32bit arches only) */ +-#if defined(__A7__) ++/* does your target align 64bit values in register pairs ? (32bit arches only) ++ * - ARC700 never had any constraint on reg pairs (even if ABI v3) ++ * - Inital HS ABI (v3: non upstream gcc) had 64-bit data aligned in even-odd ++ * reg pairs (thus allowed reg holes when passing such args to calls) ++ * - Upstream gcc (6.x) HS ABI doesn't have that restriction ++ */ ++ ++#if defined(__A7__) || (__GNUC__ > 4) + #undef __UCLIBC_SYSCALL_ALIGN_64BIT__ + #else + #define __UCLIBC_SYSCALL_ALIGN_64BIT__ +-- +2.5.5 + -- 2.5.5