All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: clang-built-linux <llvm@lists.linux.dev>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: arm ixp4xx_defconfig build failure with linux-next and mainline
Date: Thu, 28 Jul 2022 12:57:54 -0700	[thread overview]
Message-ID: <YuLqQrKtDnTuJdZK@dev-arch.thelio-3990X> (raw)
In-Reply-To: <CADVatmPNCUXqKBoLCpwBA90ocZA6-u+=y1_jz=3C+KwEmN54AA@mail.gmail.com>

On Thu, Jul 28, 2022 at 06:33:07PM +0100, Sudip Mukherjee wrote:
> Hi All,
> 
> Not sure if its reported, builds of arm ixp4xx_defconfig has been
> failing with clang with the error:
> 
> <instantiation>:1:10: error: invalid hexadecimal number
> ldr r7, =0x
>          ^
> arch/arm/kernel/head.S:319:2: note: while in macro instantiation
>  addruart r7, r3, r0
>  ^
> <instantiation>:2:12: error: invalid hexadecimal number
>   ldr r3, =0x
>            ^
> arch/arm/kernel/head.S:319:2: note: while in macro instantiation
>  addruart r7, r3, r0
> 
> 
> I tried to find it in the issue tracker but could not find it.

Thanks for the report! We have not tested all of the configs in
arch/arm/configs so I am not surprised to find one that has an error.

I see multiple definitions of addruart. If I preprocess
arch/arm/kernel/head.S with this configuration, I see it comes from
arch/arm/include/debug/8250.S:

		.macro	addruart, rp, rv, tmp
		ldr	\rp, =CONFIG_DEBUG_UART_PHYS
		ldr	\rv, =CONFIG_DEBUG_UART_VIRT
		.endm

CONFIG_DEBUG_UART_PHYS and CONFIG_DEBUG_UART_VIRT are both empty for
this configuration with LLVM=1:

$ make -skj"$(nproc)" ARCH=arm LLVM=1 ixp4xx_defconfig

$ rg "CONFIG_DEBUG_UART_(PHYS|VIRT)=" .config
3036:CONFIG_DEBUG_UART_PHYS=
3037:CONFIG_DEBUG_UART_VIRT=

Looking at arch/arm/Kconfig.debug, I see:

config DEBUG_UART_PHYS
...
	default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
	default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
...

config DEBUG_UART_VIRT
...
	default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
	default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
...

Digging further, I don't see how this configuration can work with
LD=ld.lld (implied by LLVM=1). Commit 5d6f52671e76 ("ARM: rework
endianess selection") made it so that CONFIG_ARCH_IXP4XX cannot be
selected without CONFIG_CPU_BIG_ENDIAN due to the "depends" but
CONFIG_CPU_BIG_ENDIAN in turn cannot be selected with LD=ld.lld due to
commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN depends on
!LD_IS_LLD"), meaning that none of these "default" statements can
trigger.

I see two solutions for the immediate future (I've CC'd Arnd in case he
has any thoughts):

* Use LD=arm-linux-gnueabi-ld (or whatever your triple is) with this
  configuration if you want to keep testing it.

* Don't build this configuration altogether.

Maybe we could hack up a sane default value for these configurations but
that is just going to give the false impression that this kernel will
work because it builds, when it can't because the ARCH config is not
even selectable to get all of the other configurations that are needed
for everything to work properly.

The real solution is either:

* Make ixp4xx work in little endian mode (but commit 3d427228f7370 casts
  some doubts about whether or not that is possible).

* Make ld.lld work properly with CONFIG_CPU_BIG_ENDIAN but given how
  little use big endian sees for ARM targets, that probably won't happen
  for a while, if at all.

As always, I am happy to be proven wrong if I have missed something :)

Cheers,
Nathan

  reply	other threads:[~2022-07-28 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 17:33 arm ixp4xx_defconfig build failure with linux-next and mainline Sudip Mukherjee
2022-07-28 19:57 ` Nathan Chancellor [this message]
2022-07-31 11:57   ` Arnd Bergmann
2022-08-01 23:03     ` Nathan Chancellor
2022-08-02  9:43       ` Sudip Mukherjee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YuLqQrKtDnTuJdZK@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=llvm@lists.linux.dev \
    --cc=sudipm.mukherjee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.