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 DFAB1CD342F for ; Fri, 8 May 2026 17:23:50 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5EC5884CD2; Fri, 8 May 2026 19:23:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="gVdgL3yV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id ADD3984D17; Fri, 8 May 2026 19:23:48 +0200 (CEST) Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) (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 D3F0784CC3 for ; Fri, 8 May 2026 19:23:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-oi1-x243.google.com with SMTP id 5614622812f47-4756e74f8edso1607414b6e.1 for ; Fri, 08 May 2026 10:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1778261023; x=1778865823; darn=lists.denx.de; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lRKEF5hkwN/52Dc30/VH/gI4CiD8LdkD+SCT8J83k2w=; b=gVdgL3yVzjpMc20et6XG9nSb+41ieXhCoa2LwyrCQCgzQlyx+37/PL1o2MZrkw04Bv 3/+Y3xZsQDOvmb068y6nuG1EX40gU5VE5xsFUelS387tl5NPL0dhO079P0o9Qj3sIJ+H zgZkeBwoGTH+vVOMkJ+Q3GIQ81AYYi4t/MHi4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778261023; x=1778865823; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lRKEF5hkwN/52Dc30/VH/gI4CiD8LdkD+SCT8J83k2w=; b=FI14KeW6Rr2Y1v6YLEc67tdxvzS/vUMgVsZ4E6xrA+8WTIoStxOwMgWBbQLcKlExDL +//XQuy39i2NuBA1G4g2DmAFtTtEiorizXLSdngKu+pK/9HmMXog1zl54O/oGjIMPInC rUdLRnm4f2+LzEC9ZCUJBmv4fiiYpP/KgakucYNr5vpWnbGkcnOUTts/YEGLqnmJ22Jm nJsHJTBu948HRpLJEL3izdoaGJGkUisfINBS7TLaDRFQIEJE5euo3Rec4uZIMUhMl4ri 3OQtFdmlOOAMJJo7kEjEYWHiaUkWVT4nD0+lvI371+nGgqUqFRP9N+MpGeN23MlC/8LO HN8w== X-Forwarded-Encrypted: i=1; AFNElJ8RTOL2p3N84Jmprhxw+i9YXxzfUsZv6lmv4wtssoScOK9n292+6FhYwWUqTEM0SRo3c4DKmxs=@lists.denx.de X-Gm-Message-State: AOJu0YzvM9gxy/62ewfX3TyzEDr1q+zBQpQKOcik3vL8yhKaX3XwG5PI AD5Qqhz1Y8UKnbNQIWQx6kGC61ChpjgnjASzaI8u3C30URah3dMmGVOA09600aYqnaw= X-Gm-Gg: AeBDievRaq/2hOXx1xwgYr7LbvzrmpqIp01BCRsxQinWk1bGGuRU9QkpjtzEmNW5Bl0 rhadaEgu33qJPP52SQdPLDTAkI2qxreo+l6fmEcjzqoKdmy4DKhRJbHiYzNp0P1Q4Tfh34SrViE idUGU4mE5pGR8lzqQeMAnGIxUjm3CMHNw/69/0A+Y6E5gyacpYWtLctOz/jku/6O/l1F12lLncK 6qaFCPYVHmi2ZO9IDQjrg7S1jsix72CFelMC7ok4SqbllB8YDyNse4nxbQAdJtaHRX3ax01vo/E +32jgYfnzAtr9eV6EQGms6WKkY8UPo3ltjwpCu4g5Sy7ZMjotgters3vds7JFrHn0GYO0cLB+CM D4MdR+ioyIcHwZe/NH8a1tvPcx+/xhJgwE5vdA1FLHLAnOGrbZYD3PFpP9c3YpdF16Bnish6IHT mItkJwc0FQbAi35ju0+opwaw9d6r6I0gYVV2oWcQBrt/QrTJqA6YSJbB0kmRlEWvW69fQ/GKE+H ZcPs2qa6B0MuXmgQMH1Rpk9u5/UATtQkdStTGCX4cYhg1kDjMY= X-Received: by 2002:a05:6820:2110:b0:696:2b09:5988 with SMTP id 006d021491bc7-69998d268f0mr8095971eaf.40.1778261023258; Fri, 08 May 2026 10:23:43 -0700 (PDT) Received: from bill-the-cat (fixed-189-203-106-235.totalplay.net. [189.203.106.235]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435570ac21csm2275133fac.3.2026.05.08.10.23.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 May 2026 10:23:42 -0700 (PDT) Date: Fri, 8 May 2026 11:23:39 -0600 From: Tom Rini To: Quentin Schulz Cc: Quentin Schulz , u-boot@lists.denx.de, Simon Glass , Mattijs Korpershoek , David Lechner , Jerome Forissier , Heinrich Schuchardt , Marek Vasut , Simon Glass , Raymond Mao , Ilias Apalodimas , Michal Simek , Adriano Cordova , Sughosh Ganu , Yao Zi , Rasmus Villemoes Subject: Re: [PATCH RFC next 00/18] sync scripts/Makefile.extrawarn with 6.1, enable WERROR for host tools Message-ID: <20260508172339.GA1858239@bill-the-cat> References: <20260504-extrawarn-sync-v1-0-b19301d1948a@cherry.de> <20260504180429.GJ1614990@bill-the-cat> <20260505151007.GR1614990@bill-the-cat> <7250a64c-1942-4614-bef0-6f55a7becfd9@cherry.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ipuVjpea3i99kxIw" Content-Disposition: inline In-Reply-To: <7250a64c-1942-4614-bef0-6f55a7becfd9@cherry.de> X-Clacks-Overhead: GNU Terry Pratchett 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 --ipuVjpea3i99kxIw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 08, 2026 at 01:55:41PM +0200, Quentin Schulz wrote: > Hi Tom, >=20 > On 5/5/26 5:10 PM, Tom Rini wrote: > > On Tue, May 05, 2026 at 01:58:26PM +0200, Quentin Schulz wrote: > > > Hi Tom, > > >=20 > > > On 5/4/26 8:04 PM, Tom Rini wrote: > > > > On Mon, May 04, 2026 at 03:20:27PM +0200, Quentin Schulz wrote: > > > [...] > > > > > The first two patches are for fixing pytest calling make directly= on a > > > > > "dirty" build directory as generated by buildman using the clang-= 20 > > > > > toolchain, but pytest does not set HOSTCC and CC to clang-20, res= ulting > > > > > in clang flags being used with gcc). > > > > >=20 > > > > > One can simply reproduce it (after backporting up to patch > > > > > "scripts/Makefile.extrawarn: sync with 6.1") by doing so in the > > > > > container: > > > > >=20 > > > > > make HOSTCC=3Dclang-20 CC=3Dclang-20 O=3Dbuild/sandbox sandbox_de= fconfig > > > > > make HOSTCC=3Dclang-20 CC=3Dclang-20 O=3Dbuild/sandbox -j`nproc > > > > > make O=3Dbuild/sandbox u-boot-initial-env > > > > >=20 > > > > > It'll print: > > > > > gcc: error: unrecognized command-line option '-mno-global-merge' > > > > > gcc: error: unrecognized command-line option '-Wformat-invalid-sp= ecifier' > > > > > gcc: error: unrecognized command-line option '-Qunused-arguments' > > > > >=20 > > > > > This is essentially what's run within test_env_initial_env_file in > > > > > test/py/tests/test_env.py. > > > > >=20 > > > > > While I'm not unhappy with the patches to pytest, it feels to me = we may > > > > > be missing something else for the u-boot-initial-env make target = to > > > > > update the kconfig symbol based on the toolchain being used when = called. > > > >=20 > > > > Is there some other target in the Makefile that should catch this k= ind > > > > of change? It's not just that build target that needs to be remade,= it's > > > > everything, yes? > > > >=20 > > >=20 > > > For the reproducer, one actually needs to do > > >=20 > > > diff --git a/Makefile b/Makefile > > > index bd33437fdfd..9079131f81e 100644 > > > --- a/Makefile > > > +++ b/Makefile > > > @@ -1007,15 +1007,15 @@ KBUILD_CFLAGS +=3D $(call > > > cc-option,-Wno-format-nonliteral) > > > KBUILD_CFLAGS +=3D $(call cc-disable-warning, address-of-packed-mem= ber) > > >=20 > > > ifdef CONFIG_CC_IS_CLANG > > > -KBUILD_CPPFLAGS +=3D $(call cc-option,-Qunused-arguments,) > > > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, format-invalid-specifi= er) > > > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, gnu) > > > +KBUILD_CPPFLAGS +=3D -Qunused-arguments > > > +KBUILD_CFLAGS +=3D -Wno-format-invalid-specifier > > > +KBUILD_CFLAGS +=3D -Wno-gnu > > > # Quiet clang warning: comparison of unsigned expression < 0 is alw= ays > > > false > > > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, tautological-compare) > > > +KBUILD_CFLAGS +=3D -Wno-tautological-compare > > > # CLANG uses a _MergedGlobals as optimization, but this breaks modp= ost, as > > > the > > > # source of a reference will be _MergedGlobals and not on of the > > > whitelisted names. > > > # See modpost pattern 2 > > > -KBUILD_CFLAGS +=3D $(call cc-option, -mno-global-merge,) > > > +KBUILD_CFLAGS +=3D -mno-global-merge > > > else > > >=20 > > > # These warnings generated too much noise in a regular build. > > >=20 > > > Which is what's being done since kernel commit a1494304346a ("kbuild:= add > > > all Clang-specific flags unconditionally"). I actually had this in an > > > earlier version of this patch series and forgot I removed it. > > >=20 > > > This seems to apply to envtools and tools-only as well, though make p= rompts > > > me for the desired state of symbols that are now reachable, e.g. > > > ARM64_CRC32. And if I rerun the same command, then it works. It seems= like > > > the config from the previous run is used? I don't know if it's relate= d but > > > those two commands call make directly ($(Q)$(MAKE) $(build)=3D)= =2E Do you > > > have something in mind maybe? Or some more commands to run? > >=20 > > I think I partly misunderstood at first. It's not that we switch from > > one toolchain to another, it's that we can't (as easily) use gcc for the > > target and clang for host tools (and vice-versa) because of how flags > > are set now, yes? If so, how does this work in the kernel? > >=20 >=20 > I'm not sure what's happening so it's quite difficult to put into words. >=20 > Apply the following to the master branch: >=20 > diff --git a/Makefile b/Makefile > index 49d9740327e..9a2367f0a97 100644 > --- a/Makefile > +++ b/Makefile > @@ -999,15 +999,15 @@ KBUILD_CFLAGS +=3D $(call > cc-option,-Wno-format-nonliteral) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, address-of-packed-member) >=20 > ifdef CONFIG_CC_IS_CLANG > -KBUILD_CPPFLAGS +=3D $(call cc-option,-Qunused-arguments,) > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, format-invalid-specifier) > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, gnu) > +KBUILD_CPPFLAGS +=3D -Qunused-arguments > +KBUILD_CFLAGS +=3D -Wno-format-invalid-specifier > +KBUILD_CFLAGS +=3D -Wno-gnu > # Quiet clang warning: comparison of unsigned expression < 0 is always > false > -KBUILD_CFLAGS +=3D $(call cc-disable-warning, tautological-compare) > +KBUILD_CFLAGS +=3D -Wno-tautological-compare > # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, = as > the > # source of a reference will be _MergedGlobals and not on of the > whitelisted names. > # See modpost pattern 2 > -KBUILD_CFLAGS +=3D $(call cc-option, -mno-global-merge,) > +KBUILD_CFLAGS +=3D -mno-global-merge > KBUILD_CFLAGS +=3D $(call cc-option, -fcatch-undefined-behavior) > KBUILD_CFLAGS +=3D $(call cc-disable-warning, deprecated-non-prototype) > else >=20 >=20 > What I do: >=20 > make CROSS_COMPILE=3D"aarch64-linux-gnu-" O=3Dbuild/puma HOSTCC=3Dclang C= C=3Dclang > puma-rk3399_defconfig > make CROSS_COMPILE=3D"aarch64-linux-gnu-" O=3Dbuild/puma HOSTCC=3Dclang C= C=3Dclang > V=3D1 > make CROSS_COMPILE=3D"aarch64-linux-gnu-" O=3Dbuild/puma V=3D1 >=20 > That is, I configure the defconfig with clang selected as toolchain, > (successfully) build U-Boot with clang, then rebuild switching to gcc. >=20 > What happens is that the last make command prompts me for Kconfig symbols > that are now reachable and thus kconfig doesn't know what to do with them. >=20 > See the (NEW) entries below: >=20 > scripts/kconfig/conf --syncconfig Kconfig > * > * Restart config... > * > * > * ARM architecture > * > Enable support for CRC32 instruction (ARM64_CRC32) [Y/n/?] (NEW) >=20 > Timer clock frequency (COUNTER_FREQUENCY) [24000000] 24000000 > Generate position-independent pre-relocation code (POSITION_INDEPENDENT) > [N/y/?] n > Specify the early stack pointer relative to the .bss section > (INIT_SP_RELATIVE) [N/y/?] n > Emit virtualizable instructions (KVM_VIRT_INS) [N/y/?] n > ARM GICV2 driver (DRIVER_GICV2) [N/y/?] n > ARM GICV3 ITS (GIC_V3_ITS) [N/y/?] n > ARM GICV3 GIC600 SUPPORT (GICV3_SUPPORT_GIC600) [N/y/?] n > Do not enable icache (SYS_ICACHE_OFF) [N/y/?] n > Do not enable icache in SPL (SPL_SYS_ICACHE_OFF) [N/y/?] n > Do not enable dcache (SYS_DCACHE_OFF) [N/y/?] n > Do not enable dcache in SPL (SPL_SYS_DCACHE_OFF) [N/y/?] n > CP15 based cache enabling support (SYS_ARM_CACHE_CP15) [N/y/?] n > MMU-based Paged Memory Management Support (SYS_ARM_MMU) [N/y/?] n > Use the ARM v7 PMSA Compliant MPU (SYS_ARM_MPU) [N/y/?] n > Select the ARM data write cache policy > > 1. Write-back (WB) (SYS_ARM_CACHE_WRITEBACK) > 2. Write-through (WT) (SYS_ARM_CACHE_WRITETHROUGH) > 3. Write allocation (WA) (SYS_ARM_CACHE_WRITEALLOC) > choice[1-3?]: 1 > Enable ARCH_CPU_INIT (ARCH_CPU_INIT) [N/y/?] n > ARM Generic Timer support (SYS_ARCH_TIMER) [Y/n/?] y > Support for ARM SMC Calling Convention (SMCCC) (ARM_SMCCC) [Y/?] y > ARM PL310 L2 cache controller (SYS_L2_PL310) [N/y/?] n > ARM PL310 L2 cache controller in SPL (SPL_SYS_L2_PL310) [N/y/?] n > L2cache off (SYS_L2CACHE_OFF) [N/y/?] n > prepare BOOT0 header (ENABLE_ARM_SOC_BOOT0_HOOK) [Y/?] y > Use an assembly optimized implementation of memcpy (USE_ARCH_MEMCPY) [N/y= /?] > (NEW) >=20 > Use an assembly optimized implementation of memcpy for SPL > (SPL_USE_ARCH_MEMCPY) [N/y/?] n > Use an assembly optimized implementation of memcpy for TPL > (TPL_USE_ARCH_MEMCPY) [N/y/?] n > Use an assembly optimized implementation of memset (USE_ARCH_MEMSET) [N/y= /?] > (NEW) >=20 > Use an assembly optimized implementation of memset for SPL > (SPL_USE_ARCH_MEMSET) [N/y/?] n > Use an assembly optimized implementation of memset for TPL > (TPL_USE_ARCH_MEMSET) [N/y/?] n > ARM64 system support AArch32 execution state (ARM64_SUPPORT_AARCH32) [Y/n= /?] > y > Target select > 1. Airoha SoCs (ARCH_AIROHA) > 2. Atmel AT91 (ARCH_AT91) > 3. TI DaVinci (ARCH_DAVINCI) > 4. Hisilicon HiSTB SoCs (ARCH_HISTB) > 5. Marvell Kirkwood (ARCH_KIRKWOOD) > 6. Marvell MVEBU family (Armada XP/375/38x/3700/7K/8K) (ARCH_MVEBU) > 7. Broadcom BCM283X family (ARCH_BCM283X) > 8. Broadcom BCM7XXX family (ARCH_BCMSTB) > 9. Broadcom broadband chip family (ARCH_BCMBCA) > 10. Support vexpress_ca9x4 (TARGET_VEXPRESS_CA9X4) > 11. Support Broadcom Northstar (TARGET_BCMNS) > 12. Support Broadcom NS3 (TARGET_BCMNS3) > 13. Samsung EXYNOS (ARCH_EXYNOS) > 14. Samsung S5PC1XX (ARCH_S5PC1XX) > 15. Calxeda Highbank (ARCH_HIGHBANK) > 16. ARM Ltd. Integrator family (ARCH_INTEGRATOR) > 17. Qualcomm IPQ40xx SoCs (ARCH_IPQ40XX) > 18. TI Keystone (ARCH_KEYSTONE) > 19. Texas Instruments' K3 Architecture (ARCH_K3) > 20. TI OMAP2+ (ARCH_OMAP2PLUS) > 21. Amlogic Meson (ARCH_MESON) > 22. MediaTek SoCs (ARCH_MEDIATEK) > 23. Marvell MMP (ARCH_MMP) > 24. NXP LPC32xx platform (ARCH_LPC32XX) > 25. NXP i.MX8 platform (ARCH_IMX8) > 26. NXP i.MX8M platform (ARCH_IMX8M) > 27. NXP i.MX8ULP platform (ARCH_IMX8ULP) > 28. NXP i.MX9 platform (ARCH_IMX9) > 29. NXP i.MXRT platform (ARCH_IMXRT) > 30. NXP i.MX23 family (ARCH_MX23) > 31. NXP i.MX28 family (ARCH_MX28) > 32. NXP MX7ULP (ARCH_MX7ULP) > 33. Freescale MX7 (ARCH_MX7) > 34. Freescale MX6 (ARCH_MX6) > 35. Freescale MX5 (ARCH_MX5) > 36. Nexell S5P4418/S5P6818 SoC (ARCH_NEXELL) > 37. Support Nuvoton SoCs (ARCH_NPCM) > 38. Apple SoCs (ARCH_APPLE) > 39. Actions Semi OWL SoCs (ARCH_OWL) > 40. QEMU Virtual Platform (ARCH_QEMU) > 41. Renesas ARM SoCs (ARCH_RENESAS) > 42. Qualcomm Snapdragon SoCs (ARCH_SNAPDRAGON) > 43. Altera SOCFPGA family (ARCH_SOCFPGA) > 44. Support sunxi (Allwinner) SoCs (ARCH_SUNXI) > 45. ST-Ericsson U8500 Series (ARCH_U8500) > 46. Support Xilinx Versal Platform (ARCH_VERSAL) > 47. Support AMD Versal Gen 2 Platform (ARCH_VERSAL2) > 48. Support Xilinx Versal NET Platform (ARCH_VERSAL_NET) > 49. Freescale Vybrid (ARCH_VF610) > 50. Xilinx Zynq based platform (ARCH_ZYNQ) > 51. Xilinx ZynqMP R5 based platform (ARCH_ZYNQMP_R5) > 52. Xilinx ZynqMP based platform (ARCH_ZYNQMP) > 53. NVIDIA Tegra (ARCH_TEGRA) > 54. Support ARMv8 Arm Ltd. VExpress based boards and models > (ARCH_VEXPRESS64) > 55. Support Corstone1000 Platform (TARGET_CORSTONE1000) > 56. Support Total Compute Platform (TARGET_TOTAL_COMPUTE) > 57. Support ls2080a_emu (TARGET_LS2080A_EMU) > 58. Support ls1088aqds (TARGET_LS1088AQDS) > 59. Support ls2080aqds (TARGET_LS2080AQDS) > 60. Support ls2080ardb (TARGET_LS2080ARDB) > 61. Support ls2081ardb (TARGET_LS2081ARDB) > 62. Support lx2160ardb (TARGET_LX2160ARDB) > 63. Support lx2160aqds (TARGET_LX2160AQDS) > 64. Support lx2162aqds (TARGET_LX2162AQDS) > 65. Support HiKey 96boards Consumer Edition Platform (TARGET_HIKEY) > 66. Support HiKey960 96boards Consumer Edition Platform (TARGET_HIKEY96= 0) > 67. Support Poplar 96boards Enterprise Edition Platform (TARGET_POPLAR) > 68. Support ls1012aqds (TARGET_LS1012AQDS) > 69. Support ls1012ardb (TARGET_LS1012ARDB) > 70. Support ls1012a2g5rdb (TARGET_LS1012A2G5RDB) > 71. Support ls1012afrwy (TARGET_LS1012AFRWY) > 72. Support ls1012afrdm (TARGET_LS1012AFRDM) > 73. Support ls1028aqds (TARGET_LS1028AQDS) > 74. Support ls1028ardb (TARGET_LS1028ARDB) > 75. Support ls1088ardb (TARGET_LS1088ARDB) > 76. Support ls1021aqds (TARGET_LS1021AQDS) > 77. Support ls1021atwr (TARGET_LS1021ATWR) > 78. Support Hitachi-Powergrids SELI8 service unit card > (TARGET_PG_WCOM_SELI8) > 79. Support Hitachi-Powergrids EXPU1 service unit card > (TARGET_PG_WCOM_EXPU1) > 80. Support ls1021atsn (TARGET_LS1021ATSN) > 81. Support ls1021aiot (TARGET_LS1021AIOT) > 82. Support ls1043aqds (TARGET_LS1043AQDS) > 83. Support ls1043ardb (TARGET_LS1043ARDB) > 84. Support ls1046aqds (TARGET_LS1046AQDS) > 85. Support ls1046ardb (TARGET_LS1046ARDB) > 86. Support ls1046afrwy (TARGET_LS1046AFRWY) > 87. Analog Devices SC5XX-processor family (ARCH_SC5XX) > 88. Support sl28 (TARGET_SL28) > 89. Support ten64 (TARGET_TEN64) > 90. Socionext UniPhier SoCs (ARCH_UNIPHIER) > 91. Socionext SynQuacer SoCs (ARCH_SYNQUACER) > 92. Support STMicroelectronics STM32 MCU with cortex M (ARCH_STM32) > 93. Support STMicroelectronics SoCs (ARCH_STI) > 94. Support STMicroelectronics STM32MP Socs with cortex A (ARCH_STM32MP) > > 95. Support Rockchip SoCs (ARCH_ROCKCHIP) > 96. Support OcteonTX SoCs (ARCH_OCTEONTX) > 97. Support OcteonTX2 SoCs (ARCH_OCTEONTX2) > 98. Support ThunderX 88xx (TARGET_THUNDERX_88XX) > 99. Support Aspeed SoCs (ARCH_ASPEED) > 100. Support Phytium Durian Platform (TARGET_DURIAN) > 101. Support Phytium Pomelo Platform (TARGET_POMELO) > 102. Support Phytium PE2201 Platform (TARGET_PE2201) > 103. Support Cortina Presidio ASIC Platform (TARGET_PRESIDIO_ASIC) > 104. Xen guest ARM64 (TARGET_XENGUEST_ARM64) > 105. Support HPE GXP SoCs (ARCH_GXP) > choice[1-105?]: 95 > Support Rockchip PX30 (ROCKCHIP_PX30) [N/y/?] n > Support Rockchip RK3036 (ROCKCHIP_RK3036) [N/y/?] n > Support Rockchip RK3066 (ROCKCHIP_RK3066) [N/y/?] n > Support Rockchip RK3128 (ROCKCHIP_RK3128) [N/y/?] n > Support Rockchip RK3188 (ROCKCHIP_RK3188) [N/y/?] n > Support Rockchip RK3228/RK3229 (ROCKCHIP_RK322X) [N/y/?] n > Support Rockchip RK3288 (ROCKCHIP_RK3288) [N/y/?] n > Support Rockchip RK3308 (ROCKCHIP_RK3308) [N/y/?] n > Support Rockchip RK3328 (ROCKCHIP_RK3328) [N/y/?] n > Support Rockchip RK3368 (ROCKCHIP_RK3368) [N/y/?] n > Support Rockchip RK3399 (ROCKCHIP_RK3399) [Y/n/?] y > Support Rockchip RK3506 (ROCKCHIP_RK3506) [N/y/?] n > Support Rockchip RK3528 (ROCKCHIP_RK3528) [N/y/?] n > Support Rockchip RK3568 (ROCKCHIP_RK3568) [N/y/?] n > Support Rockchip RK3576 (ROCKCHIP_RK3576) [N/y/?] n > Support Rockchip RK3588 (ROCKCHIP_RK3588) [N/y/?] n > Support Rockchip RV1108 (ROCKCHIP_RV1108) [N/y/?] n > Support Rockchip RV1126 (ROCKCHIP_RV1126) [N/y/?] n > Route uart output to usb pins (ROCKCHIP_USB_UART) [N/y/?] n > SPL returns to bootrom (SPL_ROCKCHIP_BACK_TO_BROM) [N/y/?] n > TPL returns to bootrom (TPL_ROCKCHIP_BACK_TO_BROM) [Y/n/?] y > Rockchip common board file (ROCKCHIP_COMMON_BOARD) [Y/n/?] y > Rockchip SPL common board file (SPL_ROCKCHIP_COMMON_BOARD) [Y/n/?] y > Rockchip TPL common board file (TPL_ROCKCHIP_COMMON_BOARD) [Y/n/?] y > Use external TPL binary (ROCKCHIP_EXTERNAL_TPL) [N/y/?] n > Rockchip boot mode flag register address (ROCKCHIP_BOOT_MODE_REG) [0x0] 0= x0 > Disable device boot on power plug-in > (ROCKCHIP_RK8XX_DISABLE_BOOT_ON_POWERON) [N/y/?] n > Rockchip STIMER support (ROCKCHIP_STIMER) [Y/n/?] y > Size of IRAM reserved in SPL (ROCKCHIP_SPL_RESERVE_IRAM) [0x0] 0x0 > SPL requires early-return (for RK3188-style BROM) to BROM > (SPL_ROCKCHIP_EARLYRETURN_TO_BROM) [N/y/?] n > Disable force_jtag feature (ROCKCHIP_DISABLE_FORCE_JTAG) [Y/n/?] y > TPL requires early-return (for RK3188-style BROM) to BROM > (TPL_ROCKCHIP_EARLYRETURN_TO_BROM) [N/y/?] n > Build a SPI image for rockchip (ROCKCHIP_SPI_IMAGE) [Y/n/?] y > Build a maskrom mode image for Rockchip (ROCKCHIP_MASKROM_IMAGE) [N/y/?] n > RK3399 board select > 1. Asus Flip C101PA Chromebook (RK3399) (TARGET_CHROMEBOOK_BOB) > 2. Samsung Chromebook Plus (RK3399) (TARGET_CHROMEBOOK_KEVIN) > 3. RK3399 evaluation board (TARGET_EVB_RK3399) > 4. Pinebook Pro (TARGET_PINEBOOK_PRO_RK3399) > 5. PinePhone Pro (TARGET_PINEPHONE_PRO_RK3399) > > 6. Theobroma Systems RK3399-Q7 (Puma) (TARGET_PUMA_RK3399) > 7. Vamrs Limited Rock960 board family (TARGET_ROCK960_RK3399) > 8. Radxa ROCK Pi 4 board (TARGET_ROCKPI4_RK3399) > 9. Pine64 Rockpro64 board (TARGET_ROCKPRO64_RK3399) > 10. Firefly ROC-RK3399-PC board (TARGET_ROC_PC_RK3399) > choice[1-10?]: 6 > Theobroma Systems RK3399-Q7 DDR Option > > 1. DDR3-1333MHz (TARGET_PUMA_RK3399_RAM_DDR3_1333) > 2. DDR3-1600MHz (TARGET_PUMA_RK3399_RAM_DDR3_1600) > 3. DDR3-1866MHz (TARGET_PUMA_RK3399_RAM_DDR3_1866) > choice[1-3?]: 1 > Force cache maintenance to be exclusively by VA (CMO_BY_VA_ONLY) [N/y/?] n > Fix broken ARMv8 generic timer (ARMV8_CNTFRQ_BROKEN) [N/y/?] n > Install crash dump exception vectors (ARMV8_SPL_EXCEPTION_VECTORS) [N/y/?= ] n > Enable multiple CPUs to enter into U-Boot (ARMV8_MULTIENTRY) [N/y/?] n > Enable data coherency with other cores in cluster (ARMV8_SET_SMPEN) [Y/n/= ?] > y > Enable switching to running in EL1 (ARMV8_SWITCH_TO_EL1) [N/y/?] n > Use PSCI for reset and shutdown (PSCI_RESET) [Y/n/?] y > Enable PSCI support (ARMV8_PSCI) [N/y/?] n > External aborts and SError interrupt exception are taken in EL3 > (ARMV8_EA_EL3_FIRST) [N/y/?] n > Use the event stream for udelay (ARMV8_UDELAY_EVENT_STREAM) [N/y/?] n > * > * General setup > * > Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n > Compile U-Boot with warnings as errors (WERROR) [N/y/?] n > Local version - append to U-Boot release (LOCALVERSION) [] > Automatically append version information to the version string > (LOCALVERSION_AUTO) [Y/n/?] y > Optimization level > > 1. Optimize for size (CC_OPTIMIZE_FOR_SIZE) > 2. Optimize for speed (CC_OPTIMIZE_FOR_SPEED) > 3. Optimize for debugging (CC_OPTIMIZE_FOR_DEBUG) > choice[1-3?]: 1 > Allow compiler to uninline functions marked 'inline' in full U-Boot > (OPTIMIZE_INLINING) [N/y/?] n > Allow compiler to uninline functions marked 'inline' in SPL > (SPL_OPTIMIZE_INLINING) [N/y/?] n > Allow compiler to uninline functions marked 'inline' in TPL > (TPL_OPTIMIZE_INLINING) [N/y/?] n > Enable Link Time Optimizations (LTO) [N/y/?] n > Select U-Boot be run as a bootloader for XEN Virtual Machine (XEN) [N/y/?= ] n > Add arch, board, vendor and soc variables to default environment > (ENV_VARS_UBOOT_CONFIG) [Y/?] y > Number of DRAM banks (NR_DRAM_BANKS) [1] 1 > Enable kernel command line setup (SYS_BOOT_GET_CMDLINE) [N/y/?] n > Enable kernel board information setup (SYS_BOOT_GET_KBD) [N/y/?] n > Use a custom location for the initial stack pointer address > (HAS_CUSTOM_SYS_INIT_SP_ADDR) [Y/?] y > Static location for the initial stack pointer (CUSTOM_SYS_INIT_SP_ADDR) > [0x03f00000] 0x03f00000 > Enable malloc() pool before relocation (SYS_MALLOC_F) [Y/?] y > Size of malloc() pool before relocation (SYS_MALLOC_F_LEN) [0x10000] > 0x10000 > Define memory for Dynamic allocation (SYS_MALLOC_LEN) [0x2000000] 0x20000= 00 > Enable malloc() pool in SPL (SPL_SYS_MALLOC_F) [Y/n/?] y > Size of malloc() pool in SPL (SPL_SYS_MALLOC_F_LEN) [0x8000] 0x8000 > Enable malloc() pool in TPL (TPL_SYS_MALLOC_F) [Y/n/?] y > Size of malloc() pool in TPL (TPL_SYS_MALLOC_F_LEN) [0x4000] 0x4000 > Inform valgrind about memory allocations (VALGRIND) [N/y/?] n > 64bit physical address support (PHYS_64BIT) [Y/?] y > 64bit fdt address support (FDT_64BIT) [Y/?] y > SPL image used in the combined SPL+U-Boot image (SPL_IMAGE) > [spl/u-boot-spl.bin] spl/u-boot-spl.bin > Recreate an ELF image from raw U-Boot binary (REMAKE_ELF) [N/y/?] n > Build target special images (BUILD_TARGET) [] > Define a maximum size for the U-Boot image (HAS_BOARD_SIZE_LIMIT) [N/y/?]= n > Use a custom location for the U-Boot linker script (SYS_CUSTOM_LDSCRIPT) > [N/y/?] n > Address in memory to use by default (SYS_LOAD_ADDR) [0x800800] 0x800800 > Define max stack size that can be used by U-Boot (STACK_SIZE) [0x1000000] > 0x1000000 > Exclude some memory from U-Boot / OS information (SYS_MEM_TOP_HIDE) [0x0] > 0x0 > Maximum size in bytes reserved for U-Boot in memory (SYS_MONITOR_LEN) [0]= 0 > Support for multiprocessor (MP) [N/y/?] n > Text Base (TEXT_BASE) [0x00800000] 0x00800000 > Use custom U-Boot Start (HAVE_SYS_UBOOT_START) [N/y/?] n > Determine CPU clock frequency at run-time (DYNAMIC_SYS_CLK_FREQ) [N/y/?] n > CPU clock frequency (SYS_CLK_FREQ) [0] 0 > Enable U-Boot API (API) [N/y/?] (NEW) >=20 > Then it continues with the build, but using the flags for clang while usi= ng > GCC, see: >=20 > make -f /home/qschulz/work/upstream/u-boot/scripts/Makefile.autoconf || \ > { rm -f include/config/auto.conf; false; } > mkdir -p include/asm > if [ -d /home/qschulz/work/upstream/u-boot/arch/arm/mach-rk3399/include/m= ach > ]; then \ > dest=3Darch/arm/mach-rk3399/include/mach; \ > else \ > dest=3Darch/arm/include/asm/arch-rk3399; \ > fi; \ > ln -fsn /home/qschulz/work/upstream/u-boot/$dest include/asm/arch > set -e; mkdir -p include/; trap "rm -f include/.config.h.tmp" EXIT; { (ec= ho > "/* Automatically generated - do not edit */"; echo \#define CFG_BOARDDIR > board/theobroma-systems/puma_rk3399; echo \#include > \ ; echo \#include \; echo > \#include \; echo \#include \;); }= > > include/.config.h.tmp; if [ ! -r include/config.h ] || ! cmp -s > include/config.h include/.config.h.tmp; then : ' UPD include/config.h'; = mv > -f include/.config.h.tmp include/config.h; fi > aarch64-linux-gnu-gcc -E -Wall -Werror=3Dstrict-prototypes -Wno-trigrap= hs > -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE > -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int > -Wno-format-security -std=3Dgnu11 -ffreestanding -fno-builtin > -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation > -Wno-format-overflow -Wno-int-in-bool-context -Wno-address-of-packed-memb= er > -Os -fno-stack-protector -fno-delete-null-pointer-checks > -Wno-zero-length-bounds -Wno-array-bounds -Wno-stringop-overflow > -Wno-maybe-uninitialized > -fmacro-prefix-map=3D/home/qschulz/work/upstream/u-boot/=3D -gdwarf-4 > -fstack-usage -Wno-format-nonliteral -Wno-address-of-packed-member > -Wno-format-invalid-specifier -Wno-gnu -Wno-tautological-compare > -mno-global-merge -Wno-pointer-sign -D__KERNEL__ -D__UBOOT__ > -Qunused-arguments -D__ARM__ -ffunction-sections -fdata-sections > -fno-common -ffixed-x18 -pipe -Iinclude > -I/home/qschulz/work/upstream/u-boot/include > -I/home/qschulz/work/upstream/u-boot/arch/arm/include -include > /home/qschulz/work/upstream/u-boot/include/linux/kconfig.h -nostdinc > -isystem /usr/lib/gcc/aarch64-linux-gnu/15/include -DDO_DEPS_ONLY -dM > include/config.h > u-boot.cfg.tmp && { grep 'define CONFIG_' u-boot.cfg.t= mp > | sed '/define CONFIG_IS_ENABLED(/d;/define CONFIG_IF_ENABLED_INT(/d;/def= ine > CONFIG_VAL(/d;' > u-boot.cfg; rm u-boot.cfg.tmp; } || { rm u-boot.cfg.tmp; > false; } > aarch64-linux-gnu-gcc: error: unrecognized command-line option > =E2=80=98-mno-global-merge=E2=80=99; did you mean =E2=80=98-Wno-global-mo= dule=E2=80=99? > aarch64-linux-gnu-gcc: error: unrecognized command-line option > =E2=80=98-Qunused-arguments=E2=80=99 > make[2]: *** > [/home/qschulz/work/upstream/u-boot/scripts/Makefile.autoconf:84: > u-boot.cfg] Error 1 > make[1]: *** No rule to make target 'include/config/auto.conf', needed by > 'include/config/uboot.release'. Stop. > make: *** [Makefile:189: __sub-make] Error 2 >=20 > If I do nothing but call > make CROSS_COMPILE=3D"aarch64-linux-gnu-" O=3Dbuild/puma V=3D1 > again, it'll work just fine and compile with GCC flags with the GCC > toolchain (well, I don't get an error anymore, so I'm assumign that what's > happening :) ). So it seems to me that the symbols as used in Makefile > depend on the previous make command generating the .config and syncconfig= is > running "too late". >=20 > Contrary to what I initially thought, it's not actually related to U-Boot > host tools. >=20 > I'm not attempting to mix GCC and clang for host/target building, and I > don't know if this would work in any case. I don't know if this is someth= ing > we want to support anyway. As for what the Linux kernel does, they > document[1] LLVM/clang support by telling the user to essentially use LLV= M=3D1 > which they claim is an alias to: > CC=3Dclang LD=3Dld.lld AR=3Dllvm-ar NM=3Dllvm-nm STRIP=3Dllvm-strip \ > OBJCOPY=3Dllvm-objcopy OBJDUMP=3Dllvm-objdump READELF=3Dllvm-readelf \ > HOSTCC=3Dclang HOSTCXX=3Dclang++ HOSTAR=3Dllvm-ar HOSTLD=3Dld.lld >=20 > They don't really hint at CC and HOSTCC being different as being an optio= n. > Maybe it works, maybe it doesn't? >=20 > I did test in the Linux kernel whether they had the same issue but it > doesn't seem like it is the case. >=20 > [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html Ah, thanks. I'm tempted to say this is something that'll just not work until we can also switch to following the kernel way of invoking clang? But maybe it's a problem missing dependencies somewhere (not leading to some cmd file being recreated in time), rather than more missing changes. --=20 Tom --ipuVjpea3i99kxIw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTzzqh0PWDgGS+bTHor4qD1Cr/kCgUCaf4cFAAKCRAr4qD1Cr/k CoBqAQDbllr/567GPmGIOYOWCiTian9XeBauriu4eqtiR6BLIQD+KfmpdMPhYhN2 AK0Ir/5KHaPflNQQggOEeNYoi+AcbwA= =Csc5 -----END PGP SIGNATURE----- --ipuVjpea3i99kxIw--