Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1041531rwb; Fri, 13 Jan 2023 07:15:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtk7S67lntzsMeb+qle6O1sNtVLjnVBCYATzYaIMshOq8vKrM83vWR1EafdZAdsdogBYOjn X-Received: by 2002:a17:906:524b:b0:7c1:5098:907f with SMTP id y11-20020a170906524b00b007c15098907fmr69170810ejm.61.1673622941538; Fri, 13 Jan 2023 07:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673622941; cv=none; d=google.com; s=arc-20160816; b=g5o3V9mAAz13RQPykYYiv1Pl0TWoSHWIQV7ZVJ2BdA5Ei6rih5AhIs2kc65z6MpDwe sMVDO12qRX2ayRoO1R9t6RW0a4hKKdaAoy9oKEYUdAqQXdq/3INmCOeKRNMKEoNgGj8J L7lD4mciXvgfnMYTm/ni7fauZSMuWeD1Hu2NHa3tkgYIEv1Onw+E1fiGOPyfJ7NmbKdI Fae5m27Qb7XqX0KaYo8S/A6fOmvXSI7orHSMFhODbE7KxyBoHKPKHpfCsXvTeoU4Zqn9 eo5fmvrLFAs5jJE57ppxpHNw2xrdKg48WI+Vc41opajRZAdbk9zIrRvUe90J1Tja4jP6 BykA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=P3g0lquIHmkl5xVCNzzgCgqFInha98QQt+gUCXEzMI0=; b=h0e5nRnRplIxeyx98GqYQXDb0UMj1Y+ViK/NxxSv9OAK9cPzV9ABNxqMopAkuBnePr sPC/jkr7m8S38X8Ou+vxFH47CFSlV/R7fRe3X1CArWfeGG0FB/CxOUmw4xAXKFm1rVwW WRbOq+1TkzNzDbLlhmmcMTNgH0feANcKR2ikugWTdKOtTtKcU/dh43VilGClV+i09y8E djT1d4ev3qN/94e7XHPILXjgzhYgJo5nIB+Rlri23XlMtVck3qBBkSDOiD2oQUiqtQaE RubE6qVCumMopJkfFM/Elf63kA1nZUgaG4FPkPdzIlACTTyTEE4r/L8TgAxU7zz9+1c6 jvIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iz9bGQLQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb31-20020a1709071c9f00b0084d47629d8dsi17687896ejc.371.2023.01.13.07.15.28; Fri, 13 Jan 2023 07:15:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Iz9bGQLQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229613AbjAMOkM (ORCPT + 51 others); Fri, 13 Jan 2023 09:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229707AbjAMOiL (ORCPT ); Fri, 13 Jan 2023 09:38:11 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9051106; Fri, 13 Jan 2023 06:30:13 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A54C361EEC; Fri, 13 Jan 2023 14:30:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D498C433EF; Fri, 13 Jan 2023 14:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673620212; bh=AI2qdhzHQYOZvVj31h9iyayFJ6oNC14+vrLCGTM4y/8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Iz9bGQLQ+rR01Y7++VZtP7Qf9j6Xd7kLDAOo2+vjva71dijUp+AFPQmTm+S8Sjl6r sAJM/x9BpRrP5rYrTwqgLltMCQn0ycwmuSqzLbuiFc9mzkygIC2vSIGSK/jeIRZ9ET E60ZLgZG9l4n9BNJ8H5CjTRnC+OlcqL0FfZr+lfRYFsXB+06bgIKUKiJJEKfUiqDOp PIfKw8R7iTcc6laG7eFOgjfeOqrJjZmAPeTLkDg0G0ZdX+Gt5ynjt5o8+SeV8jRtSF nZjk8xJvvDScsz1wiMXt0+6xZeprQfaqGdmy0p4AGGgyKL7BfmQ2NyHET7FwWGUGKb w/53J/oOFkWdg== Received: by mail-lj1-f177.google.com with SMTP id n5so22089118ljc.9; Fri, 13 Jan 2023 06:30:11 -0800 (PST) X-Gm-Message-State: AFqh2kqwLwwmYRL3Q5EV3VUFxh/ghVFDw9ACrRKukLHnmWaB/Um6tJtG ZY3z6aeSVPbk4QmbZqx1sZ7ZeCFB0RtICeHZ3NQ= X-Received: by 2002:a2e:98d2:0:b0:289:7fc6:e1d with SMTP id s18-20020a2e98d2000000b002897fc60e1dmr360534ljj.69.1673620209975; Fri, 13 Jan 2023 06:30:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Fri, 13 Jan 2023 15:29:58 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: linker problem with Ubuntu 18.04 tool chain: unknown architecture of input file `arch/arm64/boot/vmlinuz.o' is incompatible with aarch64 output To: Lukas Bulwahn Cc: linux-efi@vger.kernel.org, Catalin Marinas , Jeremy Linton , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 13 Jan 2023 at 14:25, Lukas Bulwahn wrote: > > On Fri, Jan 13, 2023 at 12:58 PM Ard Biesheuvel wrote: > > > > On Fri, 13 Jan 2023 at 12:50, Lukas Bulwahn 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.