Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8776ECF11F8 for ; Thu, 10 Oct 2024 14:37:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 868F260B36; Thu, 10 Oct 2024 14:37:14 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HtMX2_GWHvz5; Thu, 10 Oct 2024 14:37:13 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 599E760B63 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 599E760B63; Thu, 10 Oct 2024 14:37:13 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A8EE91BF4E3 for ; Thu, 10 Oct 2024 14:37:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 987C381E8A for ; Thu, 10 Oct 2024 14:37:08 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id unYIa85H1Vbg for ; Thu, 10 Oct 2024 14:37:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::629; helo=mail-ej1-x629.google.com; envelope-from=dario.binacchi@amarulasolutions.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 314C981E7A DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 314C981E7A Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by smtp1.osuosl.org (Postfix) with ESMTPS id 314C981E7A for ; Thu, 10 Oct 2024 14:37:04 +0000 (UTC) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a99422c796eso163958266b.3 for ; Thu, 10 Oct 2024 07:37:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728571023; x=1729175823; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FeWdXv10taD45Ph4X5tP/R58qwqdQ1uqXTPuXTtjMPg=; b=Bad7fQYLWVkCmy3jUXRlIX4QIppmc/0YyLUC6b8M2ZKnsII65qizR8Y6l5J7uTZ+io CJ7ZlcIGKaAx4G7WV3vSU5ITmmnsb88R5IokW+QppP6YvcY0QVrQPjjwBgeaEBVwiew0 6Tiw9DumwD88G1cmMYwXxEKaRqSbAK9jKAGLCZJA6VHO0Ims8yPERM976atXydhz3Ok8 CwcdCD8WYjHmcLisSANgl7V68PoRpj/dYBMmQclreyhVb/kY0Horg/JWzhEPvLbFKWpu f0zU32bDxVjSpp3n6OumUZi7Xo6Cbag+DOiu/hsvvujdT4ipOjO5FYt+29YhdR1pQOhj 8DMA== X-Gm-Message-State: AOJu0YzvBRxON9hcV7asQMoVLuBH1PFR2TwzschZ1F/3JAc4gLH6t2TE Y00oFLlk+UetO+WTscJRyJe6lHTAE/I+aRuTaakPAn2FSr58oP0bN/IzrbNOi7tiKnniVINdt83 UAbA= X-Google-Smtp-Source: AGHT+IElsGPnC2W0y04pjXSWPupCjHa+iNZQscl36/F+uimLViT8kSDwiz5Qmyf9DXMQB4UlwxOMSA== X-Received: by 2002:a17:906:dc8e:b0:a99:6363:8a12 with SMTP id a640c23a62f3a-a999e6280fcmr437814166b.9.1728571022715; Thu, 10 Oct 2024 07:37:02 -0700 (PDT) Received: from localhost.localdomain ([2001:b07:6474:ebbf:a293:3a9f:6dc0:1d29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99a7ec4d14sm97019666b.38.2024.10.10.07.37.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 07:37:02 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Date: Thu, 10 Oct 2024 16:36:58 +0200 Message-ID: <20241010143659.2844375-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1728571023; x=1729175823; darn=buildroot.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FeWdXv10taD45Ph4X5tP/R58qwqdQ1uqXTPuXTtjMPg=; b=EdEajGPWEGGjW/3fq4ROxFVIWY3hfvFKbzF2YeU8YG14H9Xjw3qXvRreM3lkJgKXO6 lqM/Mk07SYj9O161v/0ebHgnKoaCTfsNMmaQSZ+/fzRLoEQqXUPgKp0K53eQGGIrzeld m4Kj9DuQ0AH+Ln0phLiCCyrEAd5exfLg0F0B8= X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key, unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=EdEajGPW Subject: [Buildroot] [PATCH v3 1/2] boot/arm-trusted-firmware: v2.11: fix the ld autodetection for gnu-gcc X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marleen Vos , Sergey Matyukevich , Bartosz Bilas , Thomas Petazzoni , Dario Binacchi , linux-amarula@amarulasolutions.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Before applying this patch, the compiler was used instead of the linker as shown by the following error raised by the compilation of TF-A for the STM32MP157C-DK2 discovery board: 'buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc' -o buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf -Wl,--hash-style=gnu -Wl,--as-needed -nostartfiles -Wl,-Map=buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.map -Wl,-dT buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1.ld buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1-stm32mp157c-dk2.o buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/13.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf: error: PHDR segment not covered by LOAD segment collect2: error: ld returned 1 exit status Signed-off-by: Dario Binacchi --- - No changes since v2 - Added in v2 ...-build-Set-guess-gnu-gcc-ld-properly.patch | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 boot/arm-trusted-firmware/v2.11/0001-fix-build-Set-guess-gnu-gcc-ld-properly.patch diff --git a/boot/arm-trusted-firmware/v2.11/0001-fix-build-Set-guess-gnu-gcc-ld-properly.patch b/boot/arm-trusted-firmware/v2.11/0001-fix-build-Set-guess-gnu-gcc-ld-properly.patch new file mode 100644 index 000000000000..a6731aa08853 --- /dev/null +++ b/boot/arm-trusted-firmware/v2.11/0001-fix-build-Set-guess-gnu-gcc-ld-properly.patch @@ -0,0 +1,53 @@ +From 7988f1afe1324486e473874b22ed009c0d6d6806 Mon Sep 17 00:00:00 2001 +From: Dario Binacchi +Date: Wed, 9 Oct 2024 18:29:00 +0200 +Subject: [PATCH] fix(build): Set guess-gnu-gcc-ld properly + +With the commit 291e718229e7f ("build: skip toolchain detection for some +targets"), the compiler was used instead of the linker: + ++ guess-gnu-gcc-cpp = $(1) ++ guess-gnu-gcc-as = $(1) ++ guess-gnu-gcc-ld = $(1) + +This patch correctly references the linker for gnu-gcc. + +The patch was tested on the STM32MP157C-DK2 board. + +This is the error raised during the compilation of ARM Trusted Firmware +v2.11 before applying the patch + +'buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc' -o buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf -Wl,--hash-style=gnu -Wl,--as-needed -nostartfiles -Wl,-Map=buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.map -Wl,-dT buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1.ld buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1-stm32mp157c-dk2.o +buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/13.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf: error: PHDR segment not covered by LOAD segment +collect2: error: ld returned 1 exit status + +Below, after applying the patch: + +'buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/13.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld' -o buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf --hash-style=gnu --as-needed -Map=buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/tf-a-stm32mp157c-dk2.map --script buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/stm32mp1.ld buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/stm32mp1-stm32mp157c-dk2.o +'buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/13.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/objcopy' -O binary buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf buildroot/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/tf-a-stm32mp157c-dk2.bin + +Built /home/dario/projects/buildroot-10/output/build/arm-trusted-firmware-v2.11/build/stm32mp1/release/tf-a-stm32mp157c-dk2.bin successfully + +Fixes: 291e718229e7f ("build: skip toolchain detection for some targets") +Signed-off-by: Dario Binacchi +Upstream: backport from upstream https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/31746 +--- + make_helpers/toolchain.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/make_helpers/toolchain.mk b/make_helpers/toolchain.mk +index 96e43a8b94cb..a81be3751d86 100644 +--- a/make_helpers/toolchain.mk ++++ b/make_helpers/toolchain.mk +@@ -286,7 +286,7 @@ ifndef toolchain-mk + + guess-gnu-gcc-cpp = $(1) + guess-gnu-gcc-as = $(1) +- guess-gnu-gcc-ld = $(1) ++ guess-gnu-gcc-ld = $(shell $(1) --print-prog-name ld 2>$(nul)) + guess-gnu-gcc-oc = $(shell $(1) --print-prog-name objcopy 2>$(nul)) + guess-gnu-gcc-od = $(shell $(1) --print-prog-name objdump 2>$(nul)) + guess-gnu-gcc-ar = $(call which,$(call decompat-path,$(patsubst %$(call file-name,$(1)),%$(subst gcc,gcc-ar,$(call file-name,$(1))),$(call compat-path,$(1))))) +-- +2.43.0 + -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot