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,886 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,810 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,814 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,811 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,815 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,861 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
%3CLINGO-SUB%20id%3D%22lingo-sub-1876353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EWhy%20does%20the%20linker%20try%20including%20a%20noneexistend%20crt0%20object%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1876353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHere%20the%20part%20of%20the%20log%20file%20which%20shows%20that%20the%20linker%20tries%20incoroprating%20a%20nonexistent%20crt0.o%20object%3A%3C%2FP%3E%3CP%3EBuilding%20target%3A%20DiagnosticsTest_CM7.elf%3CBR%20%2F%3EInvoking%3A%20Standard%20S32DS%20C%20Linker%3CBR%20%2F%3Earm-none-eabi-gcc%20-o%20%22DiagnosticsTest_CM7.elf%22%20%22%40DiagnosticsTest_CM7.args%22%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%20cannot%20find%20crt0.o%3A%20No%20such%20file%20or%20directory%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%20cannot%20find%20-lc%3CBR%20%2F%3Ecollect2.exe%3A%20error%3A%20ld%20returned%201%20exit%20status%3CBR%20%2F%3Emake%3A%20***%20%5Bmakefile%3A76%3A%20DiagnosticsTest_CM7.elf%5D%20Error%201%3CBR%20%2F%3E%22make%20-j12%20TOOLCHAIN%3Dlinaro%22%20terminated%20with%20exit%20code%202.%20Build%20might%20be%20incomplete.%3C%2FP%3E%3CP%3EPlease%20guide%20me%20to%20the%20S32DS%20tool%20option%20which%20obviously%20needs%20to%20be%20adjusted.%3C%2FP%3E%3CP%3EBTW%20I%20also%20do%20not%20see%20where%20the%20option%20-lc%20gets%20set%20in%20the%20tool%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1879973%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Why%20does%20the%20linker%20try%20including%20a%20noneexistend%20crt0%20object%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1879973%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F43391%22%20target%3D%22_blank%22%3E%40markusregner%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EI%20haven't%20really%20tested%20the%20project%2C%20but%20I've%20just%20imported%20and%20built%20it.%20Is%20this%20the%20%22%3CSTRONG%3ES32Gx%20based%20S32G-VNP-EVBx%20diagnostics%20package%20version%200.8.7%3C%2FSTRONG%3E%22%20package%3F%3C%2FP%3E%0A%3CP%3EBy%20%22It%20was%20already%20not%20compiling%20any%20longer%22%2C%20do%20you%20mean%20in%20the%20newer%20versions%20of%20S32DS%3F%20Is%20this%20a%20new%20error%20or%20has%20this%20been%20known%20by%20the%20SW%20team%20since%20Nov%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20release%20notes%20for%20this%20package%20say%20it%20is%20supported%20by%20S32DS3.4%3A%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E--Complete%20suite%20builds%20out%20of%20box%20with%20S32Design%20Studio%20v3.4%3C%2FPRE%3E%0A%3CP%3EAfter%20importing%20this%20project%2C%20and%20right%20clicking%20for%20%22Properties%22%2C%20go%20into%20%22C%2FC%2B%2B%20Build%20%26gt%3B%20Tool%20Chain%20Editor%22.%20The%20current%20toolchain%20for%20the%20project%20should%20show%20up.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Julin_AragnM_0-1717432307120.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Julin_AragnM_0-1717432307120.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F282220i5CB93550EBF4C4AE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Julin_AragnM_0-1717432307120.png%22%20alt%3D%22Julin_AragnM_0-1717432307120.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EJust%20to%20confirm%2C%20after%20downloading%20and%20importing%20the%20project%2C%20when%20going%20into%20properties%2C%20is%20the%20NXP%20GCC%209.2%20toolchain%20selected%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1879806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Why%20does%20the%20linker%20try%20including%20a%20noneexistend%20crt0%20object%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1879806%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EBTW%2C%20Around%20November%202023%20I%20discussed%20with%20members%20of%20the%20NXP%20SW%20team%20the%20future%20of%20this%20Diagnostic%20code.%20At%20that%20time%20it%20was%20already%20not%20compiling%20any%20longer.%20And%20the%20NXP%20team%20knew.%20So%20I%20wonder%20how%20you%20got%20it%20compiling%20now.%20Anyway...%20I%20think%20the%20question%20is%20how%20can%20I%20chose%20now%20the%20right%20compiler%20in%20my%20S32DS%20to%20make%20it%20compile%20again%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1879803%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Why%20does%20the%20linker%20try%20including%20a%20noneexistend%20crt0%20object%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1879803%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Julian%2C%3C%2FP%3E%3CP%3EYes%2C%20this%20is%20a%20migration%20of%20an%20older%20project%20which%20I%20used%20for%20demonstrating%20certain%20functionalities%20to%20colleagues%20and%20customers.%20Hence%2C%20yes%20likely%20it%20was%20built%20with%20a%20different%20GCC%20at%20that%20time.%3C%2FP%3E%3CP%3EI%20tried%20the%20workaround%20described%20in%20the%20link%20which%20you%20sent.%20It%20made%20things%20even%20worse.%20It%20lead%20to%20135%20errors.%26nbsp%3B%3C%2FP%3E%3CP%3EWell%20to%20my%20best%20knowledge%20I%20imported%20the%20project%20just%20as%20normal.%3C%2FP%3E%3CP%3ESo%20how%20can%20I%20fix%20it%3F%3C%2FP%3E%3CP%3EBTW%2C%20I%20also%20wonder%20why%20a%20different%20GCC%20compiler%20lead%20to%20a%20failure%20message%20about%20crt0.o%3F%26nbsp%3B%3C%2FP%3E%3CP%3EExistence%20and%20Absence%20of%20such%20file%20should%20matter%20of%20the%20project%20and%20not%20matter%20of%20the%20compiler%20version.%26nbsp%3B%3C%2FP%3E%3CP%3EBest%20regards%2C%3C%2FP%3E%3CP%3E-Markus%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1877525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Why%20does%20the%20linker%20try%20including%20a%20noneexistend%20crt0%20object%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1877525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F43391%22%20target%3D%22_blank%22%3E%40markusregner%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3ECould%20you%20share%20some%20information%20from%20your%20project%3F%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAre%20you%20building%20the%20diagnostic%20tests%20for%26nbsp%3B%3CSTRONG%3ES32G-VNP-EVBx%20Diagnostics%3C%2FSTRONG%3E%3F%20Also%2C%20I%20see%20on%20the%20path%20that%20gcc%209.2%20is%20being%20used%2C%20but%20when%20importing%20the%20EVBx%20Diagnostics%20project%20on%20my%20side%2C%20I%20can%20build%20them%20correctly%20using%20the%20default%20gcc%20(6.3)%3A%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EFinished%20building%3A%20..%2Fsrc%2Fs32g_test_all.c%0A%20%0ABuilding%20target%3A%20DiagnosticsTest_CM7.elf%0AInvoking%3A%20Standard%20S32DS%20C%20Linker%0Aarm-none-eabi-gcc%20-o%20%22DiagnosticsTest_CM7.elf%22%20%22%40DiagnosticsTest_CM7.args%22%20%20%0AFinished%20building%20target%3A%20DiagnosticsTest_CM7.elf%0A%20%0AInvoking%3A%20Standard%20S32DS%20Create%20Flash%20Image%0Aarm-none-eabi-objcopy%20-O%20binary%20DiagnosticsTest_CM7.elf%20%20%22DiagnosticsTest_CM7.bin%22%0AInvoking%3A%20Standard%20S32DS%20Print%20Size%0Aarm-none-eabi-size%20--format%3Dberkeley%20DiagnosticsTest_CM7.elf%0A%20%20%20text%09%20%20%20data%09%20%20%20%20bss%09%20%20%20%20dec%09%20%20%20%20hex%09filename%0A%20158264%09%20481664%09%20247728%09%20887656%09%20%20d8b68%09DiagnosticsTest_CM7.elf%0AFinished%20building%3A%20DiagnosticsTest_CM7.siz%0AFinished%20building%3A%20DiagnosticsTest_CM7.bin%0A%20%0A%20%0A%0A13%3A12%3A32%20Build%20Finished.%200%20errors%2C%20151%20warnings.%20(took%2022s.434ms)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EDid%20you%20port%20the%20example%3F%20Are%20you%20using%20another%20package%3F%20This%20issue%20may%20be%20caused%20by%20different%20GCC%20versions.%3C%2FP%3E%0A%3CP%3EAlso%2C%20take%20a%20look%20at%20this%20community%20post%20with%20a%20similar%20issue%2C%20it%20was%20resolved%20by%20copying%20some%20configuration%20from%20the%20GCC%20path%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FFacing-Issue-with-Make-file-S32K144-crt0-o-No-such-Directory%2Fm-p%2F1642585%22%20target%3D%22_blank%22%3EFacing%20Issue%20with%20Make%20file%20S32K144%20%5Bcrt0.o%20%3A%20No%20such%20Directory%5D%20-%20NXP%20Community%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FP%3E%3C%2FLINGO-BODY%3E