May be then TFM docs should be updated to add dependency on OS native compiler?

 

Regards,

Bohdan Hunko

 

Cypress Semiconductor Ukraine

Engineer

CSUKR CSS ICW SW FW

Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com

 

 

From: Edward Yang <edwardyang@mxic.com.cn>
Sent: 10 February 2023 11:38
To: Hunko Bohdan (CSUKR CSS ICW SW FW 3) <Bohdan.Hunko@infineon.com>; tf-m@lists.trustedfirmware.org
Cc: David.Hu@arm.com; Summer.Qin@arm.com; nd@arm.com; Poppy Wu <poppywu@mxic.com.cn>
Subject: Fw: [TF-M] Re: GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.

 


Hi all,

Thanks for your helpful advice, yes, the build error caused by Ubuntu own GCC compiler.

I just relink the gcc to GCC 4.8.5 instead of GCC 5.2 (both GCC versions are installed in my Ubuntu environment),

then build succeed.

Best Regards,
Poppy Wu
吴偏偏

Macronix Microelectronics (Suzhou) Co.,Ltd


"Bohdan.Hunko--- via TF-M" <tf-m@lists.trustedfirmware.org>

2023/02/10 04:58

Please respond to
Bohdan.Hunko@infineon.com

To

<Anton.Komlev@arm.com>, <David.Hu@arm.com>, <Summer.Qin@arm.com>, <edwardyang@mxic.com.cn>, <tf-m@lists.trustedfirmware.org>

cc

Antonio.DeAngelis@arm.com, Ken.Liu@arm.com, Kevin.Peng@arm.com, nd@arm.com

Subject

[TF-M] Re: GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 




Hi all,
 
I think I know what the problem is.
I believe it is related to the problem I have reported earlier in mailing thread https://lists.trustedfirmware.org/archives/list/tf-m@lists.trustedfirmware.org/message/F3WT4OBAOLTBFCSRXC7KFJTFWZRONOD3/
Problem occurs during built of psa_generate_database target. The same was reported by me in the mailing thread. The only difference is that I used Windows.
So I have investigated the problem and found the solution, hope it will help you.
 
Turns out PSA arch tests use native platform compiler (e.g. GCC for windows) to compile some generated files and then these compiled files are used in the rest of the build using compiler for arm platform.
<psa-arch-tests>/api-tests/CMakeLists.txt adds External project (ExternalProject_Add()) which generates the device database that is needed for the rest of the build.
 
As I said psa_generate_database built invokes native compiler, so call to cc1 is not the call to gcc-arm-none-eabi-10.3-2021.10/lib/gcc/arm-none-eabi/10.3.1/cc1, it is a call to linux native cc1 compiler (to compile given .c file to be executed on Linux)
 
I have installed llvm-mingw and added its bin folder to PATH and this fixed the problem. I think GCC (or other native compilers) will also work.
 
Looks like ARM TF-M team has native compiler installed on their working machines so arch tests build works right away.
 
So my suggestion is to install linuz native cc1 compiler and add it to the PATH
 
Please let me know if this fixed the problem.
 
Regards,
Bohdan Hunko
 
Cypress Semiconductor Ukraine
Engineer
CSUKR CSS ICW SW FW
Mobile: +38099 50 19 714
Bohdan.Hunko@infineon.com
 
 
From: Anton Komlev via TF-M <tf-m@lists.trustedfirmware.org>
Sent:
9 February 2023 15:23
To:
David Hu <David.Hu@arm.com>; Summer Qin <Summer.Qin@arm.com>; Edward Yang <edwardyang@mxic.com.cn>
Cc:
Antonio De Angelis <Antonio.DeAngelis@arm.com>; Ken Liu <Ken.Liu@arm.com>; Kevin Peng <Kevin.Peng@arm.com>; nd <nd@arm.com>; tf-m@lists.trustedfirmware.org
Subject:
[TF-M] Re: GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 

Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe.


 
Hi,
 
I cut the bottom part of this thread to speedup communication because mailing server asks for approval every mail bigger 80Kb.
 
Cheers,
Anton
 
From: David Hu via TF-M <tf-m@lists.trustedfirmware.org>
Sent:
Thursday, February 9, 2023 8:35 AM
To:
Summer Qin <
Summer.Qin@arm.com>; Edward Yang <edwardyang@mxic.com.cn>
Cc:
Antonio De Angelis <
Antonio.DeAngelis@arm.com>; Ken Liu <Ken.Liu@arm.com>; Kevin Peng <Kevin.Peng@arm.com>; nd <nd@arm.com>; tf-m@lists.trustedfirmware.org
Subject:
[TF-M] Re: GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0
 
Hi Poppy,
 
Can you please try the following?

 
Best regards,
Hu Ziji
 
From: Summer Qin <Summer.Qin@arm.com>
Sent:
Thursday, February 9, 2023 4:20 PM
To:
Edward Yang <
edwardyang@mxic.com.cn>
Cc:
Antonio De Angelis <
Antonio.DeAngelis@arm.com>; David Hu <David.Hu@arm.com>; Ken Liu <Ken.Liu@arm.com>; Kevin Peng <Kevin.Peng@arm.com>; nd <nd@arm.com>; tf-m@lists.trustedfirmware.org; Poppy Wu <poppywu@mxic.com.cn>
Subject:
Re: [TF-M] GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 
Hi Edward,
 
It seems the local build environment issue, could you try to manually add the cc1 path into PATH, and try to build.
 
 
Best Regards,
Summer

 



From: Edward Yang <edwardyang@mxic.com.cn>
Sent:
Thursday, February 9, 2023 3:14 PM
To:
Summer Qin <
Summer.Qin@arm.com>
Cc:
Antonio De Angelis <
Antonio.DeAngelis@arm.com>; David Hu <David.Hu@arm.com>; Ken Liu <Ken.Liu@arm.com>; Kevin Peng <Kevin.Peng@arm.com>; nd <nd@arm.com>; tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>; Poppy Wu <poppywu@mxic.com.cn>
Subject:
Re: [TF-M] GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 

Hi Summer,

I have shorten the project path, still the same. And I have checked cc1 does exist in the folder. By the way, I'm using Ubuntu 16.04,

is this probably the reason for building error?



[Screenshot and build log removed to reduce mail thread size]

-- Generating done
-- Build files have been written to: /home/a/workspace1/TF-M/trusted-firmware-m/cmake_build/tf-m-tests/app/psa_api_tests/src/psa_generate_database-build

[ 52%] No build step for 'psa_generate_database'

[ 52%] Performing install step for 'psa_generate_database'

[ 20%] [PSA] : Creating generator source /home/a/workspace1/TF-M/trusted-firmware-m/cmake_build/tf-m-tests/app/psa_api_tests/targetConfigGen.c

Cannot open input file /home/a/workspace1/TF-M/psa-arch-tests/api-tests/platform/targets/tgt_dev_apis_tfm_stm32l562e_dk/target.cfg

Scanning dependencies of target TargetConfigGen

[ 40%] Building C object CMakeFiles/TargetConfigGen.dir/home/a/workspace1/TF-M/trusted-firmware-m/cmake_build/tf-m-tests/app/psa_api_tests/targetConfigGen.c.o

cc: error trying to exec 'cc1': execvp: No such file or directory

CMakeFiles/TargetConfigGen.dir/build.make:85: recipe for target 'CMakeFiles/TargetConfigGen.dir/home/a/workspace1/TF-M/trusted-firmware-m/cmake_build/tf-m-tests/app/psa_api_tests/targetConfigGen.c.o' failed

make[5]: *** [CMakeFiles/TargetConfigGen.dir/home/a/workspace1/TF-M/trusted-firmware-m/cmake_build/tf-m-tests/app/psa_api_tests/targetConfigGen.c.o] Error 1

CMakeFiles/Makefile2:96: recipe for target 'CMakeFiles/TargetConfigGen.dir/all' failed

make[4]: *** [CMakeFiles/TargetConfigGen.dir/all] Error 2

Makefile:148: recipe for target 'all' failed

make[3]: *** [all] Error 2

tf-m-tests/app/psa_api_tests/CMakeFiles/psa_generate_database.dir/build.make:93: recipe for target 'tf-m-tests/app/psa_api_tests/src/psa_generate_database-stamp/psa_generate_database-install' failed

make[2]: *** [tf-m-tests/app/psa_api_tests/src/psa_generate_database-stamp/psa_generate_database-install] Error 2

CMakeFiles/Makefile2:1905: recipe for target 'tf-m-tests/app/psa_api_tests/CMakeFiles/psa_generate_database.dir/all' failed

make[1]: *** [tf-m-tests/app/psa_api_tests/CMakeFiles/psa_generate_database.dir/all] Error 2

Makefile:148: recipe for target 'all' failed

make: *** [all] Error 2

(python3.6) root@Thinos16-dev:~/workspace1/TF-M/trusted-firmware-m/cmake_build#




Best Regards,
Poppy Wu

鍚村亸鍋
?br>
Macronix Microelectronics (Suzhou) Co.,Ltd

Summer Qin via TF-M <tf-m@lists.trustedfirmware.org>

2023/02/08 17:51

 

Please respond to
Summer Qin <
Summer.Qin@arm.com>

 

To

Antonio De Angelis <Antonio.DeAngelis@arm.com>, "tf-m@lists.trustedfirmware.org" <tf-m@lists.trustedfirmware.org>, Edward Yang <edwardyang@mxic.com.cn>

cc

Ken Liu <Ken.Liu@arm.com>, Kevin Peng <Kevin.Peng@arm.com>, David Hu <David.Hu@arm.com>, nd <nd@arm.com>

Subject

[TF-M] Re: GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0


 

 





Hi Edward,


We tried to reproduce it with the same environment with yours, but could not reproduce the build error, it builds successfully. Any update?


By the way, noticed your path is long and contains two tfm folder name, is it nested? Try to simplify the path and try again?


Best Wishes,
Summer

 




From:
Edward Yang via TF-M <tf-m@lists.trustedfirmware.org>
Sent:
Tuesday, February 7, 2023 1:15 PM
To:
Antonio De Angelis <
Antonio.DeAngelis@arm.com>; tf-m@lists.trustedfirmware.org <tf-m@lists.trustedfirmware.org>
Cc:
Ken Liu <
Ken.Liu@arm.com>; Kevin Peng <Kevin.Peng@arm.com>; David Hu <David.Hu@arm.com>
Subject:
[TF-M] GCC build error of PSA Arch test with TF-M V1.6.0 and TF-M V1.7.0

 

Hi Antonio,


Thanks for your suggestions. Indeed, if TEST_PSA_API is disabled, the build will succeed. So I

suppose this build error is specific to PSA Arch test build, but I haven't got a clue about which files
should be checked, any guidance would be appreciated.


Best Regards,
Poppy Wu

鍚村亸鍋
?br>
Macronix Microelectronics (Suzhou) Co.,Ltd

Antonio De Angelis via TF-M <tf-m@lists.trustedfirmware.org>
2023/02/06 23:27

 

Please respond to
Antonio De Angelis <
Antonio.DeAngelis@arm.com>

 

 

To

Edward Yang <edwardyang@mxic.com.cn>, "tf-m@lists.trustedfirmware.org" <tf-m@lists.trustedfirmware.org>

cc

nd <nd@arm.com>

Subject

[TF-M] Re: gcc build error with TF-M v1.6.0 and v1.7.0


 

 






Hi,


This looks like an issue with the toolchain, as cc1 should be configured correctly (in the correct $PATH) in your build environment. I am not sure about the specific solution for this, can only suggest to:


1.        
Make sure that cc1 is part of your toolchain installation
2.        
PATH is set correctly

You can also check if this happens with the default build (i.e. not with PSA Arch tests). In case this is specific to PSA Arch test build, suggest to check with them directly.


Hope this somehow helps.

/Antonio


From:
Edward Yang via TF-M <tf-m@lists.trustedfirmware.org>
Sent:
Monday, February 6, 2023 04:02
To:
tf-m@lists.trustedfirmware.org
Subject:
[TF-M] gcc build error with TF-M v1.6.0 and v1.7.0


Hi experts,

Recently we're testing TF-M v1.6.0, but a build error was encountered as shown below in red box.

[Screenshot and build log removed to reduce mail thread size]

We've reinstalled the dependency tools as described in TF-M "Getting Started Guide",

besides the same gcc tool works fine with TF-M v1.4.0, are there anything we've ignored?





Best Regards,
Poppy Wu

鍚村亸鍋
?/font>

Macronix Microelectronics (Suzhou) Co.,Ltd
--
TF-M mailing list --
tf-m@lists.trustedfirmware.org
To unsubscribe send an email to
tf-m-leave@lists.trustedfirmware.org
--
TF-M mailing list --
tf-m@lists.trustedfirmware.org
To unsubscribe send an email to
tf-m-leave@lists.trustedfirmware.org--
TF-M mailing list -- tf-m@lists.trustedfirmware.org
To unsubscribe send an email to tf-m-leave@lists.trustedfirmware.org