Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp838524rwb; Fri, 13 Jan 2023 04:57:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXuk4EiA5RmBRusCnKnlx4aXtZJY+OqepdpSNr4ZK0PO9/+chhzkoLsycfpek33IYuWdSIPA X-Received: by 2002:a17:90a:2e17:b0:227:7f5:9fdb with SMTP id q23-20020a17090a2e1700b0022707f59fdbmr20697434pjd.23.1673614674202; Fri, 13 Jan 2023 04:57:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673614674; cv=none; d=google.com; s=arc-20160816; b=UepnTysJlC/9J1t3jmWe1D00RPM8Q+CZOI/6BYlJIRhQ0FedZ2qM53orG08FIA5d/M e7b2+9pP1PUXR4gZIBw/jRKQwnWkT/Na8CXn4EMrlS+U9uGOmv798zsv7IobJR20N1Ai xzsSS/5XV/L+NWMCtEEci0sfJIHfUVh15LsL8yHpA8X7Gk4CjRKim0VTsizEcFYR06od 1FJ3e9yQsBg9mZ9CcbycJDukaXyQkuL5MzeBR0IEktV8wF8OQ2aMHwUfVOBD7jVc8mm7 z6BuqCsZEEP/kAg2VZa7y3fkoFg3Bp0z/cyMMjH89GYrzqViToEYN86jCG2dU41E6cTb cPKg== 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=jz6Y8DTgXoLOESrF5jGQmwJVztcXD5r3xpJHtyHSMOw=; b=HNu04k+QRTnUowG3FLAr0AXQUi+QBLrjcj/aWuM7AXpFMCNTOj06Chrf9zitraJkrD AII1eEnTg/19obPzEJLoeWqpojRsc2dreJBbduDhrrEqNlcp+7FrB7hdKhsMXAfdQHJ6 i/eN/HEXXw3xB+xO8hKlOsF4Ke53gRzD0vl9bVjkWWFOb1gtzk20+DkXAVmq7bQh0W5n 3CgtiVz2E78Qw+6duA7wDtX1guQoCtRs5s5vl3Dz2/pZhyrf6gHKaYLrcS1PcBQZaVY3 Upv4tGzTpWPIXM92/lJl6/wWdNI9uIbCFYtLuSIHRSDsM3OMoncryWow7TNlmUbov4su yrTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eF07eTqN; 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 r20-20020a6560d4000000b004961cb25a14si16831773pgv.499.2023.01.13.04.57.47; Fri, 13 Jan 2023 04:57:54 -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=eF07eTqN; 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 S232147AbjAMMIU (ORCPT + 51 others); Fri, 13 Jan 2023 07:08:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240464AbjAMMH1 (ORCPT ); Fri, 13 Jan 2023 07:07:27 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC25F50E6C; Fri, 13 Jan 2023 03:58:22 -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 768E161298; Fri, 13 Jan 2023 11:58:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF9CBC433F1; Fri, 13 Jan 2023 11:58:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673611101; bh=xgsnTy32xcDNfnTQM10m7sY5s0ofOjbgWgjhxJOwFsY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eF07eTqNQs9K7vJs5PJCmrc2o8Pvf3Lwl0dnooPFnpfYSBv9GEm4YArPkDhxEjtiH eGcT2iHdp3CZUWhSciZ9lbcn8DuGhof4/k3Q/DjTe/Vv2pq4XcVaCiuv/JKKVPa3Tf R0famaoGcXivntznXDSq3y6REzF/SP5wIeTnpD9x8k34WsCJE8zaUWUblq+CUZM9QC bI1vkKA4ryOEL+DVP8pU1CnJBRIjLWNHZIuGkcy36RcyQd57GrgVwEdYp2lgsrsfp3 yUYzDUUsrKbVdG+XSZ1tzHLA8HaNs+ry8BGWqbHMrP/WAAh32ExvAsGigzBUqehL5A hbD9ONFpb8JcQ== Received: by mail-lf1-f44.google.com with SMTP id f34so32776963lfv.10; Fri, 13 Jan 2023 03:58:21 -0800 (PST) X-Gm-Message-State: AFqh2ko6XwIwdGI7oUx6IoObsON5qFwjXDfAVxRvHumSMpZhGNn5Wjdn 3ScbOscwiK91mei1Y18OWuDXAFpL90rMD0dXR8k= X-Received: by 2002:a05:6512:3d93:b0:4b8:9001:a694 with SMTP id k19-20020a0565123d9300b004b89001a694mr3894521lfv.426.1673611099794; Fri, 13 Jan 2023 03:58:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Ard Biesheuvel Date: Fri, 13 Jan 2023 12:58:06 +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 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)