Hi Brian,

Could you please send the build command so I can reproduce this issue?


Best Wishes,
Summer

From: Quach, Brian <brian@ti.com>
Sent: Tuesday, December 5, 2023 4:03 AM
To: Summer Qin <Summer.Qin@arm.com>; tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Cc: nd <nd@arm.com>
Subject: RE: FPU flags for mbedTLS targets
 

Hi Summer,

 

Yes, I saw an issue linking with p256m because it did not have the correct FP flag.

 

[ 98%] Linking C executable ../bin/tfm_s.axf

/home/brian/.conan/data/arm-none-eabi-gcc/12.3.Rel1-0/library-msp/ga/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: error: ../bin/tfm_s.axf uses VFP register arguments, partitions/crypto/mbedcrypto/3rdparty/p256-m/libcrypto_service_p256m.a(p256-m_driver_entrypoints.o) does not

/home/brian/.conan/data/arm-none-eabi-gcc/12.3.Rel1-0/library-msp/ga/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file partitions/crypto/mbedcrypto/3rdparty/p256-m/libcrypto_service_p256m.a(p256-m_driver_entrypoints.o)

/home/brian/.conan/data/arm-none-eabi-gcc/12.3.Rel1-0/library-msp/ga/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: error: ../bin/tfm_s.axf uses VFP register arguments, partitions/crypto/mbedcrypto/3rdparty/p256-m/libcrypto_service_p256m.a(p256-m.o) does not

/home/brian/.conan/data/arm-none-eabi-gcc/12.3.Rel1-0/library-msp/ga/package/44fcf6b9a7fb86b2586303e3db40189d3b511830/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file partitions/crypto/mbedcrypto/3rdparty/p256-m/libcrypto_service_p256m.a(p256-m.o)

 

Regards,
Brian

 

From: Summer Qin <Summer.Qin@arm.com>
Sent: Monday, December 4, 2023 12:30 AM
To: tf-m@lists.trustedfirmware.org; Quach, Brian <brian@ti.com>
Cc: nd <nd@arm.com>
Subject: [EXTERNAL] Re: FPU flags for mbedTLS targets

 

Hi Brian,

 

The ${COMPILER_CP_FLAG} flag is already imported to crypto_service_mbedcrypto target by link with platform_s (the flags are added in platform_s target).

When I enabled FPU cmake build option, the fpu flags were in my local crypto_service_mbedcrypto.dir flags.make file:

-mfpu=fpv5-d16 -mfloat-abi=hard

Did you face any issues when trying p256m? I noticed p256m does not inherit FP flag but it won't affect the build and running on my side.

 

 

Best Regards,

Summer


From: Quach, Brian via TF-M <tf-m@lists.trustedfirmware.org>
Sent: Saturday, December 2, 2023 12:26 AM
To: tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Subject: [TF-M] FPU flags for mbedTLS targets

 

Hi,

 

/secure_fw/partitions/crypto/CMakeLists.txt is missing passing compiler flags to mbedTLS targets which would be needed for correct FPU flags.  I believe the highlighted code would be the fix:

 

target_compile_options(${MBEDTLS_TARGET_PREFIX}mbedcrypto

    PRIVATE

        ${COMPILER_CP_FLAG}

        $<$<C_COMPILER_ID:GNU>:-Wno-unused-const-variable>

        $<$<C_COMPILER_ID:GNU>:-Wno-unused-parameter>

        $<$<C_COMPILER_ID:ARMClang>:-Wno-unused-const-variable>

        $<$<C_COMPILER_ID:ARMClang>:-Wno-unused-parameter>

)

 

 

target_compile_options(${MBEDTLS_TARGET_PREFIX}p256m

    PRIVATE

        ${COMPILER_CP_FLAG}

)

 

 

Regards,

 

Brian Quach

SimpleLink MCU

Texas Instruments Inc.

12500 TI Blvd, MS F-4000

Dallas, TX 75243

214-479-4076