public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* GCC Search Directory Problem -- crosstool-ng-1.4.0
@ 2009-05-01 17:53 Ben Atkinson
  2009-05-01 22:31 ` ng
  2009-05-01 23:00 ` Yann E. MORIN
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Atkinson @ 2009-05-01 17:53 UTC (permalink / raw)
  To: crossgcc


Hello,

I am using crosstool-ng-1.4.0 to build a cross compiler in the following
context:

build  = i486-linux-gnu (Ubuntu 8.10)
host   = i486-linux-gnu (same)
target = arm-unknown-linux-gnueabi (TS-7370 SBC)

As a preliminary test, I started with the arm-unknown-linux-gnueabi
sample .config file and tried it "as-is".

The build completed successfully, but I get different results depending
on whether I execute gcc or arm-unknown-linux-gnueabi-gcc.

In the first case:

$ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -o Hello Hello.c
gcc: error trying to exec 'cc1': execvp: No such file or directory

The gcc produced by crosstool-ng searches the following directories -- I
split the names up to make them easier to read:

$ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -print-search-dirs
install: /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/

programs: =/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/

libraries: =/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/lib/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/lib/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/usr/lib/arm-unknown-linux-gnueabi/4.3.2/
            /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/usr/lib/

Of particular interest to the location of the cc1 program is:
/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/

The cc1 program actually resides in:
/home/batkinson/x-tools/arm-unknown-linux-gnueabi/libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/cc1

In the "bin-based" format used by gcc search paths, it should be:
/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/

Notice the extra set of ".." in the middle.  I searched this mailing
list and Google for this error, but I couldn't find anything that
applies to crosstool-ng.

If I execute the "full name" version of gcc, everything works fine:
$ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -o Hello Hello.c

Shouldn't both instances of gcc work equally well?  Am I missing something?

Thank you for any help,

Ben


      


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC Search Directory Problem -- crosstool-ng-1.4.0
  2009-05-01 17:53 GCC Search Directory Problem -- crosstool-ng-1.4.0 Ben Atkinson
@ 2009-05-01 22:31 ` ng
  2009-05-01 23:10   ` Yann E. MORIN
  2009-05-01 23:00 ` Yann E. MORIN
  1 sibling, 1 reply; 5+ messages in thread
From: ng @ 2009-05-01 22:31 UTC (permalink / raw)
  To: Ben Atkinson; +Cc: crossgcc

Ben Atkinson wrote:
> Hello,
> 
> I am using crosstool-ng-1.4.0 to build a cross compiler in the following
> context:
> 
> build  = i486-linux-gnu (Ubuntu 8.10)
> host   = i486-linux-gnu (same)
> target = arm-unknown-linux-gnueabi (TS-7370 SBC)
> 
> As a preliminary test, I started with the arm-unknown-linux-gnueabi
> sample .config file and tried it "as-is".
> 
> The build completed successfully, but I get different results depending
> on whether I execute gcc or arm-unknown-linux-gnueabi-gcc.
> 
> In the first case:
> 
> $ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -o Hello Hello.c
> gcc: error trying to exec 'cc1': execvp: No such file or directory
> 
> The gcc produced by crosstool-ng searches the following directories -- I
> split the names up to make them easier to read:
> 
> $ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -print-search-dirs
> install: /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/
> 
> programs: =/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/bin/
> 
> libraries: =/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../lib/gcc/arm-unknown-linux-gnueabi/4.3.2/../../../../arm-unknown-linux-gnueabi/lib/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/lib/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/lib/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/usr/lib/arm-unknown-linux-gnueabi/4.3.2/
>             /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi//sys-root/usr/lib/
> 
> Of particular interest to the location of the cc1 program is:
> /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/
> 
> The cc1 program actually resides in:
> /home/batkinson/x-tools/arm-unknown-linux-gnueabi/libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/cc1
> 
> In the "bin-based" format used by gcc search paths, it should be:
> /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/../../libexec/gcc/arm-unknown-linux-gnueabi/4.3.2/
> 
> Notice the extra set of ".." in the middle.  I searched this mailing
> list and Google for this error, but I couldn't find anything that
> applies to crosstool-ng.
> 
> If I execute the "full name" version of gcc, everything works fine:
> $ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc -o Hello Hello.c
> 
> Shouldn't both instances of gcc work equally well?  Am I missing something?
> 
> Thank you for any help,
> 
> Ben
> 
> 
>       
> 
> 
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
> 
> 
> 
$
/home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc 

-o Hello Hello.c
gcc: error trying to exec 'cc1': execvp: No such file or directory


Run file on this gcc and you'll find it's an x86 build.




--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC Search Directory Problem -- crosstool-ng-1.4.0
  2009-05-01 17:53 GCC Search Directory Problem -- crosstool-ng-1.4.0 Ben Atkinson
  2009-05-01 22:31 ` ng
@ 2009-05-01 23:00 ` Yann E. MORIN
  1 sibling, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2009-05-01 23:00 UTC (permalink / raw)
  To: crossgcc; +Cc: Ben Atkinson

Ben,
All,

On Friday 01 May 2009 19:53:47 Ben Atkinson wrote:
> As a preliminary test, I started with the arm-unknown-linux-gnueabi
> sample .config file and tried it "as-is".
> The build completed successfully, but I get different results depending
> on whether I execute gcc or arm-unknown-linux-gnueabi-gcc.
> $ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -o Hello Hello.c

Oh! I never thought any one would be using that! I did not even know gcc
would install a copy of itself in this place...

The 'canonical' way to call the cross gcc is to give the complete name,
in your case you'd use arm-unknown-linux-gnueabi-gcc.

> Shouldn't both instances of gcc work equally well? Am I missing something?

The toolchain is relocatable, and gcc expects its sub-tools (eg. cc1)
to be in a precise place relative to where gcc is. In this case, the
search path is correctly _built_, but the path itself is wrong, because
gcc does not expect to be run from that place.

A relocatable toolchain can be copied to another place, and will still
continue to work: as gcc looks relative to where it is, then it will
be able to find the required tools (cc1...) and files (headers, libs...)

I guess it would be safer that crosstool-NG removes this file, as it can
be mis-leading. Really, the tools are those that are available in:
  /home/batkinson/x-tools/arm-unknown-linux-gnueabi/bin/
and not those in:
  /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GCC Search Directory Problem -- crosstool-ng-1.4.0
  2009-05-01 22:31 ` ng
@ 2009-05-01 23:10   ` Yann E. MORIN
  0 siblings, 0 replies; 5+ messages in thread
From: Yann E. MORIN @ 2009-05-01 23:10 UTC (permalink / raw)
  To: crossgcc; +Cc: ng, Ben Atkinson

ng,
Ben,
All,

On Saturday 02 May 2009 00:30:58 ng@piments.com wrote:
> Ben Atkinson wrote:
> > I am using crosstool-ng-1.4.0 to build a cross compiler in the following
> > context:
> > build  = i486-linux-gnu (Ubuntu 8.10)
> > host   = i486-linux-gnu (same)
> > target = arm-unknown-linux-gnueabi (TS-7370 SBC)
[--SNIP--]
> > $ /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc -o Hello Hello.c
> Run file on this gcc and you'll find it's an x86 build.

Yes it is! It is a cross compiler, so it is expected to _run_ on the host.
Only it will _generate_ code for the target.

And in Ben's case, host is i486, so 'gcc' is a x86 binary.

I guess that if you run it with -B, you'll end up having a correct ARM
binary as output.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'


--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

* GCC Search Directory Problem -- crosstool-ng-1.4.0
@ 2009-05-03  0:41 Ben Atkinson
  0 siblings, 0 replies; 5+ messages in thread
From: Ben Atkinson @ 2009-05-03  0:41 UTC (permalink / raw)
  To: crossgcc


Yann,

> On Friday 01 May 2009 19:53:47 Ben Atkinson wrote:
> > As a preliminary test, I started with the arm-unknown-linux-gnueabi
> > sample .config file and tried it "as-is".
> > The build completed successfully, but I get different results depending
> > on whether I execute gcc or arm-unknown-linux-gnueabi-gcc.
> > $ 
> /home/batkinson/x-tools/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/bin/gcc 
> -o Hello Hello.c
> 
> Oh! I never thought any one would be using that! I did not even know gcc
> would install a copy of itself in this place...
> 
> The 'canonical' way to call the cross gcc is to give the complete name,
> in your case you'd use arm-unknown-linux-gnueabi-gcc.

Thank you for your reply and for the work you are doing with crosstool-ng.  Now that
I'm using the complete gcc name, the compiler is working great for me.

Regards,

Ben






--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-03  0:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-01 17:53 GCC Search Directory Problem -- crosstool-ng-1.4.0 Ben Atkinson
2009-05-01 22:31 ` ng
2009-05-01 23:10   ` Yann E. MORIN
2009-05-01 23:00 ` Yann E. MORIN
2009-05-03  0:41 Ben Atkinson

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