Link against libgcc in CodeWarrior

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

Link against libgcc in CodeWarrior

726 Views
seanmkauffman
Contributor I

I'm using CodeWarrior 5.9 for PowerPC.  My target is the MPC5554.  I have some object files that I need to include in my bare metal project which were compiled using GCC, which means that they need to be linked against libgcc.

 

I have tried simply adding the libgcc.a static library from the correct GCC cross compiler, which CodeWarrior seems to correctly identify as a static library.  However, when I try to link, it gives me the error:

     internal linker error: File: 'ELF_Linker.c' Line: 4878.

 

I also tried compiling the source for libgcc to object files and including the ones I need as source in my project.  This will link, or at least CodeWarrior does not throw errors.  However, the executable does not work, and fails to make it to user code from the initialization routines.

 

Is it possible to include static libraries from GCC when linking in CodeWarrior?  What does the internal error I am getting mean?  Has anyone ever linked against libgcc in CodeWarrior?

Labels (1)
0 Kudos
1 Reply

534 Views
stanish
NXP Employee
NXP Employee

Hello Sean,

Seems you are using quite old version of the compiler.

I'd suggest you to try to use the latest version of e200 compiler. e.g. the one from CW for MCUs v10.6.

Anyway I suspect there might be a discrepancy between CW and GCC object code.

I'd recommend to rebuild the library under CW although it should be theoretically possible to link it if they both conform the same eabi (e.g. PPCEABI)

Internal linker error is a linker crash which may occur due to some unhandled exception occurs while linking.

Hope it helps...

Stan

0 Kudos