From patchwork Thu Oct 31 09:33:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3617 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 7367E3F380 for ; Thu, 31 Oct 2024 10:33:22 +0100 (CET) Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-5c95b050667sf652203a12.2 for ; Thu, 31 Oct 2024 02:33:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1730367202; cv=pass; d=google.com; s=arc-20240605; b=Qr+Y2U1SjsxYZDODqADxDXNqZhqNnZ2HB8L3k6pR+UoK5cm2ymbRHUHU/Zjer2inMY h0yy+BJba2wMw+9Q1vspeDeSmVFiQvJahjVaQNnm/Ker1yc1ESUG9EyHY30ipH5fRKLr NppLNQUJ+GpeeptRI4LGBDurPrBIUJPjyPk7YYMfF8mLEc4y2OI2Yfj9vrveLpIig/Mq 9Hh8PhKZphjT1r7s2Yb5Nox9XaZyzMwjbhGaH7J98BiKeeTlZWWwmBqxy/cTwcByKI0q iYvZl8xZr67FlfHQB1PTXUkWKfT6Dq8kjZaHi9UoY6axtZb9hJxj/ZXGSkcNctHaPfwa aYeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iKqDpbkB0kyENhG0hQJNeaRky/vFcTCb5PMBRlDr0ds=; fh=HcpfW812tQQkZpm0mU5+9US3u5cP3hLyR21MTmhlcrA=; b=C4+EhrfcOEnS9JPTv89t186KJhnFv2+VK5iZZWqBV9/9xA8N8VpzIPA3c9pfDa3ri4 GlVit30sd0fM934L5+yMW3t9OcFYUUWjYwm0tV1apClIhhEEuu+H8fmm2T6dPjp7UKxa wZcdjkpzJJfpiQBlKT70y/DQ0dYFtyFib+pYdhfDDdK9JgSUvIR8Rubb58YmuKsj29X7 lCy2cy184QsCEqgUVDwqlCk/rH/wD+oBGPxF7vup/a6WVd9wc9sLmsYz7zwZX1qEhQho axwAXw8OdIa+luxzLtNQ08HBeceEnxzPuNKxXrVY/FvHO9+P7KcMj7AU5RIwppH9VmeJ QeBQ==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QaAa26Ll; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730367202; x=1730972002; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=iKqDpbkB0kyENhG0hQJNeaRky/vFcTCb5PMBRlDr0ds=; b=Y8i4WgGm06yRaqh/ogUmZLF7vhkaBexjHE2m6SRjYBigFI+r1eBEa85asoqJ5JVrCH 8c8r45KnEfnLp/GeBSYnPo0lx5cjidlrX0irTmNVCUksVy9RLPS/R6mM+RsIfvUYmd6d xx1GcFY4EYUWpnpyeWyQpf89+3iKil4y9rvNc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730367202; x=1730972002; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=iKqDpbkB0kyENhG0hQJNeaRky/vFcTCb5PMBRlDr0ds=; b=H+cpZg1QY5tPY1KxEOdoHrzW351Ux6BHRTci6jPbVC63or9mHUmRhWYVPEqv3Haai3 Km/2rCJM9sGFJNKrqoqkE5B6UR0kotkJu2EXd6sObJl5tRgCc2Lcvgvnm+PbXx1WINjB mBoxxBoeAFCC3QvCYwH8X80ed1ryt0M73CgoWprZQM0BhR4+FPQ6gHZTXbxlJkE1LduP h81Dh/IYjbTd4szovAVTyySgVbS+fISGNERUConQOOrSePRmH0UaQGmSvCy+6/crSJl0 +SFn7eZuajt6HBQSyqtMxhLwUp8S7MB3wrUTAI5ydWpKwB7Y8NT2lG+4460f/SFNmfeR zvBg== X-Forwarded-Encrypted: i=2; AJvYcCVCbVkcAfs9XLXMg3MTDp/nZ2cGSVtJC4y5y7RFsQNWOTxuuckgznKU2Hvgv9OYFKSGSEpJbMBgRuQskoEP@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yy6Z2LY17mi0MOwxEwfFCNo51dkUFrGoFuieJuA5yqbSjd+icr+ 8DgYHaltBGB+WLRLCEYiyWxNuSovp3frz7IQzcQzlBGkD9IHiZk+ziUG8Tu+7XyncA== X-Google-Smtp-Source: AGHT+IE5Mq/mK1kEgzK5+CSp6HL3nNyanq220mTZbYVFqSO0UPaaqbd7zKVNug4x6+/EL2OtS2emnQ== X-Received: by 2002:a05:6402:254b:b0:5c9:5a96:2869 with SMTP id 4fb4d7f45d1cf-5cea967a7ebmr2136258a12.10.1730367201657; Thu, 31 Oct 2024 02:33:21 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:34c7:b0:5c6:a1fa:16f with SMTP id 4fb4d7f45d1cf-5cea96ea055ls171625a12.1.-pod-prod-03-eu; Thu, 31 Oct 2024 02:33:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXgz8InyEeesWsyqVSFju2d4Ptgjz5oauYoSnpdnbm5vfnW8LEMfSOn9awV65b41A66RICEAUkERlhDFqcM@amarulasolutions.com X-Received: by 2002:a17:907:2da0:b0:a99:ed2e:3875 with SMTP id a640c23a62f3a-a9e50b56a41mr245532866b.42.1730367199527; Thu, 31 Oct 2024 02:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730367199; cv=none; d=google.com; s=arc-20240605; b=FE4FkK/RUD3EZjpOyjZpEVIDKNNrYueXQbTX/UJC0HdBXdxo+niuvIHfxyerK5eGK6 TZRFZD5HRZUhmMW4BOOFQjidtmuT9Ng3NyV83BcKMXz6luZiZuaM6maDjqQYCw50woee rXF2jr7jhUx8rj6PWA51445Dmzr4Tnr2F/RgwwINMrD0fl0Aq8Un2ZN2Cha50ZeNE3O3 OL9S0TU65e3DMLphL00g0KbvPWUR5OXew/nKlByZhw1KnbKHmJhMDt38+5fxOlVKXYPe DrMiPn1TYwznnBAXCBKU4eW4ZrjPQj159qq0tc9YCtplI3DBIiaynD4oEtzQbtqtHjM4 FcpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=r/9xS2lDOoaSBhB27WbbrwYmapPWl5pqBFHxs5uAlHA=; fh=QakmJmLozwh4Nf7ztVIsdIHmis7N22zqKm0meQYzJd8=; b=DB/sblhs4ojGKXFwvyJCGudYLf9mU40ppbOuOnsd5bK9xpP+5RlrU2QfQWPR46RIyj dNLh8NBv8CxWQQ8G4rPo5K241F9g8YGP90ku6fHmwD68hWU5A0SkpPIGmKE+irnVIswC eqfcel5nRDnA2XY8/dvdPE4wsm1+Ks/PQc6cHZK7TAALiKYULM/O1Xs/K/grJjJGMk9h KaaD32MIP4HE23a9uy9ND94Sz/uZ23BDuquxVymVOQes8f0s2Idk958KLLs6rI1yHqfH 46zk2lC5EoaEGzTM82WXHWsod/v0abL9Kv92VeNTwjgYkw/GDtVVLXW9Ii/QQzXiX8If s3+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QaAa26Ll; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a9e564d1c72sor46834066b.9.2024.10.31.02.33.19 for (Google Transport Security); Thu, 31 Oct 2024 02:33:19 -0700 (PDT) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCULtu+19P04n6eB/VvSx15CQy7J68e2vRAvvAEwp9k9v91YivHWZK0MZCJYNzks4aBa9BPbA2bp/8tU9wSF@amarulasolutions.com X-Received: by 2002:a17:907:6d11:b0:a99:5f16:3539 with SMTP id a640c23a62f3a-a9e505ceefcmr232913066b.0.1730367198962; Thu, 31 Oct 2024 02:33:18 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.. ([2.196.40.36]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9e564c4e0asm45692466b.46.2024.10.31.02.33.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 02:33:18 -0700 (PDT) From: Dario Binacchi To: buildroot@buildroot.org Cc: Dick Olsson , Thomas Petazzoni , Marleen Vos , Bartosz Bilas , Sergey Matyukevich , linux-amarula@amarulasolutions.com, Dario Binacchi Subject: [PATCH v4 1/2] boot/arm-trusted-firmware: v2.11: fix building ST elf file Date: Thu, 31 Oct 2024 10:33:10 +0100 Message-ID: <20241031093311.636608-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=QaAa26Ll; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The commit backports a pending, but likely correct, patch that fixes the following build error: '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 --- Changes v3 -> v4: - Replace the fixing patch. The previous patch did not pass the tests because it caused regressions on platforms other than ST. The review process led to a new patch specifically for the ST platform. No changes since v2 Added in v2 ...pie-option-when-building-ST-elf-file.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch diff --git a/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch b/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch new file mode 100644 index 000000000000..d2b82e0921f4 --- /dev/null +++ b/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch @@ -0,0 +1,37 @@ +From fbd050b61652db732f7a7a1ca36450b1bb339298 Mon Sep 17 00:00:00 2001 +From: Yann Gautier +Date: Tue, 29 Oct 2024 13:42:07 +0100 +Subject: [PATCH] fix(st): set no-pie option when building ST elf file + +This elf file is used to build a binary file that concatenates BL2 and +its device tree blob. It then does not need PIE option, and this avoids +the following compilation error with some compiler versions: + error: PHDR segment not covered by LOAD segment + +Change-Id: I7562e8c1890275fe0409f3a23cc66a8e14ea1ee0 +Signed-off-by: Yann Gautier +Signed-off-by: Dario Binacchi +Upstream: backport from https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/32960 +--- + plat/st/common/common_rules.mk | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plat/st/common/common_rules.mk b/plat/st/common/common_rules.mk +index 212a67d5168c..b9fe3d4d676f 100644 +--- a/plat/st/common/common_rules.mk ++++ b/plat/st/common/common_rules.mk +@@ -58,9 +58,9 @@ $(eval $(call MAKE_LD,${STM32_TF_LINKERFILE},$(STM32_LD_FILE),bl2)) + tf-a-%.elf: $(PLAT)-%.o ${STM32_TF_LINKERFILE} + @echo " LDS $<" + ifeq ($($(ARCH)-ld-id),gnu-gcc) +- ${Q}$($(ARCH)-ld) -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $< ++ ${Q}$($(ARCH)-ld) -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -Wl,-no-pie -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $< + else +- ${Q}$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $< ++ ${Q}$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} -no-pie -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $< + endif + + tf-a-%.bin: tf-a-%.elf +-- +2.43.0 +