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: Again newlib with arm / thumb interwork


Bernhard Maeder/Alex Raimondi wrote:
> 
> Hi
> 
> A few weeks ago i asked for help to build a newlib which supports
> thumb-interworking. That means it has to be compiled using flag
> -mthumb-interwork.
> 
> Until now i didn't succeed in building such a lib.
> 
> Just be sure if my understanding is right:
> 
> - This "interworking lib" is a matter of newlib. It is built while making
>   newlib and not while makeing gcc or other sutff of gnu tool chain?
> 

Not entirely correct.  There is also a target library that is built with gcc
(libgcc.a).
This is used for standard C operations such as addition of two floats, integer
division, etc..
The code for these operations is dependent on the target options selected. 
Multiple libgcc.a
libraries are built which are used in conjunction with the newlib C libraries
created
with the same compile options (i.e. you need both to correctly link your
application).

The key thing to note is that multilibs are controlled by gcc.  The
list of multilibs and what options are used to generate them are in the hands of
the
compiler.  As stated before, if you use the -print-multi-lib option with
the compiler you can see which multilibs exist.  Newlib simply asks the
compiler, using the aforementioned option, which multilibs should be created.
The command tells newlib what the sub-directories should be named and which
options should be used.  When the compiler is built with newlib in the same
source tree, it knows where in the install tree it can find the correct library
for given multilib options.  Thus, if the user specifies one or more of the
multilib options to gcc and a link is performed, it will correctly link against
the appropriate library.  It should be noted that this does not apply when ld 
is used to link.  Using ld, the user must manually specify the location
of the appropriate multilib libraries.


> - In fact there should be 4 versions of newlib. ARM-newlib (arm code, no
>   interworking), Thumb-newlib (thumb code, no interworking),
>   ARM-interworking-newlib (arm code, interworking) and
>   thumb-interworking-newlib (thumb code, interworking).
> 

Actually, there should be more combinations.
For example, the following was generated with the gnupro-99r1 arm-elf compiler
using
-print-multi-lib:

.;
be;@mbig-endian
fpu;@mhard-float
26bit;@mapcs-26
interwork;@mthumb-interwork
elf;@fno-leading-underscore
under;@fleading-underscore
interwork/elf;@mthumb-interwork@fno-leading-underscore
interwork/under;@mthumb-interwork@fleading-underscore
26bit/elf;@mapcs-26@fno-leading-underscore
26bit/under;@mapcs-26@fleading-underscore
fpu/26bit;@mhard-float@mapcs-26
fpu/interwork;@mhard-float@mthumb-interwork
fpu/elf;@mhard-float@fno-leading-underscore
fpu/under;@mhard-float@fleading-underscore
fpu/interwork/elf;@mhard-float@mthumb-interwork@fno-leading-underscore
fpu/interwork/under;@mhard-float@mthumb-interwork@fleading-underscore
fpu/26bit/elf;@mhard-float@mapcs-26@fno-leading-underscore
fpu/26bit/under;@mhard-float@mapcs-26@fleading-underscore
be/fpu;@mbig-endian@mhard-float
be/26bit;@mbig-endian@mapcs-26
be/interwork;@mbig-endian@mthumb-interwork
be/elf;@mbig-endian@fno-leading-underscore
be/under;@mbig-endian@fleading-underscore
be/interwork/elf;@mbig-endian@mthumb-interwork@fno-leading-underscore
be/interwork/under;@mbig-endian@mthumb-interwork@fleading-underscore
be/26bit/elf;@mbig-endian@mapcs-26@fno-leading-underscore
be/26bit/under;@mbig-endian@mapcs-26@fleading-underscore
be/fpu/26bit;@mbig-endian@mhard-float@mapcs-26
be/fpu/interwork;@mbig-endian@mhard-float@mthumb-interwork
be/fpu/elf;@mbig-endian@mhard-float@fno-leading-underscore
be/fpu/under;@mbig-endian@mhard-float@fleading-underscore
be/fpu/interwork/elf;@mbig-endian@mhard-float@mthumb-interwork@fno-leading-underscore
be/fpu/interwork/under;@mbig-endian@mhard-float@mthumb-interwork@fleading-underscore
be/fpu/26bit/elf;@mbig-endian@mhard-float@mapcs-26@fno-leading-underscore
be/fpu/26bit/under;@mbig-endian@mhard-float@mapcs-26@fleading-underscore


If your gcc compiler is not generating a multilib list which at least includes
support for
mthumb-interwork, then you should either try to get gcc from the net and rebuild
or else contact the gcc help list at gcc-help@gcc.gnu.org for help.

-- Jeff J.


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