public inbox for linuxppc-dev@ozlabs.org
 help / color / mirror / Atom feed
* Failure to build with LLVM for the Wii
@ 2026-01-29 10:55 Link Mauve
  2026-01-29 11:11 ` Christophe Leroy (CS GROUP)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Link Mauve @ 2026-01-29 10:55 UTC (permalink / raw)
  To: linuxppc-dev

Hi,

I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
of gcc, in order to bring Rust support to this architecture (and also
because my distribution doesn’t ship a cross-compiling gcc), but I get
this build issue near the end:
```
% make O=wii LLVM=1 ARCH=powerpc -j1
make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
  GEN     Makefile
  CALL    ../scripts/checksyscalls.sh
  DESCEND objtool
  INSTALL libsubcmd_headers
  WRAP    arch/powerpc/boot/dtbImage.wii
objcopy: Unable to recognise the format of the input file `vmlinux'
make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
make: *** [Makefile:248: __sub-make] Error 2
```

I believe it should use $(OBJCOPY) instead of objcopy, which is set to
llvm-objcopy, but couldn’t figure out where it is misconfigured.

Thanks for your help!

-- 
Link Mauve


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Failure to build with LLVM for the Wii
  2026-01-29 10:55 Failure to build with LLVM for the Wii Link Mauve
@ 2026-01-29 11:11 ` Christophe Leroy (CS GROUP)
  2026-01-29 22:31 ` Nathan Chancellor
  2026-01-30 15:53 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy (CS GROUP) @ 2026-01-29 11:11 UTC (permalink / raw)
  To: Link Mauve, linuxppc-dev



Le 29/01/2026 à 11:55, Link Mauve a écrit :
> [Vous ne recevez pas souvent de courriers de linkmauve@linkmauve.fr. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi,
> 
> I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
> of gcc, in order to bring Rust support to this architecture (and also
> because my distribution doesn’t ship a cross-compiling gcc), but I get
> this build issue near the end:
> ```
> % make O=wii LLVM=1 ARCH=powerpc -j1
> make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
>    GEN     Makefile
>    CALL    ../scripts/checksyscalls.sh
>    DESCEND objtool
>    INSTALL libsubcmd_headers
>    WRAP    arch/powerpc/boot/dtbImage.wii
> objcopy: Unable to recognise the format of the input file `vmlinux'
> make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
> make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
> make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
> make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
> make: *** [Makefile:248: __sub-make] Error 2
> ```
> 
> I believe it should use $(OBJCOPY) instead of objcopy, which is set to
> llvm-objcopy, but couldn’t figure out where it is misconfigured.

Must be here I guess:

arch/powerpc/boot/wrapper:${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
arch/powerpc/boot/wrapper:    ${CROSS}objcopy $4 $1 \
arch/powerpc/boot/wrapper:    ${CROSS}objcopy -O binary "$ofile".elf 
"$ofile"
arch/powerpc/boot/wrapper:    ${CROSS}objcopy -O aixcoff-rs6000 
--set-start "$entry" "$ofile"
arch/powerpc/boot/wrapper:    ${CROSS}objcopy -O binary "$ofile" 
"$ofile.bin"



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Failure to build with LLVM for the Wii
  2026-01-29 10:55 Failure to build with LLVM for the Wii Link Mauve
  2026-01-29 11:11 ` Christophe Leroy (CS GROUP)
@ 2026-01-29 22:31 ` Nathan Chancellor
  2026-02-24 23:30   ` Aelin
  2026-01-30 15:53 ` Segher Boessenkool
  2 siblings, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2026-01-29 22:31 UTC (permalink / raw)
  To: Link Mauve; +Cc: linuxppc-dev, llvm

Hi Link,

On Thu, Jan 29, 2026 at 11:55:46AM +0100, Link Mauve wrote:
> I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
> of gcc, in order to bring Rust support to this architecture (and also
> because my distribution doesn’t ship a cross-compiling gcc), but I get
> this build issue near the end:
> ```
> % make O=wii LLVM=1 ARCH=powerpc -j1
> make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
>   GEN     Makefile
>   CALL    ../scripts/checksyscalls.sh
>   DESCEND objtool
>   INSTALL libsubcmd_headers
>   WRAP    arch/powerpc/boot/dtbImage.wii
> objcopy: Unable to recognise the format of the input file `vmlinux'
> make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
> make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
> make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
> make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
> make: *** [Makefile:248: __sub-make] Error 2
> ```
> 
> I believe it should use $(OBJCOPY) instead of objcopy, which is set to
> llvm-objcopy, but couldn’t figure out where it is misconfigured.
> 
> Thanks for your help!

It is the arch/powerpc/boot/wrapper script:

  https://github.com/ClangBuiltLinux/linux/issues/1601

I have a WIP series from long ago that may be a good starting point for
getting something working but there were some errors I never got around
to solving before having to shelve it for other issues:

  https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git/log/?h=wip/llvm-1-powerpc-boot-wrapper

Maybe something I (or someone else) can get back to soon.

Cheers,
Nathan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Failure to build with LLVM for the Wii
  2026-01-29 10:55 Failure to build with LLVM for the Wii Link Mauve
  2026-01-29 11:11 ` Christophe Leroy (CS GROUP)
  2026-01-29 22:31 ` Nathan Chancellor
@ 2026-01-30 15:53 ` Segher Boessenkool
  2 siblings, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2026-01-30 15:53 UTC (permalink / raw)
  To: Link Mauve; +Cc: linuxppc-dev

Hi!

On Thu, Jan 29, 2026 at 11:55:46AM +0100, Link Mauve wrote:
> I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
> of gcc, in order to bring Rust support to this architecture (and also
> because my distribution doesn’t ship a cross-compiling gcc), but I get
> this build issue near the end:
> ```
> % make O=wii LLVM=1 ARCH=powerpc -j1
> make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
>   GEN     Makefile
>   CALL    ../scripts/checksyscalls.sh
>   DESCEND objtool
>   INSTALL libsubcmd_headers
>   WRAP    arch/powerpc/boot/dtbImage.wii
> objcopy: Unable to recognise the format of the input file `vmlinux'
> make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
> make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
> make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
> make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
> make: *** [Makefile:248: __sub-make] Error 2
> ```
> 
> I believe it should use $(OBJCOPY) instead of objcopy, which is set to
> llvm-objcopy, but couldn’t figure out where it is misconfigured.

Other people already pointed you places, but to find out for yourself:

   make V=1

will tell you all that happens.  The kernel build system tries to not
say much at all normally, but sometimes you want to see whatever is
happening :-)


Segher


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Failure to build with LLVM for the Wii
  2026-01-29 22:31 ` Nathan Chancellor
@ 2026-02-24 23:30   ` Aelin
  2026-02-25 21:35     ` Nathan Chancellor
  0 siblings, 1 reply; 6+ messages in thread
From: Aelin @ 2026-02-24 23:30 UTC (permalink / raw)
  To: Nathan Chancellor, Link Mauve; +Cc: linuxppc-dev, llvm

On 1/29/26 11:31 PM, Nathan Chancellor wrote:
> Hi Link,
> 
> On Thu, Jan 29, 2026 at 11:55:46AM +0100, Link Mauve wrote:
>> I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
>> of gcc, in order to bring Rust support to this architecture (and also
>> because my distribution doesn’t ship a cross-compiling gcc), but I get
>> this build issue near the end:
>> ```
>> % make O=wii LLVM=1 ARCH=powerpc -j1
>> make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
>>    GEN     Makefile
>>    CALL    ../scripts/checksyscalls.sh
>>    DESCEND objtool
>>    INSTALL libsubcmd_headers
>>    WRAP    arch/powerpc/boot/dtbImage.wii
>> objcopy: Unable to recognise the format of the input file `vmlinux'
>> make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
>> make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
>> make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
>> make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
>> make: *** [Makefile:248: __sub-make] Error 2
>> ```
>>
>> I believe it should use $(OBJCOPY) instead of objcopy, which is set to
>> llvm-objcopy, but couldn’t figure out where it is misconfigured.
>>
>> Thanks for your help!
> 
> It is the arch/powerpc/boot/wrapper script:
> 
>    https://github.com/ClangBuiltLinux/linux/issues/1601
> 
> I have a WIP series from long ago that may be a good starting point for
> getting something working but there were some errors I never got around
> to solving before having to shelve it for other issues:
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git/log/?h=wip/llvm-1-powerpc-boot-wrapper
> 
> Maybe something I (or someone else) can get back to soon.
> 
> Cheers,
> Nathan
> 

Hi Nathan,

your last 3 patches on this branch do indeed fix the wrapper script for 
the cross-compilation with LLVM=1 ARCH=powerpc without CROSS_COMPILE set 
or GNU binutils in PATH. They look good to me! Would you be willing to 
submit them now without touching the VDSO? That part does not seem to be 
necessary to fix the wrapper script for this usecase, so it should 
strictly be an improvement. I'd also be happy to pick up your patches, 
send them and follow-up on feedback if you don't want to do it yourself.

Best regards,
Aelin


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Failure to build with LLVM for the Wii
  2026-02-24 23:30   ` Aelin
@ 2026-02-25 21:35     ` Nathan Chancellor
  0 siblings, 0 replies; 6+ messages in thread
From: Nathan Chancellor @ 2026-02-25 21:35 UTC (permalink / raw)
  To: Aelin; +Cc: Link Mauve, linuxppc-dev, llvm

Hi Aelin,

On Wed, Feb 25, 2026 at 12:30:30AM +0100, Aelin wrote:
> On 1/29/26 11:31 PM, Nathan Chancellor wrote:
> > Hi Link,
> > 
> > On Thu, Jan 29, 2026 at 11:55:46AM +0100, Link Mauve wrote:
> > > I’m trying to build the kernel for the Nintendo Wii, using LLVM instead
> > > of gcc, in order to bring Rust support to this architecture (and also
> > > because my distribution doesn’t ship a cross-compiling gcc), but I get
> > > this build issue near the end:
> > > ```
> > > % make O=wii LLVM=1 ARCH=powerpc -j1
> > > make[1]: Entering directory '/home/linkmauve/dev/linux/wii'
> > >    GEN     Makefile
> > >    CALL    ../scripts/checksyscalls.sh
> > >    DESCEND objtool
> > >    INSTALL libsubcmd_headers
> > >    WRAP    arch/powerpc/boot/dtbImage.wii
> > > objcopy: Unable to recognise the format of the input file `vmlinux'
> > > make[3]: *** [../arch/powerpc/boot/Makefile:394: arch/powerpc/boot/dtbImage.wii] Error 1
> > > make[2]: *** [../arch/powerpc/Makefile:236: zImage] Error 2
> > > make[1]: *** [/home/linkmauve/dev/linux/Makefile:248: __sub-make] Error 2
> > > make[1]: Leaving directory '/home/linkmauve/dev/linux/wii'
> > > make: *** [Makefile:248: __sub-make] Error 2
> > > ```
> > > 
> > > I believe it should use $(OBJCOPY) instead of objcopy, which is set to
> > > llvm-objcopy, but couldn’t figure out where it is misconfigured.
> > > 
> > > Thanks for your help!
> > 
> > It is the arch/powerpc/boot/wrapper script:
> > 
> >    https://github.com/ClangBuiltLinux/linux/issues/1601
> > 
> > I have a WIP series from long ago that may be a good starting point for
> > getting something working but there were some errors I never got around
> > to solving before having to shelve it for other issues:
> > 
> >    https://git.kernel.org/pub/scm/linux/kernel/git/nathan/linux.git/log/?h=wip/llvm-1-powerpc-boot-wrapper
> > 
> > Maybe something I (or someone else) can get back to soon.
> > 
> > Cheers,
> > Nathan
> > 
> 
> Hi Nathan,
> 
> your last 3 patches on this branch do indeed fix the wrapper script for the
> cross-compilation with LLVM=1 ARCH=powerpc without CROSS_COMPILE set or GNU
> binutils in PATH. They look good to me! Would you be willing to submit them
> now without touching the VDSO? That part does not seem to be necessary to
> fix the wrapper script for this usecase, so it should strictly be an
> improvement. I'd also be happy to pick up your patches, send them and
> follow-up on feedback if you don't want to do it yourself.

Thanks a lot for testing. For the record, I submitted the vDSO parts
separately and it landed as

  4406b12214f6 ("powerpc/vdso: Link with ld.lld when requested")

so it can safely be ignored altogether.

I am a little busy with things at the moment so I am not sure how soon I
will be able to pick this up. I am more than happy to let you take over
from here if you have the time and energy to get it tested and
submitted now. You can either take full authorship or stick a
Co-developed-by on it, does not matter to me.

Cheers,
Nathan


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-25 21:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29 10:55 Failure to build with LLVM for the Wii Link Mauve
2026-01-29 11:11 ` Christophe Leroy (CS GROUP)
2026-01-29 22:31 ` Nathan Chancellor
2026-02-24 23:30   ` Aelin
2026-02-25 21:35     ` Nathan Chancellor
2026-01-30 15:53 ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox