From patchwork Thu Oct 18 09:12:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 985757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MK7oVjPw"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="I33sAmsL"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42bNbv0WHBz9s0t for ; Thu, 18 Oct 2018 20:12:26 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=OWBa8HfVEhV3JIAyLFv3lVXWotqLsAxanigd2QkTlhk=; b=MK7 oVjPwbotwt6CkBmJ1L7sS98nScI/pkDZcESObUd6gFEl5pmxnJlNcMKN4Gc5cE7EOicvUfncoVq9w 6uinultmh7x1gaIz5mGv/OlNvpMSOpb4nnAX7/5tJb6oOeVGvAkppG/rTZvGb2buJUZfM6EpZOlCV tfQXA2+koFGzzUwK6kyHD/LHF5y/Y2L+tVBjaCHhIzwOpbxucYSGpENwiYm5LEvo5gqPpmLdC6DPu qJTAr5tsF5AywofCOXaa0oVSBPpcPI8I9xrEDFeOF2Czb5UAp9LA9zbjo42rz1u52N9V+GTJIShPQ obj2C+fP6X3r8pRz3oReKc/hqNGHFKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD4Lv-0000yi-To; Thu, 18 Oct 2018 09:12:23 +0000 Received: from smtprelay2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gD4Ls-0000xk-7L for linux-snps-arc@lists.infradead.org; Thu, 18 Oct 2018 09:12:22 +0000 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 0322910C10F2; Thu, 18 Oct 2018 02:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1539853927; bh=n9X+Wzpf+dD8vGYrfqu0w2QnS0Aud+Zlb9NPEtj9B5U=; h=From:To:Cc:Subject:Date:From; b=I33sAmsLEgXv+WJGcD6Qd56UaWORR8zUm4wgkWY5k2Byfz46smt+1zSkz3Y3yEU0b 23/fbuoL4DsC0/CgfLudFtyfHDC/rRYU79Ki6a3seG+OhkpshchxRNOioyBDBImb4b Nqn4p+SqcoZi1FPWCDzc2a2cPq+MOu9a7ZzqS9Sj6iKmajgG1aZ7Z4Fr2n3HCL307l icjVnAfeXXx2M/hzaGz3Qm3Hjnz1pfshwW2CfI/jvwfRpcotAJ9wGT2LKdE4Imw47B 7+4fVD92ULBpR0ODdAdcoGDCkQejhOy2+B9SEJg513DQnz1S4+XE/vAXI5MNt2i+lS OkKHIK4kCmm7Q== Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id 47C205B46; Thu, 18 Oct 2018 02:12:04 -0700 (PDT) From: Alexey Brodkin To: openembedded-core@lists.openembedded.org Subject: [PATCH] mpfr: Fix compilation for ARC Date: Thu, 18 Oct 2018 12:12:03 +0300 Message-Id: <20181018091203.22480-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.16.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181018_021220_306150_7D6404A2 X-CRM114-Status: GOOD ( 12.24 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-snps-arc@lists.infradead.org, Alexey Brodkin , Ross Burton , Khem Raj MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org MPFR has a couple of things implemented in assembly and in case of ARC those parts were written long ago when ARC GCC port was not yet upstreamed. On upstreaming of GCC some constraints were changed and so we can no longer build MPFR for ARC with up-to-date tools seeing something like that: | In file included from ../../mpfr-4.0.1/src/mpfr-impl.h:112, | from ../../mpfr-4.0.1/src/mul.c:24: | ../../mpfr-4.0.1/src/mul.c: In function 'mpfr_mul': | ../../mpfr-4.0.1/src/mpfr-longlong.h:415:3: error: impossible constraint in 'asm' | __asm__ ("add.f\t%1, %4, %5\n\tadc\t%0, %2, %3" \ | ^~~~~~~ Signed-off-by: Alexey Brodkin --- .../0001-Fix-obsolete-ARC-asm-constraints.patch | 45 ++++++++++++++++++++++ meta/recipes-support/mpfr/mpfr_4.0.1.bb | 3 +- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-support/mpfr/mpfr/0001-Fix-obsolete-ARC-asm-constraints.patch diff --git a/meta/recipes-support/mpfr/mpfr/0001-Fix-obsolete-ARC-asm-constraints.patch b/meta/recipes-support/mpfr/mpfr/0001-Fix-obsolete-ARC-asm-constraints.patch new file mode 100644 index 0000000000..59d1b0db67 --- /dev/null +++ b/meta/recipes-support/mpfr/mpfr/0001-Fix-obsolete-ARC-asm-constraints.patch @@ -0,0 +1,45 @@ +mpfr-longlong.h: Fix obsolete ARC asm constraints + +This patch replaces obsolete ARC "J" asm constraint with +up-to-date "Cal" constraint. + +"J" constraint only existed in pre-upstream GCC port for ARC. +In current upstream port "Cal" constraint is used which leads +to compile-time error. + +Proposed fix is known to work in Buildroot, Crosstool-NG etc. + +[1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=09cb6a17e71bd40d2fbfaf82a1502fc210e33c87 + +Signed-off-by: Claudiu Zissulescu +Signed-off-by: Vlad Zakharov +Signed-off-by: Alexey Brodkin + +Upstream-Status: Backport [https://gforge.inria.fr/scm/viewvc.php/mpfr?view=revision&revision=13251] +--- +Index: src/mpfr-longlong.h +=================================================================== +--- a/src/mpfr-longlong.h (revision 10963) ++++ b/src/mpfr-longlong.h (working copy) +@@ -416,17 +416,17 @@ + : "=r" (sh), \ + "=&r" (sl) \ + : "r" ((USItype) (ah)), \ +- "rIJ" ((USItype) (bh)), \ ++ "rICal" ((USItype) (bh)), \ + "%r" ((USItype) (al)), \ +- "rIJ" ((USItype) (bl))) ++ "rICal" ((USItype) (bl))) + #define sub_ddmmss(sh, sl, ah, al, bh, bl) \ + __asm__ ("sub.f\t%1, %4, %5\n\tsbc\t%0, %2, %3" \ + : "=r" (sh), \ + "=&r" (sl) \ + : "r" ((USItype) (ah)), \ +- "rIJ" ((USItype) (bh)), \ ++ "rICal" ((USItype) (bh)), \ + "r" ((USItype) (al)), \ +- "rIJ" ((USItype) (bl))) ++ "rICal" ((USItype) (bl))) + #endif + + #if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \ diff --git a/meta/recipes-support/mpfr/mpfr_4.0.1.bb b/meta/recipes-support/mpfr/mpfr_4.0.1.bb index f85a846e33..2eee76a357 100644 --- a/meta/recipes-support/mpfr/mpfr_4.0.1.bb +++ b/meta/recipes-support/mpfr/mpfr_4.0.1.bb @@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6" DEPENDS = "gmp autoconf-archive" -SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz" +SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz \ + file://0001-Fix-obsolete-ARC-asm-constraints.patch" SRC_URI[md5sum] = "b8dd19bd9bb1ec8831a6a582a7308073" SRC_URI[sha256sum] = "67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e"