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

See the CrossGCC FAQ for lots more information.


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: Hints to build a cross gcc and g++ for barebone (i.e. withoutOS) mips64 big-endian target?


David Mentre kirjoitti:

Has somebody already made a cross gcc (for C and C++) for MIPS, big endian,
64 bits, without OS target?

More than 10 times during the past years, for Linux and Windoze hosts...


I have tried to build a mips-elf newlib target

So why you then wrote about 64 bits? Shouldn't 'mips64-elf' in that case be more right?

using crosstools-0.32 and crosstools' contrib/newlib/ scripts

I don't know what these wacky scripts are doing but seemingly they are doing it totally wrong...

 Just recently I wrote the (generally very simple) instructions for
"building a newlib based GCC with workarounds for the two GCC bugs"
into the 'gcc@gcc.gnu.org' maillist, but seemingly you prefer to
read all kind of weird instructions from newbies and use their weird
scripts. So maybe I should think you already choosing your side but
maybe it is not too late to try to convert you...

but it fails with message:
configure: error: No support for this host/target combination.

There is no recognition system for all the different 'elves' and other
weird creatures like 'coff', 'aout' and 'eabi'. The 'newlib' is the
common name for the 'target' for those creatures using newlib. This is
quite the same as saying "all animals are dangerous", whatever the animal is, it is also a "dangerou", and should be be handled like a
dangerou....


 You seemingly didn't handle your animal like it would be a dangerou and
therefore now have problems... Here the '--with-newlib' used in the GCC
configure is the clue, yoy just tell that you want to use newlib as the
chosen C library.

 Generally all these elves and eabis and such can use anything they like
as their C libraries.... The '-elf', '-coff' etc. only tell the object
format, but usually nothing about the "target system".

 If using newlib that must be told to the GCC configury system, telling
it only here on this list really isn't enough :-)

 So I can bet that you didn't use the required '--with-newlib' in the
GCC configure command although for all the sanity you should have done
so !  Instead you trusted to some wacky scripts made by newbies to do
their things right...

make: *** [configure-target-libstdc++-v3] Error 1

I used following settings:
GCC_LANGUAGES="c,c++"
TARGET=mips-elf
TARGET_CFLAGS="-O2 -finline-limit=10000"
BINUTILS_DIR=binutils-2.15
GCC_DIR=gcc-3.4.3
GCC_EXTRA_CONFIG=
NEWLIB_DIR=newlib-1.13.0

What about expressing your thoughts as a easily understood GCC configure command like:

 $src/configure --prefix=$your_chosen_prefix --target=mips-elf \
 --enable-languages=c,c++ \
 --with-gnu-as --with-gnu-ld --with-newlib

instead of using some wacky parameters for some wacky script none of the experts use when they are producing newlib-based GCCs ?

Any hint on building a cross gcc and cross g++ for MIPS target without OS
would be much appreciated.

Just do as the GCC manuals have told you: preinstall what you have for the target C library (the generic newlib headers in the 'newlib-1.13.0/newlib/libc/include'), then build the target binutils and then the GCC itself for the target. Be happy when having GCC, libiberty and libstdc++ made. And then build the newlib sources with the new GCC... Three builds: binutils, GCC and newlib, in this order, nothing else. Not any wacky "bootstrap" phases with wacky stripped bootstrap-GCCs "KICK - Keep It Complicated Kid" instead of "KISS - Keep It Simple Stupid", is the goal in these scripts. So that they could get their laugh, people who do believe every bullshit they see are quite laughable... Older people just don't see any fun in getting people to climb up the walls.

 Then learn to know that the 'elf' dangerou called as 'mips' is not a
real target, but something like 'pmon' (not to be mixed with a
'pokemon', "pocket monster", but being a "portable monitor") is, and
when producing the "Hello World" for the 'mips-elf' target doesn't
succeed, doing the same for the 'pmon' equipped target board using the
suitable linker script, 'pmon.ld', for it, should succeed.... There
are also other already supported target boards in newlib. And it can be
useful to visit the 'http://www.algor.co.uk' if their MIPS site still
exists, once there was a prebuilt SDE-toolchain plus quite a lot support
stuff for all kind of MIPS based boards...

 Knowing about linker scripts, glue libraries and such is quite
obligatory with these 'embedded' targets....

 Succeeding in building is one thing, that the toolchain works as
expected is another thing. Once there were problems with C++ in gcc-3.x
for embedded MIPS :

F:\usr\local\samples>gpp-mips-elf-32 -Os -o hello_mipself.x hello.cpp
hello.cpp: In function `int main(int, char**)':
hello.cpp:6: Internal compiler error in text_section, at varasm.c:241
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

although earlier there weren't such :

F:\usr\local\samples>gpp-mips-elf -Os -o hello_mipself.x hello.cpp

F:\usr\local\samples>run-mips-elf hello_mipself.x
Hello World!

F:\usr\local\samples>gpp-mips-elf -v
Reading specs from f:\usr\local\lib\gcc-lib\mips-elf\2_95.3-1\specs
gcc version 2.95.3-1 20010315 (release)

At least my Windoze-hosted gcc-3.2.3 for 'mips-elf' had these 'small'
problems :-)

BTW, shouldn't you try the 'mips64-elf' target? Or maybe something more specific seen in the 'gcc/config.gcc' templates like for
'mips64orion-elf', 'mips64vr-elf',..... Building 'mips-elf' and
'mips64-elf' with the gcc-3.4.3 sources definitely succeeds but I
haven't checked what the C++ case now is...





------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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