Building cross-compiler for Alpha-linux on i686-linux

Kai Ruottu karuottu@freenet.hut.fi
Tue Apr 11 23:24:00 GMT 2000


cpg@aladdin.de wrote:
> 
> On 04/11/2000 10:50:18 AM GMT Kai Ruottu wrote:
> >
> > No, this is the plain vanilla linking problem -- the 'alpha-linux-gnu'
> >in the GCC sources is aimed to be native-only... Nobody has cared to make
> >any things for a cross-compiler. So the toolkit really 'cannot make
> >executables'. Please see the 'alpha-linux-gnu/libiberty/config.log' for
> >the linking errors.
> 
> Why did I then successfully manage to make an i386->alpha crosscompiler?
> It was egcs-1.1.2 back then I think, but it should still work.

 I must take my words back... I had the RedHat 5.0 Linux PowerTools with
Alpha binaries for glibc-2.0.5c, and when I yet hadn't a cross-compiler
for alpha, I tried... First installed the target libs and headers, fixed
the
symlinks, built binutils (from the 20000404-snapshots) and tried to
build
gcc-2.95.2 (the 'relative search path - bug fixed in the sources). No
problem
at all... Magically adding the '-rpath-link' wasn't needed for finding
the
'ld-linux.so.2', I verified with '-Wl,-verbose' that it really took the
alpha
one, not the native in '/lib/ld-linux.so.2'...

> Maybe another hint, I always had to set the path to the newly installed
> cross-binutils in order to make a cross-compiler (If you did this and
> I overlooked this, sorry)
> 
> So e.g. cd binutils; ./configure --prefix=/opt/cross && make && make
> install
>        cd gcc; ./configure --prefix=/opt/cross
>         PATH=/opt/cross/bin:$PATH make cross
> or similar.

 The new GCC should find the binutils via its built-in search paths, the
well-known option (everybody should know it...), '-print-search-dirs',
ie.

       ./xgcc -print-search-dirs

written in the GCC-build dir (e.g. in 'gcc-2.95.2/gcc') should tell
where
the new GCC searches the binutils (the 'programs' will tell it).

 BTW, knowing the '--help' option and trying it with every GNU tool may
be
useful as a way to get up-to-date 'on-line documentation'. For example :

E:\usr\local\samples>gcc-mips-linux -v
Reading specs from e:\usr\local\lib\gcc-lib\mips-linux-gnu\2_95.2\specs
gcc version 2.95.2 19991024 (release)

E:\usr\local\samples>gcc-mips-linux --help
Usage: gcc-mips-linux [options] file...
Options:
  --help                   Display this information
  (Use '-v --help' to display command line options of sub-processes)
  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's
search path

  -print-libgcc-file-name  Display the name of the compiler's companion
library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component
<prog>
  -print-multi-directory   Display the root directory for versions of
libgcc
  -print-multi-lib         Display the mapping between command line
options and
                            multiple library search directories
  <snip>

Cheers, Kai


------
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