Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1017624rdd; Wed, 10 Jan 2024 06:24:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOO2+XqtGJFBFXy8OFAoHEchVtmRqL0ZsjQIfDGa3H/aXm4uPmBJnUpAowAq3ZXPuBRDa/ X-Received: by 2002:a17:90a:f414:b0:28c:ea35:44f8 with SMTP id ch20-20020a17090af41400b0028cea3544f8mr930640pjb.79.1704896682959; Wed, 10 Jan 2024 06:24:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704896682; cv=none; d=google.com; s=arc-20160816; b=PZYx489okzbkplo7QETeMLUN47QpyffQv15vMCIHfzrAzUCsx88Zkl3FoGPJVJ+4mO 2CyjEN8jgH00pEqu0GZGPJc6CkEiAwzScFjfGPj9CkZENoxDx6AATzgX2WY59SV1lzs9 vm4gijTSZxRbgyBbTIQ8XSjcVgWVFytuZ9T5sRZigzf69COxR7nferP37LLeapTgDXz4 /TqNFLUH/HV7nbPGqMaASiPOrmmdij+BKKuU/y5SGFlv5wGSQ2fHfkfRCUfXJtZ9Wy0y xBsBENCaVrRy6a7hinFVVFNGxv/SbfdAWS3g1j6mmcTC0/B1aixlap91MauJJ0o9mJ7L 0gAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=YPz2fG/6q3uyzpMLjsqImR0YqKpi1Vqg46HlriOS0wA=; fh=WKcCfRfJe4Yt9QywXvmfIYz9kxxsySnD3/LM4oqsSwA=; b=ttVpV1/Ree2i6Noi5jQLzrkB1GG+MgWAbXT0UM6MJh1HsdgrsdaTXbFsNMPk0U81GS ZBUSGuYaqCQ+T27zr1xHIEwB4pdLk21A2fZyDUI3c06doVL5DCP3iTL1rYtlmKS1NoDo QSq+X7b7T8xxl1wH8iG3mTDVokNJvcX1ex488a44WVQF0KVSKGW/H4ps862L7dGmhtoU nyp+QcUpmbCs9YMAvDKF7zhqAGuVcm0YuZ16+jLcJ6PSREiunPNil0o0xzI4f2X981qt fAQlTPSvt/7/wupXXwLBJ83fDk7r0jNBEDkr5DlLId0ZflU466+qVXz5L2RR+9+utIW0 XX0Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22329-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b9-20020a17090a8c8900b0028cd9049885si1517841pjo.67.2024.01.10.06.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 06:24:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-22329-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22329-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B0899B26DB5 for ; Wed, 10 Jan 2024 14:15:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A81834CDF5; Wed, 10 Jan 2024 14:13:29 +0000 (UTC) Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 170454CDE1 for ; Wed, 10 Jan 2024 14:13:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 40AEA6vC017173; Wed, 10 Jan 2024 08:10:07 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 40AEA6Zg017172; Wed, 10 Jan 2024 08:10:06 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Wed, 10 Jan 2024 08:10:05 -0600 From: Segher Boessenkool To: richard clark Cc: Xi Ruoyao , Mark Rutland , gcc-help@gcc.gnu.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: undefined reference to `__aarch64_cas4_sync' error on arm64 native build Message-ID: <20240110141005.GL19790@gate.crashing.org> References: <9aef98eed96ed32962ce90499291cb30ad5e3e14.camel@xry111.site> <20240109074843.GI19790@gate.crashing.org> <4ee8067e72028b070d92e10fa33ddde3a498cb48.camel@xry111.site> <20240109082647.GJ19790@gate.crashing.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i On Wed, Jan 10, 2024 at 01:59:53PM +0800, richard clark wrote: > A ported driver in linux kernel calls '__sync_val_compare_and_swap', That is a builtin function. It does not necessarily expand to an actual function call. aarch64 will typically expand it to inline code. > the cross-compiler 'aarch64-linux-gnu-gcc' doesn't complain > '__aarch64_cas1_sync' undefined reference, but the native compiler > will complain. As Mark mentioned, I double check that both cross and > native compiler should have ''-moutline-atomics' option enabled, do > you know the reason for that? Ah, so you are requesting external functions. I am no aarch64 expert, but apparently there were some problems in GCC 11, maybe that is what you saw? Or with some distros, anyway. It also matters if you have ARMv8.1-A enabled, the LSE instructions. Open a GCC bug report if you have more details? Thanks, Segher