On Sat, Apr 04, 2020 at 02:59:16PM -0700, Nathan Chancellor wrote: > On Sat, Apr 04, 2020 at 09:15:31PM +0800, Jiaxun Yang wrote: > > On Fri, 3 Apr 2020 18:32:04 -0700 > > Fangrui Song wrote: > > > > > > > > Reproduce for a clang/lld developer: > > > > > > make -j$(nproc) ARCH=mips CC=clang CROSS_COMPILE=mipsel-linux-gnu- > > > LD=ld.lld O=/tmp/out/mipsel distclean malta_defconfig vmlinux > > > (Requires mipsel-linux-gnu-as and clang in PATH) > > > > > > I have noticed multiple problems. > > > > > > % file .tmp_vmlinux.kallsyms1 > > > .tmp_vmlinux.kallsyms1: ELF 32-bit LSB executable, MIPS, MIPS32 rel2 > > > version 1 (SYSV), statically linked, > > > BuildID[sha1]=ff348ad92c80e525b3f14149e57e8987de66e041, not stripped > > > > > > In arch/mips/kernel/vmlinux.lds.S, VMLINUX_LOAD_ADDRESS (from load-y) > > > is 0xffffffff8010000. GNU ld seems to allow 64-bit addresses when > > > linking an ELFCLASS32 file. The addresses will be truncated to > > > 32-bit. This behavior seems error-prone to me. > > > > > > lld does the right thing by erroring out. I do notice a display > > > problem of lld -Map and I have a patch to address that: > > > https://reviews.llvm.org/D77445 > > > > > > For 32-bit linux-mips, the right approach seems to be make > > > VMLINUX_LOAD_ADDRESS fit into 32-bit. However, my Linux-fu and > > > MIPS-fu is not strong enough to do this :/ > > > > Hi MaskRay, > > > > Could you please try this? > > > > --- a/arch/mips/mti-malta/Platform > > +++ b/arch/mips/mti-malta/Platform > > @@ -6,6 +6,10 @@ cflags-$(CONFIG_MIPS_MALTA) += > > -I$(srctree)/arch/mips/include/asm/mach-malta ifdef CONFIG_KVM_GUEST > > load-$(CONFIG_MIPS_MALTA) += 0x0000000040100000 > > else > > +ifdef CONFIG_64BIT > > load-$(CONFIG_MIPS_MALTA) += 0xffffffff80100000 > > +else > > + load-$(CONFIG_MIPS_MALTA) += 0x80100000 > > +endif > > endif > > all-$(CONFIG_MIPS_MALTA) := $(COMPRESSION_FNAME).bin > > > > Thanks. > > > > -- > > Jiaxun Yang > > Thank you, that fixes the error and I see no new ones. I tested > malta_defconfig, which boots in QEMU: > > Linux version 5.6.0-next-20200404-dirty (nathan@ubuntu-m2-xlarge-x86) (ClangBuiltLinux clang version 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8), LLD 11.0.0 (git://github.com/llvm/llvm-project 1ce0bc39eebe95a350174eb0ed4e2508e7cb6ed8)) #1 SMP Sat Apr 4 14:54:45 MST 2020 > > Tested-by: Nathan Chancellor Hi all, want to consult, does it mean 0-day ci doesn't need blacklist this ld.lld error anymore? This is a kernel problem and the error itself is valid.