Why does the linker try including a noneexistend crt0 object?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why does the linker try including a noneexistend crt0 object?

Jump to solution
1,698 Views
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 Kudos
Reply
1 Solution
1,622 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,626 Views
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 Kudos
Reply
1,623 Views
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 Kudos
Reply
1,627 Views
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 Kudos
Reply
1,673 Views
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 Kudos
Reply