diff mbox series

[1/4] configs/stm32mp157a_dk1_defconfig: unbreak TF-A build with GCC >= 12

Message ID 20231105183719.3811015-1-peter@korsgaard.com
State Accepted
Headers show
Series [1/4] configs/stm32mp157a_dk1_defconfig: unbreak TF-A build with GCC >= 12 | expand

Commit Message

Peter Korsgaard Nov. 5, 2023, 6:37 p.m. UTC
With the move to default to GCC 12 in commit e0091e42eef9 (package/gcc:
switch to gcc 12.x as the default), TF-A now fails to build as a warning is
generated and it builds with -Werror:

  CC      plat/st/stm32mp1/bl2_plat_setup.c
drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
drivers/st/io/io_stm32image.c:249:13: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized]
  249 |         int result;
      |             ^~~~~~
cc1: all warnings being treated as errors

This is fixed in TF-A v2.6 with commit c1d732d0db24 (fix(io_stm32image):
uninitialized variable warning), but I do not have the board to verify if
v2.6 works, so instead disable -Werror by masssing E=0.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
 configs/stm32mp157a_dk1_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnout Vandecappelle Nov. 5, 2023, 8:22 p.m. UTC | #1
On 05/11/2023 19:37, Peter Korsgaard wrote:
> With the move to default to GCC 12 in commit e0091e42eef9 (package/gcc:
> switch to gcc 12.x as the default), TF-A now fails to build as a warning is
> generated and it builds with -Werror:
> 
>    CC      plat/st/stm32mp1/bl2_plat_setup.c
> drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
> drivers/st/io/io_stm32image.c:249:13: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized]
>    249 |         int result;
>        |             ^~~~~~
> cc1: all warnings being treated as errors
> 
> This is fixed in TF-A v2.6 with commit c1d732d0db24 (fix(io_stm32image):
> uninitialized variable warning), but I do not have the board to verify if
> v2.6 works, so instead disable -Werror by masssing E=0.

  I (or actually, my colleagues) have both a DK1 and a DK2, so shall I test the 
2.9 bump on them?

  Regards,
  Arnout

> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>   configs/stm32mp157a_dk1_defconfig | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
> index ecaace54b8..e764a1558d 100644
> --- a/configs/stm32mp157a_dk1_defconfig
> +++ b/configs/stm32mp157a_dk1_defconfig
> @@ -30,7 +30,7 @@ BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
>   BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
>   BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.5"
>   BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp1"
> -BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-dk1.dtb"
> +BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-dk1.dtb E=0"
>   BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
>   BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
>   BR2_TARGET_UBOOT=y
Peter Korsgaard Nov. 6, 2023, 9:18 a.m. UTC | #2
>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 > On 05/11/2023 19:37, Peter Korsgaard wrote:
 >> With the move to default to GCC 12 in commit e0091e42eef9 (package/gcc:
 >> switch to gcc 12.x as the default), TF-A now fails to build as a warning is
 >> generated and it builds with -Werror:
 >> CC      plat/st/stm32mp1/bl2_plat_setup.c
 >> drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
 >> drivers/st/io/io_stm32image.c:249:13: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized]
 >> 249 |         int result;
 >> |             ^~~~~~
 >> cc1: all warnings being treated as errors
 >> This is fixed in TF-A v2.6 with commit c1d732d0db24
 >> (fix(io_stm32image):
 >> uninitialized variable warning), but I do not have the board to verify if
 >> v2.6 works, so instead disable -Werror by masssing E=0.

Ehh, that should naturally be passing ;)

 >  I (or actually, my colleagues) have both a DK1 and a DK2, so shall I
 >  test the 2.9 bump on them?

Feel free to do so, but it afaik requires a change to the "FIP" format
(and hence shared genimage template) as the stm32 format got dropped in
v2.8 with:

commit 981b9dcb878c868983388cd86c133f663eab1af4
Author: Yann Gautier <yann.gautier@st.com>
Date:   Mon Nov 14 14:14:48 2022 +0100

    refactor(stm32mp1): remove STM32MP_USE_STM32IMAGE

    The code managing legacy boot (without FIP) that was under
    STM32MP_USE_STM32IMAGE flag is remove.

    Change-Id: I04452453ed84567b0de39e900594a81526562259
    Signed-off-by: Yann Gautier <yann.gautier@st.com>

So for 2023.11, I think it makes more sense to stick to v2.5.
Thomas Petazzoni Nov. 6, 2023, 10:11 p.m. UTC | #3
On Sun,  5 Nov 2023 19:37:16 +0100
Peter Korsgaard <peter@korsgaard.com> wrote:

> With the move to default to GCC 12 in commit e0091e42eef9 (package/gcc:
> switch to gcc 12.x as the default), TF-A now fails to build as a warning is
> generated and it builds with -Werror:
> 
>   CC      plat/st/stm32mp1/bl2_plat_setup.c
> drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
> drivers/st/io/io_stm32image.c:249:13: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized]
>   249 |         int result;
>       |             ^~~~~~
> cc1: all warnings being treated as errors
> 
> This is fixed in TF-A v2.6 with commit c1d732d0db24 (fix(io_stm32image):
> uninitialized variable warning), but I do not have the board to verify if
> v2.6 works, so instead disable -Werror by masssing E=0.
> 
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
> ---
>  configs/stm32mp157a_dk1_defconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks all four patches applied. I fixed the massing -> passing typo.

Best regards,

Thomas
Peter Korsgaard Nov. 10, 2023, 12:24 p.m. UTC | #4
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:

 > With the move to default to GCC 12 in commit e0091e42eef9 (package/gcc:
 > switch to gcc 12.x as the default), TF-A now fails to build as a warning is
 > generated and it builds with -Werror:

 >   CC      plat/st/stm32mp1/bl2_plat_setup.c
 > drivers/st/io/io_stm32image.c: In function ‘stm32image_partition_read’:
 > drivers/st/io/io_stm32image.c:249:13: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized]
 >   249 |         int result;
 >       |             ^~~~~~
 > cc1: all warnings being treated as errors

 > This is fixed in TF-A v2.6 with commit c1d732d0db24 (fix(io_stm32image):
 > uninitialized variable warning), but I do not have the board to verify if
 > v2.6 works, so instead disable -Werror by masssing E=0.

 > Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

Committed to 2023.02.x and 2023.08.x, thanks.
diff mbox series

Patch

diff --git a/configs/stm32mp157a_dk1_defconfig b/configs/stm32mp157a_dk1_defconfig
index ecaace54b8..e764a1558d 100644
--- a/configs/stm32mp157a_dk1_defconfig
+++ b/configs/stm32mp157a_dk1_defconfig
@@ -30,7 +30,7 @@  BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.5"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="stm32mp1"
-BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-dk1.dtb"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="STM32MP_SDMMC=1 AARCH32_SP=sp_min DTB_FILE_NAME=stm32mp157a-dk1.dtb E=0"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="*.stm32"
 BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC=y
 BR2_TARGET_UBOOT=y