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

See the CrossGCC FAQ for lots more infromation.


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

Re: Help building a mipsel-r3000-elfl compiler


Tom Wilson wrote:

> 2)built i586-pc-linux-gnu host to mips-r3000-elfl binutils with
> --prefix=/usr/local/mips-r3000-elfl
> 3)configured  gcc 2.96.2... thus:
> 
> --target=mipsel-r3000-elfl
> --prefix=/usr/local/mipsel-r3000-elfl
> 
> (as recommended by faq)

 Cannot believe... Did the FAQ really say that you are allowed or
recommended to use different names for the install root, '--prefix=...' ?
Or was this just a typo?

> That went ok...
> 
> I try to build using make all but get various problems along the way, 95%
> of which are just sym link problems.

 The rule which the FAQ should have told is that the installation of the
target stuff happens under the $prefix/$target, so if you use a different
values for the '--prefix=...'es, the binutils stuff will be installed into
a place where GCC cannot find it... I remember you having problems with the
'xgcc' not finding the target 'as', because you used the default prefix
(/usr/local) for binutils and something else for GCC...

> I acn get as far as the test stage of the build then get an error message
> about the newly built compiler not producing execututables.

 Please explain which kind of system you think the 'mipsel-r3000-elfl' to
be ?  Ok, a R3000-compatible CPU and little-endian ELF object format but
what is the opsys or the I/O-structure in your board ?  Where does your
'Hello World' write the message? And what is the memory layout for your
executables?

  When you have these things clear, you perhaps will find the glue libraries
for the supported MIPS-boards, select someone of them for the extra one for
linking, besides only the 'libc.a', then select the linker script for the
same board and get the memory layout from it. When everything is set for
a known target, then the compiler can produce executables for it. The default
settings are in the 'specs' file ('.../gcc/specs' during the build) and the
essential specs are the '*link:' and the '*lib:'. To the first you add the
linker script name and to the second the glue library name. Something like:

----------------------------- clip ----------------------------------------
*link:
%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} %{bestGnum} %{shared}
%{non_shared} %(linker_endian_spec) -T idt.ld%s

*lib:
-lc -lidt -lc

*libgcc:
----------------------------- clip ----------------------------------------

 Although the link-spec is wrapped here, it should be on a single line! No
extra lines between the specs, just one empty line... The IDT-board stuff
was used here, the 'libidt.a' and 'idt.ld' come with (the built) newlib.
The link- and lib-specs will appear on the same 'ld' command line, so you
could put the linker script name on the lib-spec too... The '-lc' appears
twice because it can be possible that the 'libidt.a' needs still something
from 'libc.a'. The GNU ld cannot step backwards and take something from an
already scanned library...

 After the build has succeded, you can remove the default target settings,
or replace them with your own ones.

> The aim of this is to build libstdc++v3 for the mips target.

 Just tell what happens... I remember the 'mipstx39-elf' (probably also the
'mipstx39el-elf') working with C++, but not 'mips-elf' (or 'mipsel-elf') if
built from the gcc-2.95.2 sources... Your mystic 2.96.2 can work or not...


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


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