From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id B0A7B3858D1E for ; Tue, 2 Jan 2024 08:54:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0A7B3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B0A7B3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::429 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704185652; cv=none; b=U49yUtc5E567KTvQiQZ45acm879BkQjrc0p0anixzQjgcWmSeJvairAxGvTXToLJDtW0jiu5cFJrs+m0nPwrXhaEdqV1YnG4zD5J3e9qKx3pzweOvPN9wJykdFqg55531t38NiHjaeDcXQardPzWaSAXjIsquZqXw1SJcZyS4QQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1704185652; c=relaxed/simple; bh=5D+n8GJ1pTsb9TBi2lPQgDRqqOE6V2PIRNI2F9yCAWo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=HlhAE6pZwO+pfAAgBi90WUCH+eDYepl/ImJM3CsDsJ9I5aswmcoqvEDGlC3fDBOtPqu5AfMzqu6E9phb17nHGm2V7Efu6VNtBkiIO55MrggleDMXSYm49LRhHUFDNPAIL1Cqwu71K6DVz06QlBn3iTWdAsFgb68zi6jT9yPe49c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-33678156e27so8527616f8f.1 for ; Tue, 02 Jan 2024 00:54:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704185645; x=1704790445; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5NNmcx7TBPLi2ciP9FevoCv9jZLtaLUY+av30BElAeo=; b=FFUPWxC+q6ogpubwcV3kcEwLf+55g4fkwGC9q8FwEcC8ulk80NrSxUh2RcnsAaQ2Oe xafI5TX9OTfmxWmlRFL8cLZ90lmq4xZbp14giChZsMHuzv2w8u6wWnoGAf4br2h9MG4G IipAcn/Eh4IkAKVKgg8uVSbE+jbyAH+DnQiTiVmem9NyI1RJB8otayOmy++celKP+LLX LQd3ZLdfC2Z505whRp6wOrX9BS/xVOb30LQu4UNgFE0DukKxcxvms8zbys/mpV26W5bz /2+k+JLkXum5h+0yETQr09BDL4ZvwCk8b+IoD7j34KZQa3nmUwXQduMkP38PTj0wXhJ+ 5d+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704185645; x=1704790445; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5NNmcx7TBPLi2ciP9FevoCv9jZLtaLUY+av30BElAeo=; b=ra2I5CuLkl1tHHXyjLfDmwGUeSkCBKKiKKo5bcopgqCrWZjq2wNHAuCkyPjiuiB1Yo 1di5OX4pQqjwtxeu8jr6HDxEUXVFHCzgGmmL7Emp6MPGlk/UkEewwPG03fkT3cwosXCt +mt6AEhc5jCXPApCjMoPTksWDD9GDmoZPsaK6hHMgOl0N7gN6X1t/iUaINxmI/8gSlGB u0sGViehXN0WXgV9wu9KhPbnM0CV9xWw/8otQii1W7Zk+i0be3DCNXEtrpcbLu2pvPMW aPR9d+FOd0nlPk7TFqhvsJjyu9wB9eotn7zXVZCR2rhO/jxcxecwaCN7H8HQqorU0UV7 wDJQ== X-Gm-Message-State: AOJu0YwQ5260KEv7oXChzDoKDMBl3ys3Ox1yKcynKEjKnYIxM/pQw7r4 uDXTEUh1MxVGR9KN9S6h0XpTvHgp9un6ElUBH60V/f8g0LA= X-Google-Smtp-Source: AGHT+IGmEBVC6QmLkr2u/DGR4Z8YeQsIxHel3kxMKQ31by4vS1Rjc60Y1hpKAbNYu9WycFhjQJ0/GOzjopDGz/X6bag= X-Received: by 2002:adf:f248:0:b0:336:7d12:fe4 with SMTP id b8-20020adff248000000b003367d120fe4mr9673406wrp.137.1704185644797; Tue, 02 Jan 2024 00:54:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: richard clark Date: Tue, 2 Jan 2024 16:53:53 +0800 Message-ID: Subject: Re: undefined reference to `__aarch64_cas4_sync' error on arm64 native build To: gcc-help@gcc.gnu.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ah, the driver is trying to use the native gcc built atomic ops like: __sync_val_compare_and_swap, but it seems the native aarch64 doesn't provide these builtin atomic primitives while they are in the cross compile toolchain. The issue can be resolved by replacing the **__sync_val_compare_and_swap** with **atomic_cmpxchg**. But don't know why the native aarch64 toolchain doesn't have those builtin atomic functions... On Tue, Jan 2, 2024 at 11:29=E2=80=AFAM richard clark wrote: > > Hi, > > I have a strong power arm64 box, and the linux distro is ubuntu 22.04, > the native gcc version is: > > $ gcc --version > gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 > Copyright (C) 2021 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is N= O > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS= E. > > It will abort the kernel build with the complaint by 'make Image': > ld: Unexpected GOT/PLT entries detected! > ld: Unexpected run-time procedure linkages detected! > ld: ID map text too big or misaligned > ld: drivers/net/nvidia_eth.o: in function `osi_lock_irq_enabled': > osi_hal.c:(.text+0x3cc): undefined reference to `__aarch64_cas4_sync' > ... > > But the cross-compile with aarch64-linux-gnu-gcc on the x86 box > doesn't show the above error message. > Any comments/suggestions? Thanks very much! > > Richard