From patchwork Tue Jul 16 21:50:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Brodkin X-Patchwork-Id: 1132960 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=synopsys.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="gVm+0okD"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.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 45pDbL6KtZz9s8m for ; Wed, 17 Jul 2019 07:50:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ACAA087C30; Tue, 16 Jul 2019 21:50:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8DZDPnkhUtj8; Tue, 16 Jul 2019 21:50:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E5F9A877F1; Tue, 16 Jul 2019 21:50:12 +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 32D7F1BF29A for ; Tue, 16 Jul 2019 21:50:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2E9D385C77 for ; Tue, 16 Jul 2019 21:50:12 +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 q3ZkwpFJm3ci for ; Tue, 16 Jul 2019 21:50:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay-out1.synopsys.com (dc2-smtprelay2.synopsys.com [198.182.61.142]) by whitealder.osuosl.org (Postfix) with ESMTPS id E8C2E85C0B for ; Tue, 16 Jul 2019 21:50:10 +0000 (UTC) Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 23B84C127C; Tue, 16 Jul 2019 21:50:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1563313809; bh=VO9U/jvdzDDGqflvZfsJuChIqNvvsziaay8eE3bhw8c=; h=From:To:Cc:Subject:Date:From; b=gVm+0okDwXIFivHX2OeJ1xcEBs8wEXVpz56EM8iVhaDRgEU+J/UbwZuut1egVwfo0 azJ9oZ9WdQmbaEXG9u061+hoIhdG0h06zYIhHE4nBoZjyMglUoPo8pleRNYdupWNjh RBsRGFVh+a0xjroqh/DkqfQtfWF8OS3/KJZY03/qT/hVJkes18WEhNqH7NqOIWd/Hv 4Ex0rK8Uzm9gjum/AQ41jrUIcagWIWFpYu8Y7JGAeiwP0KXcbhK/V1hVRsCdf47bcJ Uf3hSns5L4dknB46J8c8VOAhPJVanE99pBoBo5b57MhS71M8CzGD2rN8lJfGKwyUU+ tZqYe9B/vbh+A== Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id B92CBA0057; Tue, 16 Jul 2019 21:50:04 +0000 (UTC) From: Alexey Brodkin To: buildroot@buildroot.org Date: Wed, 17 Jul 2019 00:50:01 +0300 Message-Id: <20190716215001.9181-1-abrodkin@synopsys.com> X-Mailer: git-send-email 2.16.2 Subject: [Buildroot] [PATCH] package/gcc: arc-2019.03/9.1.0: Fix compilation of glibc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Evgeniy Didin , Alexey Brodkin , arc-buildroot@synopsys.com, Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When storing a TLS symbol to memory, always use an intermediate register to load it. Otherwise compiler generates instruction which couldn't be encoded and we see: ----------------------------->8--------------------------- In file included from gethstent_r.c:34: ../nss/getXXent_r.c: In function '__gethostent_r': ../nss/getXXent_r.c:168:1: error: unrecognizable insn: } ^ (insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) (const_int 16 [0x10])) [0 S4 A32]) (plus:SI (reg:SI 25 r25) (reg:SI 174))) "../nss/getXXent_r.c":160 -1 (nil)) during RTL pass: vregs ../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 In file included from getnetent_r.c:34: ../nss/getXXent_r.c: In function '__getnetent_r': ../nss/getXXent_r.c:168:1: error: unrecognizable insn: } ^ (insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) (const_int 16 [0x10])) [0 S4 A32]) (plus:SI (reg:SI 25 r25) (reg:SI 174))) "../nss/getXXent_r.c":160 -1 (nil)) during RTL pass: vregs ../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 ----------------------------->8--------------------------- Note this patch is not yet submitted to the GCC's master and gcc-9-branch but will be submitted soon. That said with bump of GCC for ARC this patch won't be needed any longer. Signed-off-by: Alexey Brodkin Cc: Thomas Petazzoni Cc: Arnout Vandecappelle Cc: Evgeniy Didin --- .../9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch | 61 ++++++++++++++++++++++ .../0002-ARC-Fix-emitting-TLS-symbols.patch | 61 ++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch create mode 100644 package/gcc/arc-2019.03-release/0002-ARC-Fix-emitting-TLS-symbols.patch diff --git a/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch b/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch new file mode 100644 index 0000000000..15df921290 --- /dev/null +++ b/package/gcc/9.1.0/0002-ARC-Fix-emitting-TLS-symbols.patch @@ -0,0 +1,61 @@ +From d17cd0f88ed986be4046b2eb70240dc95b2958cd Mon Sep 17 00:00:00 2001 +From: Claudiu Zissulescu +Date: Wed, 26 Jun 2019 17:53:51 +0300 +Subject: [PATCH 2/2] [ARC] Fix emitting TLS symbols. + +When storing a TLS symbol to memory, always use an intermediate register +to load it. Otherwise compiler generates instruction which couldn't be +encoded and we see: +----------------------------->8--------------------------- +In file included from gethstent_r.c:34: +../nss/getXXent_r.c: In function '__gethostent_r': +../nss/getXXent_r.c:168:1: error: unrecognizable insn: + } + ^ +(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) + (const_int 16 [0x10])) [0 S4 A32]) + (plus:SI (reg:SI 25 r25) + (reg:SI 174))) "../nss/getXXent_r.c":160 -1 + (nil)) +during RTL pass: vregs +../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +In file included from getnetent_r.c:34: +../nss/getXXent_r.c: In function '__getnetent_r': +../nss/getXXent_r.c:168:1: error: unrecognizable insn: + } + ^ +(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) + (const_int 16 [0x10])) [0 S4 A32]) + (plus:SI (reg:SI 25 r25) + (reg:SI 174))) "../nss/getXXent_r.c":160 -1 + (nil)) +during RTL pass: vregs +../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +----------------------------->8--------------------------- + +Note this patch is not yet submitted to the GCC's master and gcc-9-branch but +will be submitted soon. That said with bump of GCC this patch won't be +needed any longer. + +Signed-off-by: Claudiu Zissulescu +Signed-off-by: Alexey Brodkin +--- + gcc/config/arc/arc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c +index daacc79d0cb..ee1f70bbb51 100644 +--- a/gcc/config/arc/arc.c ++++ b/gcc/config/arc/arc.c +@@ -8951,7 +8951,7 @@ prepare_move_operands (rtx *operands, machine_mode mode) + if (GET_CODE (operands[1]) == SYMBOL_REF) + { + enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); +- if (MEM_P (operands[0]) && flag_pic) ++ if (MEM_P (operands[0])) + operands[1] = force_reg (mode, operands[1]); + else if (model) + operands[1] = arc_legitimize_tls_address (operands[1], model); +-- +2.16.2 + diff --git a/package/gcc/arc-2019.03-release/0002-ARC-Fix-emitting-TLS-symbols.patch b/package/gcc/arc-2019.03-release/0002-ARC-Fix-emitting-TLS-symbols.patch new file mode 100644 index 0000000000..b6e5c0ee83 --- /dev/null +++ b/package/gcc/arc-2019.03-release/0002-ARC-Fix-emitting-TLS-symbols.patch @@ -0,0 +1,61 @@ +From a971faaf8fb48acbf48ca800634fc78a27581517 Mon Sep 17 00:00:00 2001 +From: Claudiu Zissulescu +Date: Wed, 26 Jun 2019 17:53:51 +0300 +Subject: [PATCH] [ARC] Fix emitting TLS symbols. + +When storing a TLS symbol to memory, always use an intermediate register +to load it. Otherwise compiler generates instruction which couldn't be +encoded and we see: +----------------------------->8--------------------------- +In file included from gethstent_r.c:34: +../nss/getXXent_r.c: In function '__gethostent_r': +../nss/getXXent_r.c:168:1: error: unrecognizable insn: + } + ^ +(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) + (const_int 16 [0x10])) [0 S4 A32]) + (plus:SI (reg:SI 25 r25) + (reg:SI 174))) "../nss/getXXent_r.c":160 -1 + (nil)) +during RTL pass: vregs +../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +In file included from getnetent_r.c:34: +../nss/getXXent_r.c: In function '__getnetent_r': +../nss/getXXent_r.c:168:1: error: unrecognizable insn: + } + ^ +(insn 25 24 26 5 (set (mem:SI (plus:SI (reg/f:SI 149 virtual-outgoing-args) + (const_int 16 [0x10])) [0 S4 A32]) + (plus:SI (reg:SI 25 r25) + (reg:SI 174))) "../nss/getXXent_r.c":160 -1 + (nil)) +during RTL pass: vregs +../nss/getXXent_r.c:168:1: internal compiler error: in extract_insn, at recog.c:2304 +----------------------------->8--------------------------- + +Note this patch is not yet submitted to the GCC's master and gcc-9-branch but +will be submitted soon. That said with bump of GCC for ARC this patch won't be +needed any longer. + +Signed-off-by: Claudiu Zissulescu +Signed-off-by: Alexey Brodkin +--- + gcc/config/arc/arc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c +index 8b544efaa11..989bec703df 100644 +--- a/gcc/config/arc/arc.c ++++ b/gcc/config/arc/arc.c +@@ -9068,7 +9068,7 @@ prepare_move_operands (rtx *operands, machine_mode mode) + if (GET_CODE (operands[1]) == SYMBOL_REF) + { + enum tls_model model = SYMBOL_REF_TLS_MODEL (operands[1]); +- if (MEM_P (operands[0]) && flag_pic) ++ if (MEM_P (operands[0])) + operands[1] = force_reg (mode, operands[1]); + else if (model) + operands[1] = arc_legitimize_tls_address (operands[1], model); +-- +2.16.2 +