This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Selecting from several m68k libc.a


Vitus Jensen wrote:
Hej!

In my build there are several libc.a (and libm.a, libhwdos.a) created and
installed:

T:\C\coldfire\gcc-m68k\m68k-coff\lib\libc.a
T:\C\coldfire\gcc-m68k\m68k-coff\lib\m5200\libc.a
T:\C\coldfire\gcc-m68k\m68k-coff\lib\m68000\libc.a
T:\C\coldfire\gcc-m68k\m68k-coff\lib\mcpu32\libc.a
T:\C\coldfire\gcc-m68k\m68k-coff\lib\msoft-float\libc.a

All different :-(

Using the following linker commands:
STARTUP(hwdos-crt0.o)
OUTPUT_ARCH(m68k)
OUTPUT_FORMAT(srec)
SEARCH_DIR(m68000)
SEARCH_DIR(m68k)
GROUP(-lc -lhwdos)

T:\C\coldfire\gcc-m68k\m68k-coff\lib\libc.a is used.  But this libc.a seems
to be created for a different MC68000 brand than DragonBall, I ran into a
"tst a1" opcode which isn't supported.

So I would like to try other libcs.  Something compiled for the original
MC68000.  Which one is it?  And how do I tell the linker to use it?

Thank you for your help,
    Vitus

PS: simply copying the file is no solution :-((


The way this is supposed to work is that you specify compile options that the compiler uses to select the proper library directory. You should see a bunch of other subdirectories off of your gcc-m68k\m68k-coff directory.


If you run the cross-compiler with the option -print-multi-lib you will see a list of compiler options and to what directory they match up with. You can also specify compiler options and ask it to tell you what subdirectory it is going to fish out of using the -print-multi-directory option. If the option to get code for the DragonBall is not in the list somewhere, you are going to have to edit and rebuild the compiler to add it and then rebuild newlib. Newlib uses the -print-multi-lib option to determine the permutations it will build the library with.

If the option is part of the To do the compile with link is easiest. For example, if the special DragonBall option was -mcpu=dragonball then you simply do a compile with link specifying the -mcpu=dragonball option and the -Tyour.ld option. When the compiler and library are installed in the same location, the compiler knows how to set up the directory to get the library that has been built with the same options. If you attempt to link as a separate step, then you have to manually specify where the library is using the -L option or its script equivalent: SEARCH_DIR. The same applies if you have built the library separate from the compiler. In either case, you need to know the subdirectory of the newlib install directory to get the libraries from which is more cumbersome.

-- Jeff J.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]