linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
@ 2023-01-13 11:50 Lukas Bulwahn
  2023-01-13 11:58 ` Ard Biesheuvel
  0 siblings, 1 reply; 5+ messages in thread
From: Lukas Bulwahn @ 2023-01-13 11:50 UTC (permalink / raw)
  To: linux-efi, Ard Biesheuvel
  Cc: Catalin Marinas, Jeremy Linton, Linux ARM, Linux Kernel Mailing List

Dear Ard,

with my Ubuntu 18.04 arm gcc tool chain, I encounter this linker error
in my allyesconfig build:

 LD      arch/arm64/boot/vmlinuz.efi.elf
aarch64-linux-gnu-ld: unknown architecture of input file
`arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
drivers/firmware/efi/libstub/Makefile.zboot:41: recipe for target
'arch/arm64/boot/vmlinuz.efi.elf' failed
make[1]: *** [arch/arm64/boot/vmlinuz.efi.elf] Error 1
arch/arm64/Makefile:173: recipe for target 'vmlinuz.efi' failed
make: *** [vmlinuz.efi] Error 2

I bisected it back to happen since commit c37b830fef13 ("arm64: efi:
enable generic EFI compressed boot"), and it still appears with the
latest next-20230113 (on linux-next, I have to remove DRM_MSM as it
currently comes with a build error).

The specific compiler and linker versions on my system are:

$ aarch64-linux-gnu-ld --version
GNU ld (GNU Binutils for Ubuntu) 2.30

$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0


IMHO, I run pretty standard commands:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 mrproper
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 allyesconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 all

Let me know if you need more information.


Best regards,

Lukas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
  2023-01-13 11:50 linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output Lukas Bulwahn
@ 2023-01-13 11:58 ` Ard Biesheuvel
  2023-01-13 13:25   ` Lukas Bulwahn
  0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2023-01-13 11:58 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: linux-efi, Catalin Marinas, Jeremy Linton, Linux ARM,
	Linux Kernel Mailing List

On Fri, 13 Jan 2023 at 12:50, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
>
> Dear Ard,
>
> with my Ubuntu 18.04 arm gcc tool chain, I encounter this linker error
> in my allyesconfig build:
>
>  LD      arch/arm64/boot/vmlinuz.efi.elf
> aarch64-linux-gnu-ld: unknown architecture of input file
> `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
> drivers/firmware/efi/libstub/Makefile.zboot:41: recipe for target
> 'arch/arm64/boot/vmlinuz.efi.elf' failed
> make[1]: *** [arch/arm64/boot/vmlinuz.efi.elf] Error 1
> arch/arm64/Makefile:173: recipe for target 'vmlinuz.efi' failed
> make: *** [vmlinuz.efi] Error 2
>
> I bisected it back to happen since commit c37b830fef13 ("arm64: efi:
> enable generic EFI compressed boot"), and it still appears with the
> latest next-20230113 (on linux-next, I have to remove DRM_MSM as it
> currently comes with a build error).
>
> The specific compiler and linker versions on my system are:
>
> $ aarch64-linux-gnu-ld --version
> GNU ld (GNU Binutils for Ubuntu) 2.30
>
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
>
>
> IMHO, I run pretty standard commands:
> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 mrproper
> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 allyesconfig
> make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 all
>
> Let me know if you need more information.
>

Hello Lukas,

This seems to mean that AArch64 ld.bfd 2.30 is not able to combine
generic ELF objects with AArch64 ELF objects. vmlinuz.o only contains
a compressed blob in an ELF data section, and more modern toolchains
have no issue with this at all.

Given that building allyesconfig with fairly outdated toolchains is
not something anyone is likely to obsess about, I don't have a strong
preference as to how we work around this, put perhaps the easiest
approach would be for CONFIG_EFI_ZBOOT to depend on !CONFIG_LD_IS_BFD
|| CONFIG_LD_VERSION >= 23xxx here? (We'll need to check the exact
version)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
  2023-01-13 11:58 ` Ard Biesheuvel
@ 2023-01-13 13:25   ` Lukas Bulwahn
  2023-01-13 14:29     ` Ard Biesheuvel
  0 siblings, 1 reply; 5+ messages in thread
From: Lukas Bulwahn @ 2023-01-13 13:25 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: linux-efi, Catalin Marinas, Jeremy Linton, Linux ARM,
	Linux Kernel Mailing List

On Fri, Jan 13, 2023 at 12:58 PM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 13 Jan 2023 at 12:50, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
> >
> > Dear Ard,
> >
> > with my Ubuntu 18.04 arm gcc tool chain, I encounter this linker error
> > in my allyesconfig build:
> >
> >  LD      arch/arm64/boot/vmlinuz.efi.elf
> > aarch64-linux-gnu-ld: unknown architecture of input file
> > `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
> > drivers/firmware/efi/libstub/Makefile.zboot:41: recipe for target
> > 'arch/arm64/boot/vmlinuz.efi.elf' failed
> > make[1]: *** [arch/arm64/boot/vmlinuz.efi.elf] Error 1
> > arch/arm64/Makefile:173: recipe for target 'vmlinuz.efi' failed
> > make: *** [vmlinuz.efi] Error 2
> >
> > I bisected it back to happen since commit c37b830fef13 ("arm64: efi:
> > enable generic EFI compressed boot"), and it still appears with the
> > latest next-20230113 (on linux-next, I have to remove DRM_MSM as it
> > currently comes with a build error).
> >
> > The specific compiler and linker versions on my system are:
> >
> > $ aarch64-linux-gnu-ld --version
> > GNU ld (GNU Binutils for Ubuntu) 2.30
> >
> > $ aarch64-linux-gnu-gcc --version
> > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
> >
> >
> > IMHO, I run pretty standard commands:
> > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 mrproper
> > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 allyesconfig
> > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 all
> >
> > Let me know if you need more information.
> >
>
> Hello Lukas,
>
> This seems to mean that AArch64 ld.bfd 2.30 is not able to combine
> generic ELF objects with AArch64 ELF objects. vmlinuz.o only contains
> a compressed blob in an ELF data section, and more modern toolchains
> have no issue with this at all.
>
> Given that building allyesconfig with fairly outdated toolchains is
> not something anyone is likely to obsess about, I don't have a strong
> preference as to how we work around this, put perhaps the easiest
> approach would be for CONFIG_EFI_ZBOOT to depend on !CONFIG_LD_IS_BFD
> || CONFIG_LD_VERSION >= 23xxx here? (We'll need to check the exact
> version)

That sounds reasonable to me.

Thanks,

Lukas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
  2023-01-13 13:25   ` Lukas Bulwahn
@ 2023-01-13 14:29     ` Ard Biesheuvel
  2023-01-13 14:54       ` Lukas Bulwahn
  0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2023-01-13 14:29 UTC (permalink / raw)
  To: Lukas Bulwahn
  Cc: linux-efi, Catalin Marinas, Jeremy Linton, Linux ARM,
	Linux Kernel Mailing List

On Fri, 13 Jan 2023 at 14:25, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
>
> On Fri, Jan 13, 2023 at 12:58 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> >
> > On Fri, 13 Jan 2023 at 12:50, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
> > >
> > > Dear Ard,
> > >
> > > with my Ubuntu 18.04 arm gcc tool chain, I encounter this linker error
> > > in my allyesconfig build:
> > >
> > >  LD      arch/arm64/boot/vmlinuz.efi.elf
> > > aarch64-linux-gnu-ld: unknown architecture of input file
> > > `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
> > > drivers/firmware/efi/libstub/Makefile.zboot:41: recipe for target
> > > 'arch/arm64/boot/vmlinuz.efi.elf' failed
> > > make[1]: *** [arch/arm64/boot/vmlinuz.efi.elf] Error 1
> > > arch/arm64/Makefile:173: recipe for target 'vmlinuz.efi' failed
> > > make: *** [vmlinuz.efi] Error 2
> > >
> > > I bisected it back to happen since commit c37b830fef13 ("arm64: efi:
> > > enable generic EFI compressed boot"), and it still appears with the
> > > latest next-20230113 (on linux-next, I have to remove DRM_MSM as it
> > > currently comes with a build error).
> > >
> > > The specific compiler and linker versions on my system are:
> > >
> > > $ aarch64-linux-gnu-ld --version
> > > GNU ld (GNU Binutils for Ubuntu) 2.30
> > >
> > > $ aarch64-linux-gnu-gcc --version
> > > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
> > >
> > >
> > > IMHO, I run pretty standard commands:
> > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 mrproper
> > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 allyesconfig
> > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 all
> > >
> > > Let me know if you need more information.
> > >
> >
> > Hello Lukas,
> >
> > This seems to mean that AArch64 ld.bfd 2.30 is not able to combine
> > generic ELF objects with AArch64 ELF objects. vmlinuz.o only contains
> > a compressed blob in an ELF data section, and more modern toolchains
> > have no issue with this at all.
> >
> > Given that building allyesconfig with fairly outdated toolchains is
> > not something anyone is likely to obsess about, I don't have a strong
> > preference as to how we work around this, put perhaps the easiest
> > approach would be for CONFIG_EFI_ZBOOT to depend on !CONFIG_LD_IS_BFD
> > || CONFIG_LD_VERSION >= 23xxx here? (We'll need to check the exact
> > version)
>
> That sounds reasonable to me.
>

This is not reproducible with ld.bfd built from the upstream sources

$ ~/build/binutils-build-aarch64/ld/ld-new -v
GNU ld (GNU Binutils) 2.30

$ ~/build/binutils-build-aarch64/ld/ld-new -EL  -maarch64elf -z
noexecstack -T /usr/local/google/home/ardb/linux/drivers/firmware/efi/libstub/zboot.lds
arch/arm64/boot/vmlinuz.o arch/arm64/boot/zboot-header.o
drivers/firmware/efi/libstub/lib.a -o arch/arm64/boot/vmlinuz.efi.elf

$ file arch/arm64/boot/vmlinuz.efi.elf
arch/arm64/boot/vmlinuz.efi.elf: ELF 64-bit LSB executable, ARM
aarch64, version 1 (SYSV), statically linked, with debug_info, not
stripped

So this could be an issue in Ubuntu's downstream fork, in which case I
don't think we should do anything about it.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
  2023-01-13 14:29     ` Ard Biesheuvel
@ 2023-01-13 14:54       ` Lukas Bulwahn
  0 siblings, 0 replies; 5+ messages in thread
From: Lukas Bulwahn @ 2023-01-13 14:54 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: linux-efi, Catalin Marinas, Jeremy Linton, Linux ARM,
	Linux Kernel Mailing List

On Fri, Jan 13, 2023 at 3:30 PM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Fri, 13 Jan 2023 at 14:25, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
> >
> > On Fri, Jan 13, 2023 at 12:58 PM Ard Biesheuvel <ardb@kernel.org> wrote:
> > >
> > > On Fri, 13 Jan 2023 at 12:50, Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
> > > >
> > > > Dear Ard,
> > > >
> > > > with my Ubuntu 18.04 arm gcc tool chain, I encounter this linker error
> > > > in my allyesconfig build:
> > > >
> > > >  LD      arch/arm64/boot/vmlinuz.efi.elf
> > > > aarch64-linux-gnu-ld: unknown architecture of input file
> > > > `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output
> > > > drivers/firmware/efi/libstub/Makefile.zboot:41: recipe for target
> > > > 'arch/arm64/boot/vmlinuz.efi.elf' failed
> > > > make[1]: *** [arch/arm64/boot/vmlinuz.efi.elf] Error 1
> > > > arch/arm64/Makefile:173: recipe for target 'vmlinuz.efi' failed
> > > > make: *** [vmlinuz.efi] Error 2
> > > >
> > > > I bisected it back to happen since commit c37b830fef13 ("arm64: efi:
> > > > enable generic EFI compressed boot"), and it still appears with the
> > > > latest next-20230113 (on linux-next, I have to remove DRM_MSM as it
> > > > currently comes with a build error).
> > > >
> > > > The specific compiler and linker versions on my system are:
> > > >
> > > > $ aarch64-linux-gnu-ld --version
> > > > GNU ld (GNU Binutils for Ubuntu) 2.30
> > > >
> > > > $ aarch64-linux-gnu-gcc --version
> > > > aarch64-linux-gnu-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0
> > > >
> > > >
> > > > IMHO, I run pretty standard commands:
> > > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 mrproper
> > > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 allyesconfig
> > > > make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j 32 all
> > > >
> > > > Let me know if you need more information.
> > > >
> > >
> > > Hello Lukas,
> > >
> > > This seems to mean that AArch64 ld.bfd 2.30 is not able to combine
> > > generic ELF objects with AArch64 ELF objects. vmlinuz.o only contains
> > > a compressed blob in an ELF data section, and more modern toolchains
> > > have no issue with this at all.
> > >
> > > Given that building allyesconfig with fairly outdated toolchains is
> > > not something anyone is likely to obsess about, I don't have a strong
> > > preference as to how we work around this, put perhaps the easiest
> > > approach would be for CONFIG_EFI_ZBOOT to depend on !CONFIG_LD_IS_BFD
> > > || CONFIG_LD_VERSION >= 23xxx here? (We'll need to check the exact
> > > version)
> >
> > That sounds reasonable to me.
> >
>
> This is not reproducible with ld.bfd built from the upstream sources
>
> $ ~/build/binutils-build-aarch64/ld/ld-new -v
> GNU ld (GNU Binutils) 2.30
>
> $ ~/build/binutils-build-aarch64/ld/ld-new -EL  -maarch64elf -z
> noexecstack -T /usr/local/google/home/ardb/linux/drivers/firmware/efi/libstub/zboot.lds
> arch/arm64/boot/vmlinuz.o arch/arm64/boot/zboot-header.o
> drivers/firmware/efi/libstub/lib.a -o arch/arm64/boot/vmlinuz.efi.elf
>
> $ file arch/arm64/boot/vmlinuz.efi.elf
> arch/arm64/boot/vmlinuz.efi.elf: ELF 64-bit LSB executable, ARM
> aarch64, version 1 (SYSV), statically linked, with debug_info, not
> stripped
>
> So this could be an issue in Ubuntu's downstream fork, in which case I
> don't think we should do anything about it.

Thanks, I will follow up and check if this is really something
specific in the Ubuntu fork or if it appears only with very selected
binutils versions.

Lukas

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-01-13 14:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-13 11:50 linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output Lukas Bulwahn
2023-01-13 11:58 ` Ard Biesheuvel
2023-01-13 13:25   ` Lukas Bulwahn
2023-01-13 14:29     ` Ard Biesheuvel
2023-01-13 14:54       ` Lukas Bulwahn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).