Re: new port : libgcc ? newlib ?

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

 



Florent DEFAY <spira.inhabitant@xxxxxxxxx> writes:

> First, there are 2 libgcc : libgcc1 and libgcc2. What is the difference ?

libgcc1 exists primarily conceptually.  It is the basic set of
operations which can not be reasonably implemented using other
operations.  In the good old days libgcc1 was built using the other
compiler on your system.  Since these days there is generally no other
compiler, most targets provide assembler code to perform the operations.
For example, see config/arm/lib1funcs.asm.

libgcc2, conversely, is the set of operations which can be implemented
reasonably.  For example, if you have a 32-bit add instruction, it's
easy to use it to implement 64-bit addition.  This code appears in
gcc/libgcc2.c.  On many processors it is possible to optimize using
instructions which are not avaliable in C, such as add-with-carry; those
optimizations are written in gcc/longlong.h.


> When reading GCC Internals, I found information about libgcc2 and I
> tried to insert the following line in the t-target :
>
> LIB2FUNCS_EXTRA=mulhi3.S
>
> where mulhi3.S contains the assembler code for the function __mulhi3.

mulhi3 would be in libgcc1, not libgcc2.  You would normally set
LIB1ASMSRC and LIB1ASMFUNCS.


> When building GCC, no rule to compile mulhi3.S

Well, no.  You have to write it yourself.


> Then I tried this (just like msp430) :
>
> LIB1ASMSRC = target/mulhi3.S
> LIB1ASMFUNCS = __mulhi3

Looks right, assuming you've written mulhi3.S.


> Moreover, when building GCC, it finishes with this error :
> *** Configuration target-unknown-none not supported
> make[1]: *** [configure-target-libgcc] Error 1
> make[1]: Leaving directory `/home/me/gcc/build_target'
> make: *** [all] Error 2

This is why libgcc wasn't built.  You need to patch gcc/config.gcc to
support your target.  Actually I don't know how you would have gotten
this far without doing that, so there may besomething else you need to
do.


> I searched about this error. I found a reply. It says "sym-link newlib
> into GCC sources".

That's if you want a C library.  You haven't gotten to that point.  It
won't help with this problem.


> This is the same, I am not intrested in libstdc++, how to disable that?

Run configure with --enable-languages=c.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux