From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47BA7C4707C for ; Wed, 10 Jan 2024 14:13:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Mime-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=848hjJbKAC1sQZ9rioH2zqqV26k5UH96HnpMoDdkkJQ=; b=b+SdCsVBimiF42 hAsLl1Qrr+i7z8t7t5znsxqqsoryaWFG6PUIizThjGG0TKPZEsWGDZL5LCEuylxs91XpoFQRUnJw5 s2BjYroYwpCrFT2ibdk3sOpQM13d+QRukl3c5k7HiM9+AKKSICLiZUTS4ELN21jmTcdrEy/dJ/4NK 0bOFuNqkJ4h7eT07sSdyy7VgcZDz9PuM4BWL3NsGyzsf4T8Du6Q2YPSqkH2XxIAk8mqw82NbIPtN2 geuF9UFqj+j63/ppLYadptEzw7+Dd+iFq9xigNyx/8yzrj0qPubYyjOyoZnD8750SmjghEPL09equ bqF3LOeLi8m0d84+ocBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNZKa-00CEEW-1z; Wed, 10 Jan 2024 14:13:20 +0000 Received: from gate.crashing.org ([63.228.1.57]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rNZKW-00CEBF-2U for linux-arm-kernel@lists.infradead.org; Wed, 10 Jan 2024 14:13:19 +0000 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> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240110_061316_958039_48603BB5 X-CRM114-Status: GOOD ( 11.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel