[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] mshort support



Jo Even Skarstein wrote:
Right! As I see it MiNT needs libgcc, XaAES also libgem.

Are you sure about libgcc? MiNT has it's own "stdlib" - kernlib. I
haven't checked, but I don't think it needs to be linked with any
external lib.

Do not confuse between libc and libgcc.

libc is the "standard library", it contains printf(), malloc() and so on. Basically, all the library functions required by the C standard.
The MiNTLib is the libc implementation for normal TOS/MiNT programs.
The kernel does not use it. It has internal replacements (kernlib).

libgcc contains support for the C language regarding to one CPU, when there is no direct assembly instruction for doing something.
The best example is probably multiplication.
What is the 68000 instruction for multiplying 2 shorts ? muls.
And for 2 longs ? There is none. Several 68000 instructions have to be used to achieve that. So gcc puts this kind of support code in private functions stored in libgcc.
Same things for manipulating floats.

Here is the result if I try to compile xaaes000.km without -lgcc:
c_window.o: In function `_change_window_attribs':
.../c_window.c:1413: undefined reference to `___mulsi3'
k_init.o: In function `_T.140':
.../k_init.c:516: undefined reference to `___udivsi3'
scrlobjc.o: In function `_scroll_up':
.../scrlobjc.c:3193: undefined reference to `___divsi3'
and much more.

So the answer is: yes, xaaes000.km require libgcc, and the correct one.

--
Vincent Rivière