help with building an arm-elf big endian newlib

J. Johnston
Tue Oct 1 13:17:00 GMT 2002

Mark Yang wrote:
> could anyone tell me how to build an arm-elf big
> endian newlib? I know by doing -mbig-endian in
> arm-elf-gcc I can make big endian binary code, but I
> think I also need a big endian newlib to compile my
> code.
>  Any suggestion is appreciated!
> yhy
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!

It is already set up for you.

Newlib, by default, builds multilibs.  What this means is that
multiple versions of newlib are built according to a set of
options from the compiler.

Newlib invokes the compiler with the -print-multi-lib option
which reports on what multilibs should be created, what the
directory names should be and what options should be passed.
Each permutation results in separate newlib libraries built with the
specified options.

When the compiler is called to compile and link an application,
it recognizes groups of the multilib-designated options and
knows which version of newlib to link with which has been built with the 
appropriate compiler options.  For this to work, you want gcc and newlib 
installed in the same directory.  You also want to link using the
compiler rather than linking objects via ld.  The ld linker does not
understand where to find the appropriate version of newlib and you
will be forced to do this manually. 

Try issuing arm-elf-gcc -print-multi-lib
to see the list of permutations that will be used to build
newlib.  You should see a number of permutations including
"be" which signifies -mbig-endian.

For more information about how to interpret the output of -print-multi-lib,
see the gcc documentation.

-- Jeff J.

More information about the Newlib mailing list