Why does the linker try including a noneexistend crt0 object?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Why does the linker try including a noneexistend crt0 object?

跳至解决方案
1,893 次查看
markusregner
NXP Employee
NXP Employee

Here the part of the log file which shows that the linker tries incoroprating a nonexistent crt0.o object:

Building target: DiagnosticsTest_CM7.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "DiagnosticsTest_CM7.elf" "@DiagnosticsTest_CM7.args"
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/real-ld.exe: cannot find crt0.o: No such file or directory
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/real-ld.exe: cannot find -lc
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:76: DiagnosticsTest_CM7.elf] Error 1
"make -j12 TOOLCHAIN=linaro" terminated with exit code 2. Build might be incomplete.

Please guide me to the S32DS tool option which obviously needs to be adjusted.

BTW I also do not see where the option -lc gets set in the tool

 

0 项奖励
回复
1 解答
1,817 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @markusregner,

I haven't really tested the project, but I've just imported and built it. Is this the "S32Gx based S32G-VNP-EVBx diagnostics package version 0.8.7" package?

By "It was already not compiling any longer", do you mean in the newer versions of S32DS? Is this a new error or has this been known by the SW team since Nov? 

The release notes for this package say it is supported by S32DS3.4: 

--Complete suite builds out of box with S32Design Studio v3.4

After importing this project, and right clicking for "Properties", go into "C/C++ Build > Tool Chain Editor". The current toolchain for the project should show up. 

Julin_AragnM_0-1717432307120.png

Just to confirm, after downloading and importing the project, when going into properties, is the NXP GCC 9.2 toolchain selected? 

Best regards,
Julián

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,821 次查看
markusregner
NXP Employee
NXP Employee

BTW, Around November 2023 I discussed with members of the NXP SW team the future of this Diagnostic code. At that time it was already not compiling any longer. And the NXP team knew. So I wonder how you got it compiling now. Anyway... I think the question is how can I chose now the right compiler in my S32DS to make it compile again?

0 项奖励
回复
1,818 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @markusregner,

I haven't really tested the project, but I've just imported and built it. Is this the "S32Gx based S32G-VNP-EVBx diagnostics package version 0.8.7" package?

By "It was already not compiling any longer", do you mean in the newer versions of S32DS? Is this a new error or has this been known by the SW team since Nov? 

The release notes for this package say it is supported by S32DS3.4: 

--Complete suite builds out of box with S32Design Studio v3.4

After importing this project, and right clicking for "Properties", go into "C/C++ Build > Tool Chain Editor". The current toolchain for the project should show up. 

Julin_AragnM_0-1717432307120.png

Just to confirm, after downloading and importing the project, when going into properties, is the NXP GCC 9.2 toolchain selected? 

Best regards,
Julián

0 项奖励
回复
1,822 次查看
markusregner
NXP Employee
NXP Employee

Hi Julian,

Yes, this is a migration of an older project which I used for demonstrating certain functionalities to colleagues and customers. Hence, yes likely it was built with a different GCC at that time.

I tried the workaround described in the link which you sent. It made things even worse. It lead to 135 errors. 

Well to my best knowledge I imported the project just as normal.

So how can I fix it?

BTW, I also wonder why a different GCC compiler lead to a failure message about crt0.o? 

Existence and Absence of such file should matter of the project and not matter of the compiler version. 

Best regards,

-Markus

 

0 项奖励
回复
1,868 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @markusregner,

Could you share some information from your project? 

Are you building the diagnostic tests for S32G-VNP-EVBx Diagnostics? Also, I see on the path that gcc 9.2 is being used, but when importing the EVBx Diagnostics project on my side, I can build them correctly using the default gcc (6.3):

Finished building: ../src/s32g_test_all.c
 
Building target: DiagnosticsTest_CM7.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "DiagnosticsTest_CM7.elf" "@DiagnosticsTest_CM7.args"  
Finished building target: DiagnosticsTest_CM7.elf
 
Invoking: Standard S32DS Create Flash Image
arm-none-eabi-objcopy -O binary DiagnosticsTest_CM7.elf  "DiagnosticsTest_CM7.bin"
Invoking: Standard S32DS Print Size
arm-none-eabi-size --format=berkeley DiagnosticsTest_CM7.elf
   text	   data	    bss	    dec	    hex	filename
 158264	 481664	 247728	 887656	  d8b68	DiagnosticsTest_CM7.elf
Finished building: DiagnosticsTest_CM7.siz
Finished building: DiagnosticsTest_CM7.bin
 
 

13:12:32 Build Finished. 0 errors, 151 warnings. (took 22s.434ms)

Did you port the example? Are you using another package? This issue may be caused by different GCC versions.

Also, take a look at this community post with a similar issue, it was resolved by copying some configuration from the GCC path: Facing Issue with Make file S32K144 [crt0.o : No such Directory] - NXP Community

Best regards,
Julián

0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1876353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%B8%BA%E4%BB%80%E4%B9%88%E9%93%BE%E6%8E%A5%E5%99%A8%E5%B0%9D%E8%AF%95%E5%8C%85%E5%90%AB%E4%B8%8D%E5%AD%98%E5%9C%A8%E7%9A%84%20crt0%20%E5%AF%B9%E8%B1%A1%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1876353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%97%A5%E5%BF%97%E6%96%87%E4%BB%B6%E7%9A%84%E4%B8%8B%E9%9D%A2%E9%83%A8%E5%88%86%E6%98%BE%E7%A4%BA%E9%93%BE%E6%8E%A5%E5%99%A8%E5%B0%9D%E8%AF%95%E5%90%88%E5%B9%B6%E4%B8%8D%E5%AD%98%E5%9C%A8%E7%9A%84%20crt0.o%E7%9B%AE%E7%9A%84%EF%BC%9A%3C%2FP%3E%3CP%3E%E6%9E%84%E5%BB%BA%E7%9B%AE%E6%A0%87%EF%BC%9ADiagnosticsTest_CM7.elf%3CBR%20%2F%3E%E8%B0%83%E7%94%A8%EF%BC%9A%E6%A0%87%E5%87%86S32DS%20C%E9%93%BE%E6%8E%A5%E5%99%A8%3CBR%20%2F%3Earm-none-eabi-gcc%20-o%E2%80%9CDiagnosticsTest_CM7.elf%E2%80%9D%20%E2%80%9C%40DiagnosticsTest_CM7.args%E2%80%9D%3CBR%20%2F%3Ec%3A%2Fnxp%2Fs32ds.3.5%2Fs32ds%2Fbuild_tools%2Fgcc_v9.2%2Fgcc-9.2-arm32-eabi%2Fbin%2F..%2Flib%2Fgcc%2Farm-none-eabi%2F9.2.0%2F..%2F..%2F..%2F..%2Farm-none-eabi%2Fbin%2Freal-ld.exe%3A%E6%89%BE%E4%B8%8D%E5%88%B0%20crt0.o%3A%E6%B2%A1%E6%9C%89%E8%BF%99%E6%A0%B7%E7%9A%84%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95%3CBR%20%2F%3Ec%3A%2Fnxp%2Fs32ds.3.5%2Fs32ds%2Fbuild_tools%2Fgcc_v9.2%2Fgcc-9.2-arm32-eabi%2Fbin%2F..%2Flib%2Fgcc%2Farm-none-eabi%2F9.2.0%2F..%2F..%2F..%2F..%2Farm-none-eabi%2Fbin%2Freal-ld.exe%3A%E6%89%BE%E4%B8%8D%E5%88%B0-lc%3CBR%20%2F%3E%20collect2.exe%EF%BC%9A%E9%94%99%E8%AF%AF%EF%BC%9Ald%20%E8%BF%94%E5%9B%9E%201%20%E9%80%80%E5%87%BA%E7%8A%B6%E6%80%81%3CBR%20%2F%3E%E5%88%B6%E4%BD%9C%EF%BC%9A***%20%5Bmakefile%EF%BC%9A76%EF%BC%9ADiagnosticsTest_CM7.elf%5D%20%E9%94%99%E8%AF%AF%201%3CBR%20%2F%3E%20%E2%80%9Cmake%20-j12%20TOOLCHAIN%3Dlinaro%E2%80%9D%E4%BB%A5%E9%80%80%E5%87%BA%E4%BB%A3%E7%A0%81%202%20%E7%BB%88%E6%AD%A2%E3%80%82%E6%9E%84%E5%BB%BA%E5%8F%AF%E8%83%BD%E4%B8%8D%E5%AE%8C%E6%95%B4%E3%80%82%3C%2FP%3E%3CP%3E%E8%AF%B7%E6%8C%87%E5%AF%BC%E6%88%91%E6%89%BE%E5%88%B0%E6%98%BE%E7%84%B6%E9%9C%80%E8%A6%81%E8%B0%83%E6%95%B4%E7%9A%84%20S32DS%20%E5%B7%A5%E5%85%B7%E9%80%89%E9%A1%B9%E3%80%82%3C%2FP%3E%3CP%3E%E9%A1%BA%E4%BE%BF%E8%AF%B4%E4%B8%80%E5%8F%A5%EF%BC%8C%E6%88%91%E4%B9%9F%E6%B2%A1%E6%9C%89%E7%9C%8B%E5%88%B0%E5%B7%A5%E5%85%B7%E4%B8%AD%E8%AE%BE%E7%BD%AE%E9%80%89%E9%A1%B9%20-lc%20%E7%9A%84%E4%BD%8D%E7%BD%AE%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1879806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E5%9B%9E%E5%A4%8D%EF%BC%9A%E4%B8%BA%E4%BB%80%E4%B9%88%E9%93%BE%E6%8E%A5%E5%99%A8%E5%B0%9D%E8%AF%95%E5%8C%85%E5%90%AB%E4%B8%8D%E5%AD%98%E5%9C%A8%E7%9A%84%20crt0%20%E5%AF%B9%E8%B1%A1%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1879806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%A1%BA%E4%BE%BF%E8%AF%B4%E4%B8%80%E5%8F%A5%EF%BC%8C%E5%A4%A7%E7%BA%A6%E5%9C%A8%202023%20%E5%B9%B4%2011%20%E6%9C%88%EF%BC%8C%E6%88%91%E4%B8%8E%20NXP%20SW%20%E5%9B%A2%E9%98%9F%E7%9A%84%E6%88%90%E5%91%98%E8%AE%A8%E8%AE%BA%E4%BA%86%E8%AF%A5%E8%AF%8A%E6%96%AD%E4%BB%A3%E7%A0%81%E7%9A%84%E6%9C%AA%E6%9D%A5%E3%80%82%E9%82%A3%E6%97%B6%E5%AE%83%E5%B7%B2%E7%BB%8F%E4%B8%8D%E5%86%8D%E7%BC%96%E8%AF%91%E4%BA%86%E3%80%82NXP%20%E5%9B%A2%E9%98%9F%E7%9F%A5%E9%81%93%E8%BF%99%E4%B8%80%E7%82%B9%E3%80%82%E6%89%80%E4%BB%A5%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E4%BD%A0%E7%8E%B0%E5%9C%A8%E6%98%AF%E5%A6%82%E4%BD%95%E7%BC%96%E8%AF%91%E5%AE%83%E7%9A%84%E3%80%82%E5%8F%8D%E6%AD%A3...%E6%88%91%E8%AE%A4%E4%B8%BA%E9%97%AE%E9%A2%98%E6%98%AF%E6%88%91%E7%8E%B0%E5%9C%A8%E5%A6%82%E4%BD%95%E5%9C%A8%E6%88%91%E7%9A%84%20S32DS%20%E4%B8%AD%E9%80%89%E6%8B%A9%E6%AD%A3%E7%A1%AE%E7%9A%84%E7%BC%96%E8%AF%91%E5%99%A8%E6%9D%A5%E4%BD%BF%E5%85%B6%E5%86%8D%E6%AC%A1%E7%BC%96%E8%AF%91%EF%BC%9F%3C%2FP%3E%3C%2FLINGO-BODY%3E