Can't Creat Statick Link Library in S32 Design Studio v3.4

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

Can't Creat Statick Link Library in S32 Design Studio v3.4

Jump to solution
1,362 Views
Anony
Contributor II

I need to use the static link library in S32DS v3.4.The compiler as shown below:

Anony_4-1673241193596.png

My operations are as follows:

1. First, create a project that can generate library files, and then compile to generate TestLib.a file,I use the default options during project creation;

Anony_0-1673241002477.png

 

2. Then create an application project and add the above library files to the new application project,I use the default options during project creation;;

Anony_1-1673241002088.png

3.I add the LibTestLib. a file to the application project, and the settings are shown in the following figure

Anony_2-1673241001823.png

4. The following error prompt appears when compiling the application project.

Anony_3-1673241002030.png

My questions are as follows:

In the previous S32DS software version, I could create and add my static link library files according to the above steps, but failed in S32DS v3.4. What are the differences between creating static link library files in S32DS v3.4 and previous software versions, and what should be paid attention to? Is there a description document for creating and using static link libraries in S32DS v3.4 that I can refer to?

0 Kudos
1 Solution
1,308 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

it looks okay. Even with fresh library build you still aren't  able link your library? 

Your original library contains mylibrary.o file. If I extract it from library archive and run nm - it says that the platform is unknown: 

jiri_kral_1-1673350510264.png

 

If I build it again on my side - the content can be recognized normally: 

jiri_kral_0-1673350436209.png

 

For reference - here is HEX view - on the left is your library - the E-SafeNet is suspicious. Also there is no function name - ec_TestFunc at all. On the right side is library build on my machine from your project. 

jiri_kral_3-1673351475386.png

If I'm correct (I'm not familiar with it) - E-SafeNet is some kind of encryption - probably running on your machine. 

Jiri

 

 

 

View solution in original post

0 Kudos
9 Replies
1,345 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

can you please share full console output from your library build? 

 

I just did quick test and with the same compiler version for lib and project - there is no issue on my side and library can be successfully linked. 

0 Kudos
1,342 Views
Anony
Contributor II

Hello,

Thank you very much for your reply.

I pasted the complete console output below. Please help me analyze it. Thank you very much.

I also put the application project and generated library project I use on the attachment.

Project description:

1.S32K144_Lib.  This is the project used to generate. a file.

2.S32K144_Lib_BuildTest. This is the application project.

The following is the full Console output information:

21:58:26 **** Build of configuration Debug_FLASH for project S32K144_Lib_BuildTest ****
make -j8 all
Building file: ../src/main.c
Building file: ../Project_Settings/Startup_Code/startup.c
Building file: ../Project_Settings/Startup_Code/startup_S32K144.S
Invoking: Standard S32DS C Compiler
Building file: ../Project_Settings/Startup_Code/system_S32K144.c
Invoking: Standard S32DS Assembler
arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup_S32K144.args" -o "Project_Settings/Startup_Code/startup_S32K144.o" "../Project_Settings/Startup_Code/startup_S32K144.S"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/system_S32K144.d" -MT"Project_Settings/Startup_Code/system_S32K144.o" -o "Project_Settings/Startup_Code/system_S32K144.o" "../Project_Settings/Startup_Code/system_S32K144.c"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Finished building: ../Project_Settings/Startup_Code/startup_S32K144.S

Finished building: ../src/main.c

Finished building: ../Project_Settings/Startup_Code/startup.c
Finished building: ../Project_Settings/Startup_Code/system_S32K144.c


Building target: S32K144_Lib_BuildTest.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "S32K144_Lib_BuildTest.elf" "@S32K144_Lib_BuildTest.args"
D:/NXP/workspaceS32DS.3.4VVV/S32K144_Lib_BuildTest/src\libS32K144_Lib.a: error adding symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:36: S32K144_Lib_BuildTest.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.

0 Kudos
1,338 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

at first glance - you library project is empty. There is no source code at all. That's why linker can't find any item inside. 

0 Kudos
1,336 Views
Anony
Contributor II

Hello,

Thank you for your prompt response. According to your minder, I added a function to the library project, and then updated the library file  to the application project. The compiled application project still reported error. If it is convenient, can you put the project you used in the test on the attachment? Let me compile it on my computer.

This is the full Console output information:

23:23:51 **** Incremental Build of configuration Debug_FLASH for project S32K144_Lib_BuildTest ****
make -j8 all
Building file: ../src/main.c
Building file: ../Project_Settings/Startup_Code/startup.c
Building file: ../Project_Settings/Startup_Code/startup_S32K144.S
Building file: ../Project_Settings/Startup_Code/system_S32K144.c
Invoking: Standard S32DS C Compiler
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@src/main.args" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Invoking: Standard S32DS Assembler
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup_S32K144.args" -o "Project_Settings/Startup_Code/startup_S32K144.o" "../Project_Settings/Startup_Code/startup_S32K144.S"
arm-none-eabi-gcc "@Project_Settings/Startup_Code/startup.args" -MMD -MP -MF"Project_Settings/Startup_Code/system_S32K144.d" -MT"Project_Settings/Startup_Code/system_S32K144.o" -o "Project_Settings/Startup_Code/system_S32K144.o" "../Project_Settings/Startup_Code/system_S32K144.c"
Finished building: ../Project_Settings/Startup_Code/startup_S32K144.S

Finished building: ../src/main.c

Finished building: ../Project_Settings/Startup_Code/startup.c
Finished building: ../Project_Settings/Startup_Code/system_S32K144.c


Building target: S32K144_Lib_BuildTest.elf
Invoking: Standard S32DS C Linker
arm-none-eabi-gcc -o "S32K144_Lib_BuildTest.elf" "@S32K144_Lib_BuildTest.args"
D:/NXP/workspaceS32DS.3.4VVV/S32K144_Lib_BuildTest/src\libS32K144_Lib.a: error adding symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:36: S32K144_Lib_BuildTest.elf] Error 1
"make -j8 all" terminated with exit code 2. Build might be incomplete.

0 Kudos
1,331 Views
jiri_kral
NXP Employee
NXP Employee

Can you share console output from building the library? On your side it is built in some strange way. I imported your library project, build (nothing changed) and it can be normally linked. 

The library from your shared project is completely different in binary form for some reason. With the library archive from your .zip file I can reproduce the issue. 

0 Kudos
1,323 Views
Anony
Contributor II

Hello,

Thank you.

This is the full Console output of library project:

07:39:56 **** Incremental Build of configuration Debug for project S32K144_Lib ****
make -j8 all
Building file: ../src/mylibrary.c
Invoking: Standard S32DS C Compiler
arm-none-eabi-gcc "@src/mylibrary.args" -MMD -MP -MF"src/mylibrary.d" -MT"src/mylibrary.o" -o "src/mylibrary.o" "../src/mylibrary.c"
Finished building: ../src/mylibrary.c

Building target: libS32K144_Lib.a
Invoking: Standard S32DS Archiver
arm-none-eabi-ar -r "libS32K144_Lib.a" ./src/mylibrary.o
D:\NXP\S32DS.3.4\S32DS\build_tools\gcc_v6.3\gcc-6.3-arm32-eabi\bin\arm-none-eabi-ar.exe: creating libS32K144_Lib.a
Finished building target: libS32K144_Lib.a

0 Kudos
1,309 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

it looks okay. Even with fresh library build you still aren't  able link your library? 

Your original library contains mylibrary.o file. If I extract it from library archive and run nm - it says that the platform is unknown: 

jiri_kral_1-1673350510264.png

 

If I build it again on my side - the content can be recognized normally: 

jiri_kral_0-1673350436209.png

 

For reference - here is HEX view - on the left is your library - the E-SafeNet is suspicious. Also there is no function name - ec_TestFunc at all. On the right side is library build on my machine from your project. 

jiri_kral_3-1673351475386.png

If I'm correct (I'm not familiar with it) - E-SafeNet is some kind of encryption - probably running on your machine. 

Jiri

 

 

 

0 Kudos
1,290 Views
Anony
Contributor II

Hello,

It is really caused by file encryption software.This E-SafeNet is the encryption software. The problem of adding static libraries has been solved. Thank you very much for your analysis and guidance. Thank you very much.

1,302 Views
Anony
Contributor II

Hello,

My computer has a file encryption system installed.I need to check if the problem is caused by this encryption system.Your guidance is really helpful. I really appreciate it.

0 Kudos