This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: glibc 2.3.2 targeting arm-linux, failed to cross-compile.


On Wed, May 14, 2003 at 10:26:54AM -0400, Daniel Jacobowitz wrote:
> > > Bizarrely, this is a problem with the way that glibc parses the way
> > > gcc invokes ld.  It expects there to be an -EL switch, and there isn't.
> > > 
> > > I just remove the line from libc.so.  It doesn't actually need to have
> > > an OUTPUT_FORMAT anyway.
> > >
> > 
> > I assume I have to remove this line from "libpthread.so" also. From
> > anywhere else that you might know? (I try to write a script to
> > automatically build the whole mix)
> 
> Only those two.
> 

Finaly, and thanks to your patches, I got glibc 2.3.2 to cross-compile
(targeting arm-linux), and I installed it on a target SA1110-based
system. Test binaries I have created seem to run. That is, until they
issue the "connect" system call, at which point everything
segfaults. The following test program, for example, crashes reliably:

/***********************************************************************/

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>

int main () {
   int sd;
   struct sockaddr_in sockaddr;

   memset(&sockaddr, 0, sizeof(sockaddr));

   sd = socket(PF_INET,SOCK_STREAM,0);
   sockaddr.sin_family=AF_INET;
   sockaddr.sin_addr.s_addr = inet_addr("192.168.1.2");
   sockaddr.sin_port = htons(23);

   printf("socket fd is %d\n", sd);

   if ( connect(sd,(struct sockaddr *) &sockaddr,sizeof(sockaddr)) < 0) {
          close(sd);
          perror("connect");
          return -1;
   }
   printf("Connected!\n");
   close(sd);

   return 0;
}

/***********************************************************************/

The last message printed is

  "socket fd is 3"

and then it segfaults. "strace" shows that the last syscall issued was
the "write()" outputing the printf message.

Notice that on my test-platform earlier libc-versions (2.2.3, and
2.2.5) work flawlessly.  Dynamic binaries compiled and linked using
older toolchains, but asked to run on the system carying the fresh
glibc, also crash *at the same point*.

When I statically-build the same program using the fresh
cross-toolchain (binutils 2.13.2, gcc 3.2.3) and linking against the
fresh cross-compiled glibc (2.3.2) it works fine!

Has this glibc version been tried agains ARM targets? Is it considered
stable? Just working?

Thanks in advance

/npat

-- 
Freedom, morality, and the human dignity of the individual consists
precisely in this; that he does good not because he is forced to do
so, but because he freely conceives it, wants it, and loves it.
  -- Mikhail Bakunin 


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