ts-7000
[Top] [All Lists]

Re: [ts-7000] problems cross compiling sysvinit

To:
Subject: Re: [ts-7000] problems cross compiling sysvinit
From: Jason Stahls <>
Date: Tue, 12 May 2009 22:25:18 -0400
j.chitte wrote:
> Hi,
>
> I am trying to build sysvinit-2.86 (patched) following this guide:
>
> http://cross-lfs.org/view/clfs-sysroot/arm/final-system/sysvinit.html
>
> most of it seems to be fine but it fails in sulogin.c
>
> arm-unknown-linux-gnueabi-gcc -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE  
> -s  killall5.c   -o killall5
> arm-unknown-linux-gnueabi-gcc -Wall -O2 -fomit-frame-pointer -D_GNU_SOURCE   
> -c -o sulogin.o sulogin.c
> arm-unknown-linux-gnueabi-gcc -s  -o sulogin sulogin.o 
> sulogin.o: In function `main':
> sulogin.c:(.text+0x9c4): undefined reference to `crypt'
> collect2: ld returned 1 exit status
> make: *** [sulogin] Error 1
>
>
> from sulogin.c 
>
> #include <sys/ioctl.h>
> #if defined(__GLIBC__)
> #  include <crypt.h>
> #endif
>
> ....
>
>   /*
>    *  Ask for the password.
>    */
>   while(pwd) {
>     if ((p = getpasswd(pwd->pw_passwd)) == NULL) break;
>     if (pwd->pw_passwd[0] == 0 ||
>         strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd) == 0)
>       sushell(pwd);
>     printf("Login incorrect.\n");
>   }
>
>
>
> It looks like the __GLIBC__ test is failing to include the header file. What 
> have I missed?

More likely it's found the header but not the lib, the error you got is 
from ld trying to link in the libcrypt.so to sulogin.o.  Check the make 
file to make sure LD is looking in the right place for libcrypt.

-- 
Jason Stahls


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU