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]

Re: Can't find crt*.o


Moreno wrote:
> 
> Hy everyone,
> 
> I've built a cross-compiler for target alpha-elf-linux
> on a host machine alpha-dec-osf in this way:
> 
> Binutils
> -------
> ../binutils-2.10/configure
> --target=alpha-elf-linux
> --prefix=<INSTALL-DIR>
> --enable-languages="c"

 The recommendation is that binutils, target headers and target libs
will be installed into $prefix/$target/..., in your case into the

   <INSTALL-DIR>/alpha-elf-linux/bin
   <INSTALL-DIR>/alpha-elf-linux/include
   <INSTALL-DIR>/alpha-elf-linux/lib

 After the 'make install' with binutils, you will find them in the
first directory, using their base names and in the '<INSTALL-DIR>/bin',
using the prefix 'alpha-elf-linux-'. If you need to use them directly,
you can use the prefixed names. But when GCC needs them, it uses the
names 'as', 'ld' etc. and expects to see them in the first directory...

> GCC
> -----
> ../gcc-2.95.2/configure
> --target=alpha-elf-linux
> --prefix=<INSTALL-DIR>
> --enable-languages="c"
> --with-gnu-as
> --with-gnu-ld
> --with-as=<INSTALL-DIR>/bin/alpha-elf-linux-ar
> --with-ld=<INSTALL-DIR>/bin/alpha-elf-linux-ld
> --with-headers=/ALINRH70/usr/include
> --with-libs=/ALINRH70/usr/lib
> 
> In /ALINRH70/.... I've copied includes, crt*.o and libraries taken
> from target machine.

 GCC searches the target stuff under '<INSTALL-DIR>/alpha-elf-linux/',
so you have tried to do very hard anyone to help you when not following
the 'standards'... Or is this some kind of 'MENSA'-test for stupid
people
like me, who are capable to follow only some very simple rules?

 The GCC manual would suggest the :

../gcc-2.95.2/configure --target=alpha-elf-linux --prefix=<INSTALL-DIR>

as the configure command in your case. Then using the:

 make LANGUAGES=c

if you really need only the C-compiler. Otherwise listing the needed
compilers in double-quotes can be used, like:

 make LANGUAGES="c c++ objc java"

 I would expect the '--enable-languages="c"' to enable only C and take
only the C-rules to the resulted Makefile, so changing your mind may
need a reconfigure... Someone please correct me if I'm wrong...

> Binutils and xgcc was created without any problems but when I try to
> run xgcc I have the following output:
> 
> <INSTALL-DIR>/bin/alpha-elf-linux-ld  cannot open crt1.o.

 The './xgcc -print-search-dirs' tells where your new GCC tries to find
the target 'crt1.o' (the path for 'libraries'). The '--with-libs='
should have copied the libs-stuff into the right place, but perhaps it
copied only the libs, not the startups. When you use a option, you must
have some expectations about what it should do. But it shouldn't be hard
to do a 'ls' command in the '<INSTALL-DIR>/alpha-elf-linux/lib' and see
whether the target libs and startups really are there.
 
> The same problem there is for libraries (xgcc searches for them
> directly in /lib/... where there are host libraries, not target ones).

 This is bullshit, your target 'libc.so' is a ld-script and this has the
native '/lib/libc.so.6 /usr/lib/libc_nonshared.a' still if you didn't
edit it after the copying... And what you did with the symlinks between
the original library files?

> I think that ld doesn't search for crt* and libraries in the directory
> specified by option --with-libs :-(

 As already written, you are trying to do the helper's life hard, I only
know that this option should copy the libs to the '$prefix/$target/lib'.
And 'ld' searches only from the directories the 'xgcc'-driver gives to
it with the '-L' options...

 Copying directly to the $prefix/$target/lib has never been a problem
to me, so I don't understand this 'entropy' at all ("Fill all the empty
space and increase the total disorder").

 If you let the configure-script to do the copying, and then expect it
it knowing what belongs to the 'target libs', you are called 'optimist'.
I would suspect it leaving at least the 'ld-linux.so.2' uncopied, while
you surely know that this belongs to the Linux-target libs...

> Could anyone tell me if this is the right answer and how can I solve
> this problem ?

 Using the standard '$prefix/$target' as the place for the target stuff
makes your job much more easy... Checking the symlinks  between the
target
libs, editing the 'libc.so' and perhaps adding the '-rpath-link' to
point
to the target libs at link-time, in the LINK_SPEC (*link:) in 'specs',
will do this too...

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


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