public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* .so problem
@ 2003-04-03  8:40 Gergely Tamás
  2003-04-03 13:33 ` Muthukumar Ratty
  2003-04-03 17:28 ` LLeweLLyn Reese
  0 siblings, 2 replies; 8+ messages in thread
From: Gergely Tamás @ 2003-04-03  8:40 UTC (permalink / raw)
  To: gcc-help

Hello!

I'm trying to cross-compile for arm-linux. After linking, the executables 
contain "/usr/lib/ld.so.1" in the ".interp" section. But the only similar 
file I have in the $(PREFIX)/lib directory is ld-linux.so.2

- Could anyone tell me where the value of the ".interp" section comes from?
- Does /usr/lib/ld.so.1 comes with the linux system or belongs to binutils 
or gcc or glibc?

Thanks,
gertom
-- 
**************************************************************************
* Gergely TamĂĄs                                    e-mail:gertom@rgai.hu *
**************************************************************************

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

* Re: .so problem
  2003-04-03  8:40 .so problem Gergely Tamás
@ 2003-04-03 13:33 ` Muthukumar Ratty
  2003-04-03 14:57   ` Muthukumar Ratty
  2003-04-03 17:28 ` LLeweLLyn Reese
  1 sibling, 1 reply; 8+ messages in thread
From: Muthukumar Ratty @ 2003-04-03 13:33 UTC (permalink / raw)
  To: Gergely Tamás; +Cc: gcc-help

On Thu, 3 Apr 2003, [ISO-8859-2] Gergely Tamás wrote:

> I'm trying to cross-compile for arm-linux. After linking, the executables
> contain "/usr/lib/ld.so.1" in the ".interp" section. But the only similar
> file I have in the $(PREFIX)/lib directory is ld-linux.so.2

If this file is for ARM then either
1. you can create a ld.so.2 as symbolic link to this one OR
2. you can edit the gcc spec files to change the ld.so.1 to ld.so.2 OR
3. you can explicitly pass it to linker as option


>
> - Could anyone tell me where the value of the ".interp" section comes from?
> - Does /usr/lib/ld.so.1 comes with the linux system or belongs to binutils
> or gcc or glibc?
>
> Thanks,
> gertom
>

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

* Re: .so problem
  2003-04-03 13:33 ` Muthukumar Ratty
@ 2003-04-03 14:57   ` Muthukumar Ratty
  0 siblings, 0 replies; 8+ messages in thread
From: Muthukumar Ratty @ 2003-04-03 14:57 UTC (permalink / raw)
  To: Gergely Tamás; +Cc: gcc-help


Sorry, typo :)

s/ld.so.2/ld-linux.so.2

On Thu, 3 Apr 2003, Muthukumar Ratty wrote:

> On Thu, 3 Apr 2003, [ISO-8859-2] Gergely Tamás wrote:
>
> > I'm trying to cross-compile for arm-linux. After linking, the executables
> > contain "/usr/lib/ld.so.1" in the ".interp" section. But the only similar
> > file I have in the $(PREFIX)/lib directory is ld-linux.so.2
>
> If this file is for ARM then either
> 1. you can create a ld.so.2 as symbolic link to this one OR
> 2. you can edit the gcc spec files to change the ld.so.1 to ld.so.2 OR
> 3. you can explicitly pass it to linker as option
>
>
> >
> > - Could anyone tell me where the value of the ".interp" section comes from?
> > - Does /usr/lib/ld.so.1 comes with the linux system or belongs to binutils
> > or gcc or glibc?
> >
> > Thanks,
> > gertom
> >
>

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

* Re: .so problem
  2003-04-03  8:40 .so problem Gergely Tamás
  2003-04-03 13:33 ` Muthukumar Ratty
@ 2003-04-03 17:28 ` LLeweLLyn Reese
  2003-04-04  8:29   ` Gergely Tamás
  1 sibling, 1 reply; 8+ messages in thread
From: LLeweLLyn Reese @ 2003-04-03 17:28 UTC (permalink / raw)
  To: Gergely Tamás; +Cc: gcc-help

Gergely Tamás <gertom@rgai.hu> writes:

> Hello!
> 
> I'm trying to cross-compile for arm-linux. After linking, the
> executables contain "/usr/lib/ld.so.1" in the ".interp" section. But
> the only similar file I have in the $(PREFIX)/lib directory is
> ld-linux.so.2
> 
> - Could anyone tell me where the value of the ".interp" section comes from?
> - Does /usr/lib/ld.so.1 comes with the linux system or belongs to
> binutils or gcc or glibc?
[snip]

/usr/lib/ld.so.1 is expected to be the linker-loader on the target
    system - *not* on the host system. Check the target system for
    /usr/lib/ld.so.1 .

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

* Re: .so problem
  2003-04-03 17:28 ` LLeweLLyn Reese
@ 2003-04-04  8:29   ` Gergely Tamás
  2003-04-04 21:33     ` LLeweLLyn Reese
  0 siblings, 1 reply; 8+ messages in thread
From: Gergely Tamás @ 2003-04-04  8:29 UTC (permalink / raw)
  To: gcc-help



LLeweLLyn Reese wrote:
> Gergely TamĂĄs <gertom@rgai.hu> writes:
> 
> 
>>Hello!
>>
>>I'm trying to cross-compile for arm-linux. After linking, the
>>executables contain "/usr/lib/ld.so.1" in the ".interp" section. But
>>the only similar file I have in the $(PREFIX)/lib directory is
>>ld-linux.so.2
>>
>>- Could anyone tell me where the value of the ".interp" section comes from?
>>- Does /usr/lib/ld.so.1 comes with the linux system or belongs to
>>binutils or gcc or glibc?
> 
> [snip]
> 
> /usr/lib/ld.so.1 is expected to be the linker-loader on the target
>     system - *not* on the host system. Check the target system for
>     /usr/lib/ld.so.1 .
> 

Sorry for not enough details, I'm trying to explain: on the target machine I 
have no /usr/lib/ld.so.1 but have a /lib/ld-linux.so.2. On the host in the 
$(PREFIX)/lib, I also have an ld-linux.so.2.

If I copy 'target' ld-linux.so.2 to ld.so.1, it segfaults. If I copy 'host'
ld-linux.so.2 to ld.so.1, it says: "error while loading shared libraries: 
libc.so.6: cannot open shared object file: No such file or directory". I 
think that ld-linux.so.2 has its own search path. If I use LD_LIBRARY_PATH 
to set this, it also segfaults with both the 'target' and 'host' libc.so.6.

gertom

-- 
**************************************************************************
* Gergely TamĂĄs                                    e-mail:gertom@rgai.hu *
* ICQ:104783919                                    http://gertom.rgai.hu *
**************************************************************************

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

* Re: .so problem
  2003-04-04  8:29   ` Gergely Tamás
@ 2003-04-04 21:33     ` LLeweLLyn Reese
  0 siblings, 0 replies; 8+ messages in thread
From: LLeweLLyn Reese @ 2003-04-04 21:33 UTC (permalink / raw)
  To: Gergely Tamás; +Cc: gcc-help

Gergely Tamás <gertom@rgai.hu> writes:

> LLeweLLyn Reese wrote:
> > Gergely Tamás <gertom@rgai.hu> writes:
> >
> >>Hello!
> >>
> >>I'm trying to cross-compile for arm-linux. After linking, the
> >>executables contain "/usr/lib/ld.so.1" in the ".interp" section. But
> >>the only similar file I have in the $(PREFIX)/lib directory is
> >>ld-linux.so.2
> >>
> >>- Could anyone tell me where the value of the ".interp" section comes from?
> >>- Does /usr/lib/ld.so.1 comes with the linux system or belongs to
> >>binutils or gcc or glibc?
> > [snip]
> > /usr/lib/ld.so.1 is expected to be the linker-loader on the target
> >     system - *not* on the host system. Check the target system for
> >     /usr/lib/ld.so.1 .
> >
> 
> Sorry for not enough details, I'm trying to explain: on the target
> machine I have no /usr/lib/ld.so.1 but have a /lib/ld-linux.so.2. On
> the host in the $(PREFIX)/lib, I also have an ld-linux.so.2.

Oops. Sorry I didn't understand.

My next shot in the dark is that the c library you compiled your code
    with is different from the c library on the target system. If so,
    try obtaining a matching c library+headers to compile with. But
    that's a shot in the dark.

> 
> If I copy 'target' ld-linux.so.2 to ld.so.1, it segfaults. If I copy 'host'
> ld-linux.so.2 to ld.so.1, it says: "error while loading shared
> libraries: libc.so.6: cannot open shared object file: No such file or
> directory". I think that ld-linux.so.2 has its own search path. If I
> use LD_LIBRARY_PATH to set this, it also segfaults with both the
> 'target' and 'host' libc.so.6.

I don't know what to say about this.

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

* Re: .so problem
       [not found] <20030408015547.61021.qmail@web40805.mail.yahoo.com>
@ 2003-04-09  8:48 ` Gergely Tamás
  0 siblings, 0 replies; 8+ messages in thread
From: Gergely Tamás @ 2003-04-09  8:48 UTC (permalink / raw)
  To: Emmanuel Arazo; +Cc: gcc-help



Emmanuel Arazo wrote:
> Ok.
> 
> 1. GLIBC will create the ld-linux.so.2 link to the ld package. So you 
> should not copy this manually. although you may manually create a link 
> to the ld-library and name it ld-linux.so.2 or ld-linux.so.1 or do both 
> to be sure.

Ok.

> 
> 2. What packages are you using... GLIBC? GCC? BINUTILS?

I have an arm machine:

Linux ipack 2.4.18-rmk3 #19 Thu Mar 27 11:27:44 CET 2003 armv4l unknown

with glibc-2.2.5 libraries. I also have a host machine, with an 
arm-linux-gcc cross-compiler (gcc-2.95.3, binutils-2.11.2) installed from a 
binary package (have no toolchain for it). This works correctly.

Now I want to create a gcc-3.2 cross-compiler. I have the linux headers, use 
binutils-2.13, and glibc-2.2.5. First I build binutils, then gcc, glibc and 
gcc again, according to the toolchain. It works without reporting an error.

I compile a simple program with this gcc-3.2, and try to run it. By default, 
it tries to use /usr/lib/ld.so.1 as runtime linker. On the arm machine, 
there is no such file.

If I make a link: /usr/lib/ld.so.1->/lib/ld-linux.so.2, the programs segfault.

If I copy the compiled glibc 'lib' library (not the installed '/lib') from 
the host to the arm-machine, and create a link: 
/usr/lib/ld.so.1->/hostlib/ld-linux.so.2, it also segfaults, with both 
LD_LIBRARY_PATH=/lib and LD_LIBRARY_PATH=/hostlib.

> 
> 3. Try to follow the cross compilation procedures posted in the 
> arm-linux ftp site:
> 
> ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/src-2.95.3/build-toolchain/ 
> 
> 
> ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/src-3.2/build-toolchain/

I'll check them.

> 
> 4. Endianess is an issue to this work. What endianess is used by your 
> platform, or better yet, what platform are you using? The toolchain in 
> No. 3 is created for little-endian machines.
> 

Everything is little-endian.

gertom

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

* Re: .so problem
       [not found] <20030403231617.16476.qmail@web40811.mail.yahoo.com>
@ 2003-04-04  8:11 ` Gergely Tamás
  0 siblings, 0 replies; 8+ messages in thread
From: Gergely Tamás @ 2003-04-04  8:11 UTC (permalink / raw)
  To: Emmanuel Arazo, gcc-help


Emmanuel Arazo wrote:
> Sorry I can't seem to forward my messages to gnu-help mailing list. 
> Kindly forward my message if you received this..
> 
> Thanks.
> 
>  
> 
> Hello.
> 
> What actually are the errors or comments that caused any problems. Or, 
> what are you really trying to do?

I have an arm-linux system with 2.4.18-rmk3 kernel headers. I made a gcc 
cross compiler (binutils, gcc, glibc) on a pc host for arm-linux target with 
the same header files. I compiled and linked some simple programs with this 
cross-compiler, but when I tried to run them, the linux said: "No such file 
or directory". I examined a program, and found that in the section named 
".interp" it contained the value "/usr/lib/ld.so.1". There is no such file 
on the target system. Then I examined a 'good' executable, and it contained
"/lib/ld-linux.so.2" in the mentioned section. If I create a link: 
/usr/lib/ld.so.1->/lib/ld-linux.so.2, my program segfaults.

> 
> Cross-compiled libraries (eg. *.so files) should not be placed in 
> /usr/lib directory, that is in the host side, or it will destroy the 
> proper function of your host box.

Yes, on the host, they are collected on a separate directory by using 
--prefix during configuration.

> When compiling try to use --prefix as 
> a compile option during configuration. ld* files are created from glibc 
> package. Link files for ld files will be created after issuing "make 
> install" in glibc...

Yes, on the host, I found ld-linux.so.2 in the directory I used with 
--prefix. If I copy this file on the target system as ld.so.1 and run my 
program, it says: "error while loading shared libraries: libc.so.6: cannot 
open shared object file: No such file or directory".

> 
> Eman

I'm trying to make a working cross-compiler, that uses ld-linux.so.2 instead 
of ld.so.1 (not only the name, but the shared object). Should I tell this to 
binutils, gcc or glibc; and how?

Thanks

> 
>  Muthukumar Ratty <muthu@iqmail.net> wrote:
> 
> 
>     Sorry, typo :)
> 
>     s/ld.so.2/ld-linux.so.2
> 
>     On Thu, 3 Apr 2003, Muthukumar Ratty wrote:
> 
>      > On Thu, 3 Apr 2003, [ISO-8859-2] Gergely Tamás wrote:
>      >
>      > > I'm trying to cross-compile for arm-linux. After linking, the
>     executables
>      > > contain "/usr/lib/ld.so.1" in the ".interp" section. But the
>     only similar
>      > > file I have in the $(PREFIX)/lib directory is ld-linux.so.2
>      >
>      > If this file is for ARM then either
>      > 1. you can create a ld.so.2 as symbolic link to this one OR
>      > 2. you can edit the gcc spec files to change the ld.so.1 to
>     ld.so.2 OR
>      > 3. you can explicitly pass it to linker as option
>      >
>      >
>      > >
>      > > - Could anyone tell me where the value of the ".interp" section
>     comes from?
>      > > - Does /usr/lib/ld.so.1 comes with the linux system or belongs
>     to binutils
>      > > or gcc or glibc?
>      > >

-- 
**************************************************************************
* Gergely Tamás                                    e-mail:gertom@rgai.hu *
* ICQ:104783919                                    http://gertom.rgai.hu *
**************************************************************************

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

end of thread, other threads:[~2003-04-09  8:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-03  8:40 .so problem Gergely Tamás
2003-04-03 13:33 ` Muthukumar Ratty
2003-04-03 14:57   ` Muthukumar Ratty
2003-04-03 17:28 ` LLeweLLyn Reese
2003-04-04  8:29   ` Gergely Tamás
2003-04-04 21:33     ` LLeweLLyn Reese
     [not found] <20030403231617.16476.qmail@web40811.mail.yahoo.com>
2003-04-04  8:11 ` Gergely Tamás
     [not found] <20030408015547.61021.qmail@web40805.mail.yahoo.com>
2003-04-09  8:48 ` Gergely Tamás

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