From patchwork Tue Jan 29 01:08:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 1032421 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="sN8Xpipo"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.b="NbbMr4HC"; 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 43pT0Y67Qqz9sDK for ; Tue, 29 Jan 2019 12:09:01 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=EqkZJ+vrRKpQsQOh1XI8aQ+nhqxVAheMuHzcECuUhBA=; b=sN8XpipoVplWXy ykgOy/oYlBUz5kM6ozCfvNtNmz/MMxYwRedT0nrrWLUGX7/ioUGI8GuVdTbQSDbqVIEVVELAYdEbW L7QFsp0BqQf8YX4SF4JtxyxXsqirER6XIN5ZUlFyNw6lFLZoIrqNrq5jEbpx+5vg2AxG8OyyDZQ19 YfkTLCR2m8OxTUAGbutDqW0ogGmSscZ81x+9OEqq/ue/tdvgR/LRIBv7DFyrICf6MxyavrCcty/P+ EoWigMp6GeFlw4Vt1N/+CPotB8vxlD/SRvbvolwtWflzZadBl8RnTBRulzkvBOeGeVICpM9I5JHZd 4O4bZUFmL88qNSrHORTA==; 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 1goHtb-0003JC-R9; Tue, 29 Jan 2019 01:08:59 +0000 Received: from smtprelay4.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goHtX-0003IW-Sh for linux-snps-arc@lists.infradead.org; Tue, 29 Jan 2019 01:08:57 +0000 Received: from mailhost.synopsys.com (dc8-mailhost1.synopsys.com [10.13.135.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtprelay.synopsys.com (Postfix) with ESMTPS id C371B24E0A2C; Mon, 28 Jan 2019 17:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1548724130; bh=UoofcNMymXR3IHNLWOci9S1MURqWKvmQCf+bphHgZF8=; h=From:To:CC:Subject:Date:From; b=NbbMr4HCu4u6+Ox1l9CZyuarINzRq/RrU+8MR8E9bh2sYgBBTqTMj1Frc7df1eGIB AYU0XjocwDlIohXHi2ty2OHKH6T4QdlHVw8bOCncYi7pSxjMV0+KqNIZMSSGRcpSat KGluqfvyaimfV+gsDJL+LkOjd3ASyzDAeJ8FdhdpxRgUDfBmrXYh0qV026OOKE1ff6 ajdOTTRQ9cjuDoSzAKBD6Ez58RpgAWBRFyKuhi47/4iaMgqAT9i7F8SbvEKnX2gJUN 7UijiiAqbBOS7fsm8gcvQvza1Bc6AsSWHLr8GLIW3ooogE+H8k7OziCdWjP2Ec5sTY J3shvc4sc/Mug== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPS id 96806A006B; Tue, 29 Jan 2019 01:08:48 +0000 (UTC) Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.104) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 28 Jan 2019 17:08:19 -0800 Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.105) by IN01WEHTCA.internal.synopsys.com (10.144.199.103) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 29 Jan 2019 06:38:20 +0530 Received: from vineetg-Latitude-E7450.internal.synopsys.com (10.10.161.70) by IN01WEHTCB.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 29 Jan 2019 06:38:18 +0530 From: Vineet Gupta To: Subject: [PATCH] [ARC]: Enable init_array support Date: Mon, 28 Jan 2019 17:08:05 -0800 Message-ID: <1548724085-3713-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.10.161.70] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190128_170855_963561_EB000140 X-CRM114-Status: GOOD ( 10.52 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 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_EF Message has a valid DKIM or DK signature from envelope-from domain -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: Vineet Gupta , linux-snps-arc@lists.infradead.org, andrew.burgess@embecosm.com, Claudiu Zissulescu Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org gcc's common configure script has a subtle flaw that it only tests {init,fini.preinit}_array support when NOT cross compiling. This causes cross builds to erroneously deduce that the feature is not supported by the target. | host-gcc-final-ab544139bfee/build/gcc/config.log | |configure:22941: checking for .preinit_array/.init_array/.fini_array support |configure:23106: checking cross compile... guessing |configure:23111: result: no The right fix is to enable this for *all* cross setups (and address any fallouts). However in the short-term to enable ARC glibc port to upstream, force enable this for ARC. This has been discussed at length on glibc mailing list [1], [2] [1] https://sourceware.org/ml/libc-alpha/2018-11/msg00870.html [2] https://sourceware.org/ml/libc-alpha/2019-01/msg00656.html gcc/ 2019-xx-xx Vineet Gupta * gcc/config.gcc: Force .init_array for ARC Signed-off-by: Vineet Gupta Signed-off-by: Vineet Gupta --- gcc/ChangeLog | 4 ++++ gcc/config.gcc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f5872dbeab7c..4c86d5375bcc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-01-28 Vineet Gupta + + * gcc/config.gcc: Force .init_array for ARC + 2019-01-28 Jakub Jelinek PR middle-end/89002 diff --git a/gcc/config.gcc b/gcc/config.gcc index a189cb19f633..eef4b4eac918 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1110,6 +1110,9 @@ arc*-*-linux*) case ${with_endian} in big*) tm_file="arc/big.h ${tm_file}" esac + # Force .init_array support. The configure script cannot always + # automatically detect that GAS supports it, yet we require it. + gcc_cv_initfini_array=yes ;; arm-wrs-vxworks|arm-wrs-vxworks7) extra_options="${extra_options} arm/vxworks.opt"