* mipsel-gcc configuration question
@ 2009-03-10 15:17 Kövesdi György
2009-03-10 17:26 ` David Daney
2009-03-11 12:05 ` Kai Ruottu
0 siblings, 2 replies; 10+ messages in thread
From: Kövesdi György @ 2009-03-10 15:17 UTC (permalink / raw)
To: gcc-help
[-- Attachment #1: Type: text/plain, Size: 544 bytes --]
Hi,
I just installed gcc 3.4.6 on my OpenWrt (running on Asus wl500gp), and
got the following message:
gcc dummy.c
/opt/bin/ld: crt1.o: No such file: No such file or directory
In verbose mode I see that the crt1.o is passed without full path to collect2
(the output is attached), and probably that's why it is not found.
The crt1.o is installed at /opt/mipsel-linux/lib/crt1.o. I tried to put it in
other common places (/usr/lib, /usr/local/lib), but it didn't help.
Where its path can be set? What can be wrong?
Thanx in advance
K. Gy.
[-- Attachment #2: gcc-messages --]
[-- Type: text/x-csrc, Size: 2340 bytes --]
/mnt/usbdrive/work/x# gcc -v x.c
Using built-in specs.
Configured with: ../gcc-3.4.6/configure --build=i386-pc-linux-gnu --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc --prefix=/opt --disable-nls --disable-static --with-as=/home/kgy/work/nslu2/optware/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-as --with-ld=/home/kgy/work/nslu2/optware/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ld --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 3.4.6
/mnt/usbdrive/bin/../libexec/gcc/mipsel-linux-uclibc/3.4.6/cc1 -quiet -v -iprefix
/mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/ x.c -quiet -dumpbase x.c -auxbase x
-version -o /tmp/ccfoczAg.s
ignoring nonexistent directory
"/mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/../../../../mipsel-linux-uclibc/include"
ignoring duplicate directory "/opt/lib/gcc/mipsel-linux-uclibc/3.4.6/include"
ignoring nonexistent directory
"/opt/lib/gcc/mipsel-linux-uclibc/3.4.6/../../../../mipsel-linux-uclibc/include"
ignoring nonexistent directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/include
/usr/local/include
/opt/include
End of search list.
GNU C version 3.4.6 (mipsel-linux-uclibc)
compiled by GNU C version 4.1.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
as -EL -no-mdebug -32 -v -KPIC -o /tmp/ccSvQL5I.o /tmp/ccfoczAg.s
GNU assembler version 2.17 (mipsel-linux) using BFD version 2.17
/mnt/usbdrive/bin/../libexec/gcc/mipsel-linux-uclibc/3.4.6/collect2 --eh-frame-hdr -EL -dynamic-linker /lib/ld-uClibc.so.0 crt1.o crti.o /mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/crtbegin.o -L/mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6 -L/mnt/usbdrive/bin/../lib/gcc -L/opt/lib/gcc/mipsel-linux-uclibc/3.4.6 -L/mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/../../.. -L/opt/lib/gcc/mipsel-linux-uclibc/3.4.6/../../.. /tmp/ccSvQL5I.o -lgcc --as-needed -lgcc_s --no-as-needed -rpath-link /lib:/usr/lib -lc -lgcc --as-needed -lgcc_s --no-as-needed /mnt/usbdrive/bin/../lib/gcc/mipsel-linux-uclibc/3.4.6/crtend.o crtn.o
/opt/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-10 15:17 mipsel-gcc configuration question Kövesdi György
@ 2009-03-10 17:26 ` David Daney
2009-03-11 11:10 ` Kövesdi György
2009-03-11 12:05 ` Kai Ruottu
1 sibling, 1 reply; 10+ messages in thread
From: David Daney @ 2009-03-10 17:26 UTC (permalink / raw)
To: Kövesdi György; +Cc: gcc-help
Kövesdi György wrote:
> Hi,
>
> I just installed gcc 3.4.6 on my OpenWrt (running on Asus wl500gp), and
> got the following message:
>
> gcc dummy.c
> /opt/bin/ld: crt1.o: No such file: No such file or directory
>
> In verbose mode I see that the crt1.o is passed without full path to collect2
> (the output is attached), and probably that's why it is not found.
> The crt1.o is installed at /opt/mipsel-linux/lib/crt1.o. I tried to put it in
> other common places (/usr/lib, /usr/local/lib), but it didn't help.
> Where its path can be set? What can be wrong?
>
> Configured with: ../gcc-3.4.6/configure --build=i386-pc-linux-gnu
> --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc
> --prefix=/opt --disable-nls --disable-static
> --with-as=/home/kgy/work/nslu2/optware/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-as
> --with-ld=/home/kgy/work/nslu2/optware/ddwrt/toolchain/mipsel-linux-uclibc/gcc-4.1.1-uclibc-0.9.28/bin/mipsel-linux-uclibc-ld
> --enable-languages=c,c++ --disable-multilib
Try adding --with-sysroot=/opt to both GCC and Binutils configure lines.
That should allow it to find the standard C library files that you
have installed in /opt
David Daney
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-10 17:26 ` David Daney
@ 2009-03-11 11:10 ` Kövesdi György
2009-03-11 11:32 ` Kövesdi György
0 siblings, 1 reply; 10+ messages in thread
From: Kövesdi György @ 2009-03-11 11:10 UTC (permalink / raw)
To: gcc-help; +Cc: David Daney
> Try adding --with-sysroot=/opt to both GCC and Binutils configure lines.
I have rebuilt both binutils and gcc with this option, but the difference is
only that the building procedure requires the /opt directory on the host
machine with some system files, while the target does the same.
How the path of crt1.o is calculated? On my host (pc) it is passed with full
path to collect2.
Regards
K. Gy.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 11:10 ` Kövesdi György
@ 2009-03-11 11:32 ` Kövesdi György
2009-03-11 11:40 ` Andrew Haley
2009-03-11 11:53 ` Kai Ruottu
0 siblings, 2 replies; 10+ messages in thread
From: Kövesdi György @ 2009-03-11 11:32 UTC (permalink / raw)
To: gcc-help; +Cc: David Daney
> I have rebuilt both binutils and gcc with this option, but the difference
> is only that the building procedure requires the /opt directory on the host
> machine with some system files, while the target does the same.
In addition, gcc does not find the system include files on the target machine.
This option seems to be bad. :-(
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 11:32 ` Kövesdi György
@ 2009-03-11 11:40 ` Andrew Haley
2009-03-11 12:07 ` Kövesdi György
2009-03-11 11:53 ` Kai Ruottu
1 sibling, 1 reply; 10+ messages in thread
From: Andrew Haley @ 2009-03-11 11:40 UTC (permalink / raw)
To: Kövesdi György; +Cc: gcc-help, David Daney
Kövesdi György wrote:
>> I have rebuilt both binutils and gcc with this option, but the difference
>> is only that the building procedure requires the /opt directory on the host
>> machine with some system files, while the target does the same.
> In addition, gcc does not find the system include files on the target machine.
> This option seems to be bad. :-(
The system include files are only used on the host machine when
cross-compiling. What are you doing?
Andrew.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 11:32 ` Kövesdi György
2009-03-11 11:40 ` Andrew Haley
@ 2009-03-11 11:53 ` Kai Ruottu
2009-03-11 12:27 ` Kai Ruottu
1 sibling, 1 reply; 10+ messages in thread
From: Kai Ruottu @ 2009-03-11 11:53 UTC (permalink / raw)
To: Kövesdi György; +Cc: gcc-help
Kövesdi György wrote:
>> I have rebuilt both binutils and gcc with this option, but the difference
>> is only that the building procedure requires the /opt directory on the host
>> machine with some system files, while the target does the same.
> In addition, gcc does not find the system include files on the target machine.
> This option seems to be bad. :-(
Maybe you should elaborate WHY you DON'T want to produce a normal native
GCC using configuration options like the :
--prefix=/usr
This is the assumed $prefix for a normal native GCC. The value you
give as $prefix has nothing to do with your "cross host", only with
the native (target) host on which you are going to install the produced
GCC.
Ok, a normal native GCC searches the normal '/lib', '/usr/include' and
'/usr/lib' for the "target C library", but whether a "custom" one like
yours will do that, is unclear... That $host = $target, should be the
only requirement for searching the "native places" but maybe some extra
options like '--with-as=' and '--with-ld=' can override this... But
every GCC searches also the '$prefix/$target' aka '$tooldir', the 'bin',
'include' and 'lib' there, so a custom GCC which DOESN'T want to use
the normal native places, could put its custom things there...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-10 15:17 mipsel-gcc configuration question Kövesdi György
2009-03-10 17:26 ` David Daney
@ 2009-03-11 12:05 ` Kai Ruottu
2009-03-11 12:29 ` Kövesdi György
1 sibling, 1 reply; 10+ messages in thread
From: Kai Ruottu @ 2009-03-11 12:05 UTC (permalink / raw)
To: Kövesdi György; +Cc: gcc-help
Kövesdi György wrote:
> Configured with: ../gcc-3.4.6/configure --build=i386-pc-linux-gnu
> --host=mipsel-linux-uclibc --target=mipsel-linux-uclibc
> --prefix=/opt --disable-nls --disable-static
>
> /opt/bin/ld: crt1.o: No such file: No such file or directory
>
> In verbose mode I see that the crt1.o is passed without full path to collect2
> (the output is attached), and probably that's why it is not found.
> The crt1.o is installed at /opt/mipsel-linux/lib/crt1.o. I tried to put it in
> other common places (/usr/lib, /usr/local/lib), but it didn't help.
Your configure options were :
--target=mipsel-linux-uclibc --prefix=/opt
So how on earth you calculated your $tooldir aka $prefix/$target
being the '/opt/mipsel-linux' ? Of course your custom 'crt1.o'
should be seen in '/opt/mipsel-linux-uclibc/lib' !
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 11:40 ` Andrew Haley
@ 2009-03-11 12:07 ` Kövesdi György
0 siblings, 0 replies; 10+ messages in thread
From: Kövesdi György @ 2009-03-11 12:07 UTC (permalink / raw)
To: gcc-help; +Cc: David Daney
> The system include files are only used on the host machine when
> cross-compiling. What are you doing?
I just want to compile a reliable gcc (cross or native) for my Asus wl500gp
(running OpenWrt and nslu2). The gcc provided by nslu2 (4.1.1) seems buggy,
it segfaults for me recently (both cross and native ones).
I found that gcc 3.4.6 can be compiled by the tool of the nslu2 with only some
small modifications. But the resulting gcc has the mentioned problem about
the path of crt1.o.
Now I have a temporary hack: copying the file crt1.o to the current directory
resolves this problem, but it makes the building procedure a bit complicated.
Regards
K. Gy.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 11:53 ` Kai Ruottu
@ 2009-03-11 12:27 ` Kai Ruottu
0 siblings, 0 replies; 10+ messages in thread
From: Kai Ruottu @ 2009-03-11 12:27 UTC (permalink / raw)
To: Kövesdi György; +Cc: gcc-help
Kai Ruottu wrote:
> Maybe you should elaborate WHY you DON'T want to produce a normal native
> GCC using configuration options like the :
>
> --prefix=/usr
>
> This is the assumed $prefix for a normal native GCC. The value you
> give as $prefix has nothing to do with your "cross host", only with
> the native (target) host on which you are going to install the produced
> GCC.
Basically all possible "stupid questions" should be asked... One
possible misunderstanding may be that "one cannot use the '/usr'
as the $prefix because then 'make install' would overwrite the
native (cross) host stuff"... Of course it would but then one
doesn't use it at all or would use some extra option like (seen
via 'http://gcc.gnu.org/install/finalinstall.html') :
"Installation into a temporary staging area or into a chroot jail
can be achieved with the command
make DESTDIR=path-to-rootdir install
where path-to-rootdir is the absolute path of a directory relative
to which all installation paths will be interpreted. Note that the
directory specified by DESTDIR need not exist yet; it will be
created if necessary."
This some kind of "equivalent" to that '--with-sysroot=' used with
crosstoolchains. With native tools its usability is questionable
(used with custom native tools?).
So the crosstoolchain keeps its target C libraries in some $sysroot,
these are totally things for the alien $target. When one wants to
add binutils and GCC for this "alien target things" directory, one
uses commands like that :
make DESTDIR=$sysroot install
for the GCC component. What could be used with binutils should be
found in the binutils docs. But installing binutils manually isn't
that hard. But I expect some similar 'make install' option being
for binutils too...
So if one wants to "prepare" the stuff to be installed onto the
target, by installing it first on the cross host system, that
should succeed with suitable options...
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: mipsel-gcc configuration question
2009-03-11 12:05 ` Kai Ruottu
@ 2009-03-11 12:29 ` Kövesdi György
0 siblings, 0 replies; 10+ messages in thread
From: Kövesdi György @ 2009-03-11 12:29 UTC (permalink / raw)
To: gcc-help; +Cc: Kai Ruottu
> Your configure options were :
> --target=mipsel-linux-uclibc --prefix=/opt
> So how on earth you calculated your $tooldir aka $prefix/$target
> being the '/opt/mipsel-linux' ? Of course your custom 'crt1.o'
> should be seen in '/opt/mipsel-linux-uclibc/lib' !
You are rght: I created a link to that directory, and it worx!
mipsel-linux-uclibc -> mipsel-linux
These are all calculated by the tool provided by the nslu2 team. I don't know
how does it work, I found the file 'crt1.o' by the 'find' utility. :-)
So, it puts the object files in a wrong directory. I will ask it on the nslu2
list (however, I found that guys there do not interested in questions about
gcc...) At least it works now. Thanks!
Regards
K. Gy.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-03-11 12:29 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-10 15:17 mipsel-gcc configuration question Kövesdi György
2009-03-10 17:26 ` David Daney
2009-03-11 11:10 ` Kövesdi György
2009-03-11 11:32 ` Kövesdi György
2009-03-11 11:40 ` Andrew Haley
2009-03-11 12:07 ` Kövesdi György
2009-03-11 11:53 ` Kai Ruottu
2009-03-11 12:27 ` Kai Ruottu
2009-03-11 12:05 ` Kai Ruottu
2009-03-11 12:29 ` Kövesdi György
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).