Re: mips allmodconfig build error with llvm-18.1.7-x86_64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jeff,

On Mon, Jun 17, 2024 at 08:50:00AM -0700, Jeff Johnson wrote:
> As part of my tree-wide cleanup of missing MODULE_DESCRIPTION() macros I'm
> trying to do allmodconfig builds for every architecture.
> 
> With:
> export ARCH=mips
> export LLVM=llvm-18.1.7-x86_64/bin/
> make distclean
> make allmodconfig
> make -j$(nproc)
> 
> I'm getting build errors like:
> Cannot find symbol for section 46: .text.free_initmem.
> init/main.o: failed
> 
> Cannot find symbol for section 6: .text.copy_from_kernel_nofault_allowed.
> mm/maccess.o: failed
> 
> Cannot find symbol for section 10: .text.arch_asym_cpu_priority.
> kernel/sched/fair.o: failed
> 
> Interestingly, if I make 'defconfig' instead of 'allmodconfig' I don't see
> this issue.
> 
> Any thoughts on how to have a successful mips allmodconfig build?

Hmmm, it looks like https://github.com/ClangBuiltLinux/linux/issues/1830
never got addressed, sorry about that :/

This is basically a poor interaction with Clang's integrated assembler,
-ffunction-sections, and recordmcount that nobody has really been able
to figure out how to deal with. It is not MIPS specific but the fact
that MIPS allows CONFIG_LD_DEAD_CODE_DATA_ELIMINATION to be selected
means that it is much easier to trigger.

My recommendation for this is to disable that configuration (and -Werror
configurations) when building, which you can easily do with the
KCONFIG_ALLCONFIG variable and bash's process substitution during the
allmodconfig step (keeping the rest of your commands the same):

  $ make KCONFIG_ALLCONFIG=<(printf 'CONFIG_%s=n\n' DRM_WERROR LD_DEAD_CODE_DATA_ELIMINATION WERROR) allmodconfig

Alternatively, you could use the 'allmod.config' file plus
KCONFIG_ALLCONFIG=1:

  $ printf 'CONFIG_%s=n\n' DRM_WERROR LD_DEAD_CODE_DATA_ELIMINATION WERROR >allmod.config

  $ make KCONFIG_ALLCONFIG=1 allmodconfig

I will try to send a version of that diff that I have in that linked
issue so that you don't have to jump through these hoops.

Even with that addressed though, I see another issue in an allmodconfig
when building arch/mips/kernel/cps-vec.S that I don't recall seeing
before:

  arch/mips/kernel/cps-vec.S:363:2: error: instruction requires a CPU feature not currently enabled
   jr.hb $9
   ^
  arch/mips/kernel/cps-vec.S:477:4: error: instruction requires a CPU feature not currently enabled
  1: jr.hb $8
     ^

I was able to workaround that by disabling CONFIG_MIPS_CPS in the same
manner as above and that build finished fine for me with that same
toolchain.

For what it's worth, MIPS is not very well supported in LLVM anymore, as
the main maintainer stepped down a couple of years ago. Another
maintainer has stepped up but a lot of these issues are long outstanding
problems, so I think the likelihood of them getting addressed at this
point is pretty low.

Cheers,
Nathan




[Index of Archives]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux