From patchwork Tue Sep 20 02:14:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1680021 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=Fd582L0E; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=K2et9pR8; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX0qc3Kb1z1ypH for ; Tue, 20 Sep 2022 22:15:24 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 313253520783; Tue, 20 Sep 2022 14:15:09 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=Fd582L0E; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=K2et9pR8; dkim-atps=neutral Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by helium.openadk.org (Postfix) with ESMTPS id 5F7563520661 for ; Tue, 20 Sep 2022 14:14:35 +0200 (CEST) Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28K5pWtv027572 for ; Tue, 20 Sep 2022 05:14:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=tbtmtc+erQ0ti1lultyrhSnaxc732mPGE8n5O0YuNvo=; b=Fd582L0EmfOsxa6TIipX8jRvIXxdxfSmBGdV7RsTkVSNBoWWsdPJV8JRGx1zGTBp0v7z sw7tAtUxIn2QDa3tD+7+kMOEGE3RQt0hvLYhuhJzgYuETIMjH1BmDy/QN+Df4dFJOB4G UOJqR51Ou0+NLIB/6VIMuYEukCBM5UVrUf9EtLCI5eOOpXOYxbmU2Qtr9MoKck4LFkyo 3Iri8cwR0DJaru6SaQXQzJAoIGpUt1R+JY756yEkeOIkfbCz0+NBUeziaQmr9oly9D5u C9PQEdDVSkRMdSCg737Jy9rS3BAvqYHxqtvs8dY4NOKCSA50fs5kftAMZ18VIKRmOByI Dg== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3jndg4phku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Sep 2022 05:14:33 -0700 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id CB3D740086 for ; Tue, 20 Sep 2022 12:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1663676073; bh=bft8kDNGVRvBLOB1b62rWdL3fEoFYb70UrkS+AER1kE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K2et9pR8ixP04paliRe3QSx+lGa3WAa5a2+gCU7MEpYpGV/nRLYaJUCg9j0Y955BI 5c8zS88vRz0Z/EARO8Tbo0kkiapH8m4DCJD+YG72r86rnIKiO8qh7OGOkEJ9t6YSQ+ SzOO9QDHFPtstG6gPyqNHAJ26roAnrhzsi85ImML4JOG5yY1TJmo1XaN0BuRXJsTs9 IgHGbaTmVwA958KDGHtW+cKeIg5gtjuwqY6HNiOr0H96Jg/eBJdsN54SIy0xUvowiZ B2IyErnkDpgDzPvqqVIux5NBLbQHpocF4jal4v4XsJtZ0xoGDX0oK3O0KYSchFl/YM tvOdGQxji2tTA== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.108.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 0786DA0230; Tue, 20 Sep 2022 12:14:30 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: devel@uclibc-ng.org Date: Tue, 20 Sep 2022 16:14:18 +0400 Message-Id: <20220920121421.31618-2-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920121421.31618-1-kozlov@synopsys.com> References: <20220920121421.31618-1-kozlov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: 3wInCVeE37eEKsicFwDjj6F_zj6c5MEB X-Proofpoint-ORIG-GUID: 3wInCVeE37eEKsicFwDjj6F_zj6c5MEB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=807 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209200073 Message-ID-Hash: 4EZQ4NAKK5PSY6J553H54WKJEHFA3EI2 X-Message-ID-Hash: 4EZQ4NAKK5PSY6J553H54WKJEHFA3EI2 X-MailFrom: Pavel.Kozlov@synopsys.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alexey.Brodkin@synopsys.com X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 1/4] arc: minor cleanup for ARCv2 List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Sergey Matyukevich Add missing ARCv2 check in MATCH_MACHINE macro. Update comment for EM_ARCV2 define. Signed-off-by: Sergey Matyukevich Signed-off-by: Pavel Kozlov --- include/elf.h | 2 +- utils/ldd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/elf.h b/include/elf.h index 7d66d70a43ac..018ff1550dae 100644 --- a/include/elf.h +++ b/include/elf.h @@ -270,7 +270,7 @@ typedef struct #define EM_METAG 174 /* Imagination Technologies Meta */ #define EM_AARCH64 183 /* ARM AARCH64 */ #define EM_MICROBLAZE 189 /* Xilinx Microblaze */ -#define EM_ARCV2 195 /* ARCv2 Cores */ +#define EM_ARCV2 195 /* Synopsys ARCv2 Cores */ #define EM_RISCV 243 /* RISC-V */ #define EM_CSKY 252 /* C-SKY Cores */ #define EM_KVX 256 /* Kalray VLIW core of the MPPA processor family */ diff --git a/utils/ldd.c b/utils/ldd.c index dfc4ee9a5431..3accd78391d7 100644 --- a/utils/ldd.c +++ b/utils/ldd.c @@ -30,7 +30,7 @@ #endif #if defined(__arc__) -#define MATCH_MACHINE(x) (x == EM_ARCOMPACT) +#define MATCH_MACHINE(x) (x == EM_ARCOMPACT || x == EM_ARCV2) #define ELFCLASSM ELFCLASS32 #endif From patchwork Tue Sep 20 02:14:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1680020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=ZckY2vwz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=Y64pJAkT; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX0qV5TDzz1ypH for ; Tue, 20 Sep 2022 22:15:18 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id CDB1F3520781; Tue, 20 Sep 2022 14:15:04 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=ZckY2vwz; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=Y64pJAkT; dkim-atps=neutral Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by helium.openadk.org (Postfix) with ESMTPS id 68D133520668 for ; Tue, 20 Sep 2022 14:14:35 +0200 (CEST) Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28K5pXdr027646 for ; Tue, 20 Sep 2022 05:14:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=uR2e5PTumhYQl+WHOt4qcO6l9Z3hQxEcoRgwpaBUImc=; b=ZckY2vwzLUU0mvEnw5ZyEsoNC3nmfsheUmS7V+YxXowxSJ/OfkPU2YlPgZyb18vXPhgh 1jeGg23NUKmTq5O2kQpOVcJfHBU1CzTpG0ZYVnK4lR6/GsAlyL9N9SiSi/b2N2v/hvvH IPEwsAKSe831bulBOxvj2NFyQFKSYMpd2WstOrUDDN6NmESHfNpaR7jGq6SGoS3Nj9Dl GO56cGi0bd4P/VJrufk4y68DdGZZVox4QEBio5+057smkMFW9bxFGMfsFDGri0PGPz5N 1+l0NtJZxGnwuedSGULPx9Bcw1gSHbj/AE5mXeU3BQ5MXyI2H1ZfySi+RL96UA6UQ5Dn uA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3jndg4phkv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Sep 2022 05:14:33 -0700 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 006F9400BA for ; Tue, 20 Sep 2022 12:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1663676073; bh=m9K1ERbTyDi5wAeM6SCKYE4gpOF80nNLbPAuPH6f8wQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y64pJAkT3mZWfsRbcSjmioYIxd95O5yBj189YeYojCWx9LJge3KW7/oDj91a7SEwU hDCwubXvVEG1ciZ6vbNhL+zIYfe5uHnYY4saSuXcEFwiveM+22qYVaP73kvQu1yh9m bJ2S13Jdy9jF/q1EUD3XXkG8jTuyfzF6dj+9sa83ke1pA0JuQmpSt2S9qCmAmLFTUX o2+2zrVOWVvMxXnElTjUI+Tk2XLDjx84Dm3UZnPxycCYLOvIG8Ej8UWDTR5UpRCFG0 CU3D+g0Jkg8GgEC923hRGt6HT7FiTFLg9ehAxWgEesgdO4T1yZgDDwpG1hlMZE0nvU 7BTIFB7O0g2uQ== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.108.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 6F0A9A0231; Tue, 20 Sep 2022 12:14:31 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: devel@uclibc-ng.org Date: Tue, 20 Sep 2022 16:14:19 +0400 Message-Id: <20220920121421.31618-3-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920121421.31618-1-kozlov@synopsys.com> References: <20220920121421.31618-1-kozlov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: 81puYTkFIwN0wSIiQko9w1rYAi6ar413 X-Proofpoint-ORIG-GUID: 81puYTkFIwN0wSIiQko9w1rYAi6ar413 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209200073 Message-ID-Hash: C62OHSIEHDBJI4MXVTJHQ4KDCY743SRP X-Message-ID-Hash: C62OHSIEHDBJI4MXVTJHQ4KDCY743SRP X-MailFrom: Pavel.Kozlov@synopsys.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alexey.Brodkin@synopsys.com X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 2/4] ldso: arc: add compiler option check List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Sergey Matyukevich Option '-mno-long-calls' is not supported by all arc gcc compilers. For instance, this option is not supported by GCC for ARCv3 processors. Check if this option is supported before applying it. Signed-off-by: Sergey Matyukevich Signed-off-by: Pavel Kozlov --- ldso/ldso/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in index 4f2a184545f0..2d3886d735da 100644 --- a/ldso/ldso/Makefile.in +++ b/ldso/ldso/Makefile.in @@ -38,7 +38,8 @@ CFLAGS-ldso.c += -DLDSO_MULTILIB_DIR=\"$(MULTILIB_DIR)\" endif ifeq ($(TARGET_ARCH),arc) -CFLAGS-ldso.c += -mno-long-calls +$(eval $(call check-gcc-var,-mno-long-calls)) +CFLAGS-ldso.c += $(CFLAGS_-mno-long-calls) endif LDFLAGS-$(UCLIBC_FORMAT_DSBT_ELF)-$(UCLIBC_LDSO_NAME).so := -Wl,--dsbt-index=1 From patchwork Tue Sep 20 02:14:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1680018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=fqNyOmIK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=IoU/0dce; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX0pz55zfz1ypS for ; Tue, 20 Sep 2022 22:14:49 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 101CA352077F; Tue, 20 Sep 2022 14:14:40 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=fqNyOmIK; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=IoU/0dce; dkim-atps=neutral Received: from mx0a-00230701.pphosted.com (mx0a-00230701.pphosted.com [148.163.156.19]) by helium.openadk.org (Postfix) with ESMTPS id 9CAA43520669 for ; Tue, 20 Sep 2022 14:14:35 +0200 (CEST) Received: from pps.filterd (m0297266.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28K5pYMp027853 for ; Tue, 20 Sep 2022 05:14:33 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=1nqfMExlyC+8RiDLyE5UYvH1MEEpI4g8SATCWCMdDRQ=; b=fqNyOmIK/K/HxN+45Q+VwkgBXFfFvTbmjIhaFfNzDPyf+rUJQ98Rmq2gstyiwoacsE3T 6mYqMFpyUVFHnSCWc6q9q4tLaFqWIzqiJRQGmhXpHY4Azc4TGzIwBdRfOiAYIAUsgEb1 qapj3Tuy5qtzG+GWsx0BN8Ta1oVToHiwkDSFzWoJie7P1pWsZ0gptz0v1xkM8qR0MM14 IzGk5F3ryLcpPSEvbqyfCXETycH+0hJ/JB9QIh7LXjML0KYol2WyPdzmPsANqVHhSdIX RETCt7hjHFXSXbzh8/1v7CkAiwkgGEpt7JTwRoicEId93AIEc00I+ZvMn4+SgPEHiZr+ tA== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.73.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3jndg4phkw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Sep 2022 05:14:33 -0700 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 5E2A8400E5 for ; Tue, 20 Sep 2022 12:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1663676073; bh=pK/d8QXIXKT5ihuovMqeqQN3CY6x2PSqGR0r5wOLzE8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IoU/0dceRpx43SKr6HdiVt14BI0J/xUpM8Ffzkv7Q5F2hDjWE0rd2cVbOV9Rkv4ly zwsE4OCcdPXFrFjtwxpFI2e8sOHxWvtW67R1ys+AexozMpsoR7QK/atS2WO9dqijTI TOI/4rPDoFEu+G+Hp64pv2dWjzJVtJvxeOHFNw8mVQWAaiGjKf4D34mRrnivifTBSF hTT7K1xI1A2cPIFphHqc4bjt6fMvqyVUR0yNy1fJ6mKMkCzuVxtIdXqcqNybbjpRuc QFBSAlBySCCBIKQAV9OiPHW++8jEDrX8L+Xgz1XNerUTZyMGvpPgZgXkxei+Bc2uT5 7rjVdvHGqVxWA== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.108.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id D2D5EA022E; Tue, 20 Sep 2022 12:14:31 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: devel@uclibc-ng.org Date: Tue, 20 Sep 2022 16:14:20 +0400 Message-Id: <20220920121421.31618-4-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920121421.31618-1-kozlov@synopsys.com> References: <20220920121421.31618-1-kozlov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: OQbnALdUeXCGX5xDD1LR4bMjnpoKzThi X-Proofpoint-ORIG-GUID: OQbnALdUeXCGX5xDD1LR4bMjnpoKzThi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=658 spamscore=0 suspectscore=0 adultscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209200073 Message-ID-Hash: DNYHKYEF3OPJFMUDXPIBDQQSHKIAIYHO X-Message-ID-Hash: DNYHKYEF3OPJFMUDXPIBDQQSHKIAIYHO X-MailFrom: Pavel.Kozlov@synopsys.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alexey.Brodkin@synopsys.com X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 3/4] arc: add asm macros List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Sergey Matyukevich Add a header file with assembler macros to be able to handle in one place the differences between ARCv2 and ARCv3 ISAs. It is a preparatory step before the introduction of support for ARCv3 CPUs. Signed-off-by: Sergey Matyukevich Signed-off-by: Pavel Kozlov --- ldso/ldso/arc/resolve.S | 45 ++++++++++++++++++------------------ libc/sysdeps/linux/arc/asm.h | 28 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 22 deletions(-) create mode 100644 libc/sysdeps/linux/arc/asm.h diff --git a/ldso/ldso/arc/resolve.S b/ldso/ldso/arc/resolve.S index 891f66b97008..2b66c69cb5db 100644 --- a/ldso/ldso/arc/resolve.S +++ b/ldso/ldso/arc/resolve.S @@ -4,6 +4,7 @@ * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. */ +#include #include #include @@ -12,30 +13,30 @@ ; r10-r12 are already clobbered by PLTn, PLT0 thus neednot be saved .macro SAVE_CALLER_SAVED - push_s r0 - push_s r1 - push_s r2 - push_s r3 - st.a r4, [sp, -4] - st.a r5, [sp, -4] - st.a r6, [sp, -4] - st.a r7, [sp, -4] - st.a r8, [sp, -4] - st.a r9, [sp, -4] - push_s blink + PUSHR_S r0 + PUSHR_S r1 + PUSHR_S r2 + PUSHR_S r3 + PUSHR r4 + PUSHR r5 + PUSHR r6 + PUSHR r7 + PUSHR r8 + PUSHR r9 + PUSHR_S blink .endm .macro RESTORE_CALLER_SAVED_BUT_R0 - ld.ab blink,[sp, 4] - ld.ab r9, [sp, 4] - ld.ab r8, [sp, 4] - ld.ab r7, [sp, 4] - ld.ab r6, [sp, 4] - ld.ab r5, [sp, 4] - ld.ab r4, [sp, 4] - pop_s r3 - pop_s r2 - pop_s r1 + POPR blink + POPR r9 + POPR r8 + POPR r7 + POPR r6 + POPR r5 + POPR r4 + POPR_S r3 + POPR_S r2 + POPR_S r1 .endm ; Upon entry, PLTn, which led us here, sets up the following regs @@ -53,5 +54,5 @@ ENTRY(_dl_linux_resolve) RESTORE_CALLER_SAVED_BUT_R0 j_s.d [r0] ; r0 has resolved function addr - pop_s r0 ; restore first arg to resolved call + POPR_S r0 ; restore first arg to resolved call END(_dl_linux_resolve) diff --git a/libc/sysdeps/linux/arc/asm.h b/libc/sysdeps/linux/arc/asm.h new file mode 100644 index 000000000000..f98eb239fe15 --- /dev/null +++ b/libc/sysdeps/linux/arc/asm.h @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2022, Synopsys, Inc. (www.synopsys.com) + * + * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball. + */ + +#ifndef _ARC_ASM_H +#define _ARC_ASM_H + + +.macro PUSHR reg + push \reg +.endm + +.macro PUSHR_S reg + push_s \reg +.endm + +.macro POPR reg + pop \reg +.endm + +.macro POPR_S reg + pop_s \reg +.endm + + +#endif /* _ARC_ASM_H */ From patchwork Tue Sep 20 02:14:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Kozlov X-Patchwork-Id: 1680023 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=D8WdQteY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=acWhGG5/; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MX0qs0Q2jz1ypH for ; Tue, 20 Sep 2022 22:15:37 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id A6D3E3520788; Tue, 20 Sep 2022 14:15:21 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=pfptdkimsnps header.b=D8WdQteY; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=synopsys.com header.i=@synopsys.com header.a=rsa-sha256 header.s=mail header.b=acWhGG5/; dkim-atps=neutral Received: from mx0b-00230701.pphosted.com (mx0b-00230701.pphosted.com [148.163.158.9]) by helium.openadk.org (Postfix) with ESMTPS id 1D3CF3520668 for ; Tue, 20 Sep 2022 14:14:37 +0200 (CEST) Received: from pps.filterd (m0297265.ppops.net [127.0.0.1]) by mx0a-00230701.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28K5pXmf007727 for ; Tue, 20 Sep 2022 05:14:35 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=synopsys.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pfptdkimsnps; bh=vATWxppTy8TcyZgleaHBjd0a0Rvd4Q/OWJZxnrv+1TU=; b=D8WdQteYxPrvdXmbKROw2/tcV0pVERB9bY4hYtxn47q1vDy1OhIufdtKMLuQgYWx3Ord iWEq2ef3BE9f25wVTwuADwtbalvuQF4itxrPCArPZk30j4U/SqxBSaLQcqciMmbwyRcO 9YEO+rucZwOidBED38ybXKjkn2sj1nfC4H/1u96/YoJmL1WEa/t6FL+1nmf2P3tvFqU3 SI9qmSojvnZI+QcyyECXol1b3sM3LYePmCNChKrrsep2Xw/3ITU9n/wdsV1xwTD576An ifvNcihUlz0JJdSAs6zx0xJRy8F+hD+FDawfgQVRGCzDRxfMBYId75mLkHiBQIiMPkow 5A== Received: from smtprelay-out1.synopsys.com (smtprelay-out1.synopsys.com [149.117.87.133]) by mx0a-00230701.pphosted.com (PPS) with ESMTPS id 3jnd5txfye-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 20 Sep 2022 05:14:35 -0700 Received: from mailhost.synopsys.com (mdc-mailhost1.synopsys.com [10.225.0.209]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mailhost.synopsys.com", Issuer "SNPSica2" (verified OK)) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id 3114FC07EB for ; Tue, 20 Sep 2022 12:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1663676074; bh=/1QxuVy6Kgn2bYWYthNt9qGAPEe7jG2EVYg3WMq9GLs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=acWhGG5/6ZFl6NOd2CmLo3tz8sR8GQGgE1B6jNs+9oGYQJ8b/CjPC/BPEFguCqfS3 r5ECa35wFU9DMlebC/KUspOGdTPT6D5yLMHVNpk22lNlXJB6fudsVhs45JJPa3rH55 WBoqZogU0ZW4zXINiIWqVCno7VUSk1vCfbZufS+Ib9J4BGk+LS6LvzqbPcOzhLyIyg a/vEZMhCFeQgK5cmvM8RtBUJK7SHwN538yL+qgvSO6guft3HrsKOJZ6oAvAxDhZIck CGr4b4pV0QYJLZ8jWoI2BW0K+dwMYmbGVDg13ZRIPT7nUVZAMvICFhx5QjR6DlM5kc WonG2QJWOTzLQ== Received: from SNPS-o0WHuHJU73.internal.synopsys.com (snps-o0whuhju73.internal.synopsys.com [10.116.108.115]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client did not present a certificate) by mailhost.synopsys.com (Postfix) with ESMTPSA id 41B57A0234; Tue, 20 Sep 2022 12:14:32 +0000 (UTC) X-SNPS-Relay: synopsys.com From: Pavel.Kozlov@synopsys.com To: devel@uclibc-ng.org Date: Tue, 20 Sep 2022 16:14:21 +0400 Message-Id: <20220920121421.31618-5-kozlov@synopsys.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220920121421.31618-1-kozlov@synopsys.com> References: <20220920121421.31618-1-kozlov@synopsys.com> MIME-Version: 1.0 X-Proofpoint-GUID: GB8gviFcBrOmE83PzYOZIz1xiffK9FqH X-Proofpoint-ORIG-GUID: GB8gviFcBrOmE83PzYOZIz1xiffK9FqH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-20_04,2022-09-16_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_active_cloned_notspam policy=outbound_active_cloned score=0 bulkscore=0 phishscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxlogscore=716 spamscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209200073 Message-ID-Hash: SCMSNOBC26FGLVFBHB24MIQ36BXY2Z77 X-Message-ID-Hash: SCMSNOBC26FGLVFBHB24MIQ36BXY2Z77 X-MailFrom: Pavel.Kozlov@synopsys.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Alexey.Brodkin@synopsys.com X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 4/4] arc: add support for ARCv3 32-bit processors List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Sergey Matyukevich New ARCv3 ISA includes both 64-bit and 32-bit CPU family. This patch adds support for 32-bit ARCv3 HS5x processors. Signed-off-by: Sergey Matyukevich Signed-off-by: Pavel Kozlov --- include/elf.h | 1 + ldso/ldso/arc/dl-sysdep.h | 3 +++ libc/sysdeps/linux/arc/asm.h | 24 ++++++++++++++++++++++++ libc/sysdeps/linux/arc/bits/syscalls.h | 4 ++-- libc/sysdeps/linux/arc/crt1.S | 4 +++- utils/ldd.c | 5 +++++ 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/include/elf.h b/include/elf.h index 018ff1550dae..b7edbade2e46 100644 --- a/include/elf.h +++ b/include/elf.h @@ -273,6 +273,7 @@ typedef struct #define EM_ARCV2 195 /* Synopsys ARCv2 Cores */ #define EM_RISCV 243 /* RISC-V */ #define EM_CSKY 252 /* C-SKY Cores */ +#define EM_ARCV3_32 255 /* Synopsys ARCv3 32-bit Cores */ #define EM_KVX 256 /* Kalray VLIW core of the MPPA processor family */ /* NEXT FREE NUMBER: Increment this after adding your official arch number */ diff --git a/ldso/ldso/arc/dl-sysdep.h b/ldso/ldso/arc/dl-sysdep.h index ed8b37205cc4..c8915511a761 100644 --- a/ldso/ldso/arc/dl-sysdep.h +++ b/ldso/ldso/arc/dl-sysdep.h @@ -75,6 +75,9 @@ do { \ #elif defined(__HS__) #define MAGIC1 EM_ARCV2 #define ELF_TARGET "ARCv2" /* For error messages */ +#elif defined(__ARC64_ARCH32__) +#define MAGIC1 EM_ARCV3_32 +#define ELF_TARGET "ARCv3_32" /* For error messages */ #endif #undef MAGIC2 diff --git a/libc/sysdeps/linux/arc/asm.h b/libc/sysdeps/linux/arc/asm.h index f98eb239fe15..f15dff841aec 100644 --- a/libc/sysdeps/linux/arc/asm.h +++ b/libc/sysdeps/linux/arc/asm.h @@ -7,6 +7,29 @@ #ifndef _ARC_ASM_H #define _ARC_ASM_H +#if defined (__ARC64_ARCH32__) + +.macro PUSHR reg + push \reg +.endm + +.macro PUSHR_S reg + push \reg +.endm + +.macro POPR reg + pop \reg +.endm + +.macro POPR_S reg + pop \reg +.endm + +#elif defined (__ARC64_ARCH64__) + +# error ARCv3 64-bit is not supported by uClibc-ng + +#else /* ARCHS || ARC700 */ .macro PUSHR reg push \reg @@ -24,5 +47,6 @@ pop_s \reg .endm +#endif #endif /* _ARC_ASM_H */ diff --git a/libc/sysdeps/linux/arc/bits/syscalls.h b/libc/sysdeps/linux/arc/bits/syscalls.h index c858d788be8c..000b6b6310b1 100644 --- a/libc/sysdeps/linux/arc/bits/syscalls.h +++ b/libc/sysdeps/linux/arc/bits/syscalls.h @@ -100,7 +100,7 @@ extern long __syscall_error (int); #ifdef __A7__ #define ARC_TRAP_INSN "trap0 \n\t" -#elif defined(__HS__) +#else #define ARC_TRAP_INSN "trap_s 0 \n\t" #endif @@ -182,7 +182,7 @@ extern long __syscall_error (int); #ifdef __A7__ #define ARC_TRAP_INSN trap0 -#elif defined(__HS__) +#else #define ARC_TRAP_INSN trap_s 0 #endif diff --git a/libc/sysdeps/linux/arc/crt1.S b/libc/sysdeps/linux/arc/crt1.S index 70a06e058d3b..ff36d252e9d7 100644 --- a/libc/sysdeps/linux/arc/crt1.S +++ b/libc/sysdeps/linux/arc/crt1.S @@ -40,7 +40,9 @@ __start: ld_s r1, [sp] ; argc mov_s r5, r0 ; rltd_fini - add_s r2, sp, 4 ; argv + /* Use the universal 32-bit add instruction as 16-bit add_s was excluded from + ARCv3 ISA */ + add r2, sp, 4 ; argv #ifdef L_Scrt1 ld r0, [pcl, @main@gotpc] ld r3, [pcl, @_init@gotpc] diff --git a/utils/ldd.c b/utils/ldd.c index 3accd78391d7..46cd97170433 100644 --- a/utils/ldd.c +++ b/utils/ldd.c @@ -34,6 +34,11 @@ #define ELFCLASSM ELFCLASS32 #endif +#if defined(__ARC64_ARCH32__) +#define MATCH_MACHINE(x) (x == EM_ARCV3_32) +#define ELFCLASSM ELFCLASS32 +#endif + #if defined(__arm__) || defined(__thumb__) #define MATCH_MACHINE(x) (x == EM_ARM) #define ELFCLASSM ELFCLASS32