Hi all,
Using the CodeWarrior 4.2 IDE to target a M68K part and I get a number of linker errors:
- undefined "memset" referenced from...
- undefined "memcpy" referenced from...
I thought that these were standard ANSI functions and would be included in the 'standard' library.
1) How do I include a library? Is it placed in the project files or is a reference to it made in the LCF?
2) When should I use a _Runtime library and when should I use a MSL library?
Comments and pointers welcome.
Thanks,
Graham
Hello All,
I have resolved some of my questions regarding standard functions:
- A codeWarrior project needs to include both a runtime and a standard C library
- If you require floating point then include that library as well
- These can all be added to the Project Files list
Nothing is free and I have another question:
The MSL libraries are available in a number of flavours, for example
C_2i_68000_MSL.a
C_2i_68000_PI_MSL.a
C_2i_68000_RegABI_MSL.a
C_2i_68000_RegABI_PI_MSL.a
C_2i_68000_StdABI_MSL.a
C_2i_68000_StdABI_PI_MSL.a
Some of the filnename breakdown is:
'C' = standard 'C'
'2i' = two byte (16-bit) integers
'68000' = target processor
'PI' = unknown - any suggestions?
'RegABI' = unknown -any suggestions?
'StdABI' = unknown -any suggestions?
Regards,
Graham
In the ColdFire Build Tools manual, consult chapter 19, ColdFire Libraries, particularly Table 19.1. It lists how the library name specifies its features. To directly answer your question:
RegABI = register Application Binary Interface, which means the function arguments and result are passed in specific registers, which reduces function call overhead.
StdABI = standard ABI, which means the function arguments and result are passed using the standard C stack calling convention. Useful for maintaining compatibilty with third-party code modules you may link into the program.
PI =Position independent code. All references are made using position relative instructions and not absolute addresses, so that the code module can be located at any memory address and it will still function.
---Tom
Hi Tom,
My version of CodeWarrior doesn't have a 'Coldfire Build Tools' manual - so I would not be surprised if at some stage the manuals underwent a make-over as mine have s few holes in them. Still, I found some information in the 'targeting_embedded_68k_coldfire' manual that has been helpful, but there is has no explaination of 'ABI'!
When it comes to the floating point library, should I use fp_cpu32 or fp_68000 as we are targeting the 68332?
This question arises from the project code generation settings which use CPU32, but then the runtime and standard library only offer filenames with ...68000... in them. I find this inconsitency a little confusing.
Regards,
Graham
Hello
If you are building code for 68332, I would recommand to take fp_cpu32.o as floating point libraries.
There are no CPU32 runtime or MSL libraries as the code from these library does not take advantage of CPU32 specific instructions.
CrasyCat
ABI just specifies the calling conventions used to access functions. For any vendor that writes modules that follow the ABIs, their module should be able to be linked and execute to other modules that follow the ABI.
I don't know enough about the CPU32 to know if generating instructions specific to it will create a problem when using 68000K libraries. If you have the source code for those libraries, you could always try rebuilding them with the CPU32 option enabled.
---Tom