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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9ECE2C7EE21 for ; Thu, 4 May 2023 11:46:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A95EC857A5; Thu, 4 May 2023 13:45:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="mGTYmX3K"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2E455855D9; Thu, 4 May 2023 09:55:25 +0200 (CEST) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 763FF827A6 for ; Thu, 4 May 2023 09:55:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=leo.yan@linaro.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1aae5c2423dso1103965ad.3 for ; Thu, 04 May 2023 00:55:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683186921; x=1685778921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eKyzOcXZxL3bzaSjNkOVe1Mxf8MNCKLkzmxj0G/rFHA=; b=mGTYmX3KHt657Vqz3UC5DwPmaVdvT9QtzZZ90IUgJ9/JL3Rw9pbSoAxdKtilbI0Zxz ixeq6QQ1THjOGVshBJtBeuGNZGqHNRW15bUUhSQNl/sryGSCLNV/6qUxInKCfaI1cFQe f/kMYZ/dWnC4MCi9tTwi1L8kFuoFtct9rm2HXvZ0SHHvFyHy3s91TkHz2eOyQcOpQpQh 1cm+4715h3BFxcDulf4TLmc4UsObVEVip7u73Zwlok8o8hKdgheiRF8hkSK9Ypg07eyS CZqLQ8IKlzzobLNOkL18540zwDEvLGyBsCFx7uAcN93lHocrq2EYZ3cDaDnHBAaTiuGl gpog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683186921; x=1685778921; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eKyzOcXZxL3bzaSjNkOVe1Mxf8MNCKLkzmxj0G/rFHA=; b=X83LRw4zR2wn5QjSyIWDC0foh52M0I9KuOdInfArlfNTT1Yavk+tnRLZxecPXGNHHS CIlgMv+vSjBN0Ut/c05kPKfrNaOU4ONQwGurfjKUhobnPJdJYPgtiBEZcF6hh3DCt0s1 kmBP2Rwv6/dTWI/OkqX/pbXxOZVQmJNJmOdZjivQkJAm1BXj5+nhtjG8OlFYdBT+KejQ H0TZBfzTiACkApxXo3Tf5RgQE8XNGnBvBDk7PmY5RX8Dxynvw1S2uB+K25HYOuCacJ2i 7VzhYp4mAagPH5ZkuX2hIp8ROJZnGYoFsByp5QmH8DncHkTY8Y/8/vD0Wb6uALlvYu4A PO6Q== X-Gm-Message-State: AC+VfDyQquAA0N/isGJikvl+pZjsiFm1CYnjBFcszHi2mo56Pe9bbinj xYSNkPviGSqYT5ZqRAmv9hdYlfPeswxp69P4VSUniA== X-Google-Smtp-Source: ACHHUZ7wyEpHVCr0oyn9ZwFIalxnDP5tVB+QZqzEdeaAwi10AtDiwZwQzEM2e1itoB9T8qcNBi2ucA== X-Received: by 2002:a17:902:b591:b0:1ab:8f4:af3a with SMTP id a17-20020a170902b59100b001ab08f4af3amr2402806pls.39.1683186920795; Thu, 04 May 2023 00:55:20 -0700 (PDT) Received: from leoy-yangtze.lan ([107.151.177.135]) by smtp.gmail.com with ESMTPSA id s18-20020a170902ea1200b001a4edbabad3sm7939104plg.230.2023.05.04.00.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 00:55:20 -0700 (PDT) From: Leo Yan To: u-boot@lists.denx.de, Andrii Anisov , Oleksandr Andrushchenko , Anastasiia Lukianenko Cc: Leo Yan Subject: [PATCH v1 2/2] doc: Add info for building Xen target with Clang Date: Thu, 4 May 2023 15:54:59 +0800 Message-Id: <20230504075459.59855-3-leo.yan@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230504075459.59855-1-leo.yan@linaro.org> References: <20230504075459.59855-1-leo.yan@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Thu, 04 May 2023 13:45:54 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When build Xen target with Clang, the linker reports failure. This patch adds the related info in the documentation as a known issue and gives details for how to dismiss the building failure with Clang. Signed-off-by: Leo Yan --- doc/build/clang.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/doc/build/clang.rst b/doc/build/clang.rst index 1d35616eb5..cc265506c2 100644 --- a/doc/build/clang.rst +++ b/doc/build/clang.rst @@ -74,3 +74,39 @@ simplified with a simple wrapper script - saved as #!/bin/sh exec clang -target arm-freebsd-eabi --sysroot /usr/arm-freebsd "$@" + + +Known Issues +------------ + +When build U-boot for `xenguest_arm64_defconfig` target, it reports linkage +error: + +.. code-block:: bash + + aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `do_hypervisor_callback': + /home/leoy/Dev2/u-boot/drivers/xen/hypervisor.c:188: undefined reference to `__aarch64_swp8_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_set_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/hypervisor.o: in function `synch_test_and_clear_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_clear_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:28: undefined reference to `__aarch64_ldclr1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/events.o: in function `synch_test_and_set_bit': + /home/leoy/Dev2/u-boot/./arch/arm/include/asm/xen/system.h:40: undefined reference to `__aarch64_ldset1_acq_rel' + aarch64-linux-gnu-ld.bfd: drivers/xen/gnttab.o: in function `gnttab_end_access': + /home/leoy/Dev2/u-boot/drivers/xen/gnttab.c:109: undefined reference to `__aarch64_cas2_acq_rel' + Segmentation fault + +To fix the failure, we need to append option `-mno-outline-atomics` in Clang +command to not generate local calls to out-of-line atomic operations: + +.. code-block:: bash + + make HOSTCC=clang xenguest_arm64_defconfig + make HOSTCC=clang CROSS_COMPILE=aarch64-linux-gnu- \ + CC="clang -target aarch64-linux-gnueabi -mno-outline-atomics" -j8 -- 2.39.2