powerpc target

Kai Ruottu karuottu@freenet.hut.fi
Tue Dec 7 02:55:00 GMT 1999

Scott Howard wrote:

> I'm pretty certain that you DO want glibc rather than newlib. However I'm
> not sure what target name should be used with configure.
> Andy wrote:
>> I looked at the FAQ again - it shouldn't be too hard to do it manually
> without one-tree et al - if only I knew what the correct target for PowerPC
> is and whether you need to compile glibc instead of newlib

 What about 'powerpc-openbsd'?

 Aren't there any pre-built libs for OpenBSD/PPC yet?  Must be... If you have
the target machine available, it has a C-library... If you haven't any target
machine, but think that the psim in GDB can run OpenBSD/PPC binaries, you may
be wrong...

------------ clip --------------------------
Can PSIM run Solaris, LINUX or NetBSD binaries?


Provided that: 

     The executable has been linked statically 
     All the required system calls have been implemented (a few still have not) 

PSIM should be able to run such executables. 
------------ clip --------------------------

 Nothing about running OpenBSD binaries, unless NetBSD is the same...

> >The powerpc-eabi target is intended for embedded PowerPC's only.

 With GDB and psim, the Linux/PPC, Solaris/PPC and NetBSD/PPC should be supported
(preliminary) too, if configured for 'powerpc-eabi'...

 About these cross-tools projects to 'system' targets, not for embedded targets,
I must just wonder if any RTFM-method has been used before... The GCC manual has
a chapter about cross-compiling, and quite near the beginning stands:

------------ clip --------------------------
Steps of Cross-Compilation

To compile and run a program using a cross-compiler involves several steps:

· Run the cross-compiler on the host machine to produce assembler files for the
  target machine.  This requires header files for the target machine.

· Assemble the files produced by the cross-compiler.  You can do this either with
  an assembler on the target machine, or with a cross-assembler on the host machine.

· Link those files to make an executable.  You can do this either with a linker on
  the target machine, or with a cross-linker on the host machine.  Whichever machine
  you use, you need libraries and certain startup files (typically crt....o) for the
  target machine.  

It is most convenient to do all of these steps on the same host machine, since then
you can do it all with a single invocation of GNU CC.  This requires a suitable cross-
assembler and cross-linker.  For some targets, the GNU assembler and linker are available.
------------ clip --------------------------

 For me it clearly says that one needs the target libraries and headers first. The next
sections in the GCC manual describe how and where to install these...

 For IBM AIX, Sun Solaris2, SCO OSR5, UnixWare7 etc. only 'pre-built' libraries are available.
Linux, NetBSD, OpenBSD, FreeBSD etc. may have the library sources available. But why on earth
reinvent the wheel?  Why to go through all the 'acid tests' for getting a rock-solid C-library?

 I would prefer searching any pre-built libs for the target first... If a OpenBSD/PPC really
exists (cannot say -- is it just 'vaporware', and you wan't to simulate it under psim),there
must be systems running it and they have a C-compiler with the basic C-library, network
libs, X11-libraries, curses, termcap etc. libraries... Rebuilding all these sounds quite vain.

 BTW, this basic idea may be good, but the reality may bite... For Linux/PPC the newest pre-built
libs seem to be from May-99 (glibc-2.1-1c something), for Linux/MIPS, Linux/m68k etc. the pre-
built libs are still older (glibc-2.06 and glibc-2.07 something). So the temptation to build
a 'up-to-date' C-library may be high... But what if the real targets use only those 'obsolete'
old libraries, their installed shared libs are old and the binaries using newer ones don't run
on them at all?

 Ok, there are all kind of things to consider before deciding whether to use pre-built libs or to
try to build newer ones...

Cheers, Kai

 PS. Has anyone tried to add/implement more Linux/PPC syscalls to PSIM ?  I tried Linux/PPC
executables with it under Linux/x86 and got errors about unimplemented 'personality' and 'mmap'
syscalls... Being capable to run some simple Linux/PPC programs under PSIM could be just fine,
if not having a real Linux/PPC available for the first tests of a new Linux/PPC-target cross-
toolset.... (Ok, the Unix/Linux-emulations are in 'sim/ppc/emul-unix.c' -- who could have

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

More information about the crossgcc mailing list