2011-05-20 01:16:41     ssh compilation in 2010

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-05-20 01:16:41     ssh compilation in 2010

Shyam sundar (INDIA)

Message: 100760   

 

Hello world,

 

I am not able to add the ssh application into the kernel image in the 2010 version. The following is the error

 

make[7]: Nothing to be done for `all'.

make[7]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build/openbsd-compat'

bfin-linux-uclibc-gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o mux.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

sshconnect.o: In function `ssh_local_cmd':

../sshconnect.c:1177: undefined reference to `_fork'

collect2: ld returned 1 exit status

make[6]: *** [ssh] Error 1

make[6]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build'

make[5]: *** [all] Error 2

make[5]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh'

make[4]: *** [ssh] Error 2

make[4]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make[1]: *** [single_] Error 2

make[1]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make: *** [single] Error 2

 

 

In 2009 it works pretty fine.I need to use the ssh tunnelling.  I also compared 2009 and 2010 svn versions. I didnt see any changes in the code side!  Can I please know how can this be fixed?

QuoteReplyEditDelete

 

 

2011-05-23 22:12:44     Re: ssh compilation in 2010

Mike Frysinger (UNITED STATES)

Message: 100805   

 

just change it to vfork.  the code simply calls execl and already uses _exit().

QuoteReplyEditDelete

 

 

2011-05-26 05:58:45     Re: ssh compilation in 2010

Shyam sundar (INDIA)

Message: 100870   

 

Thanks Mike,

 

The following were the errors I was getting while compiling ssh,sshd and ssh-keygen applications.

 

I just replaced the fork by vfork in the places where it was giving error and it worked !

 

bfin-linux-uclibc-gcc -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o mux.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

bfin-linux-uclibc-gcc -o ssh-agent ssh-agent.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

ssh-agent.o: In function `main':

../ssh-agent.c:1209: undefined reference to `_fork'

collect2: ld returned 1 exit status

make[6]: *** [ssh-agent] Error 1

make[6]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build'

make[5]: *** [all] Error 2

make[5]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh'

make[4]: *** [ssh] Error 2

make[4]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make[1]: *** [single_] Error 2

make[1]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make: *** [single] Error 2

 

 

GN=\"/libexec/ssh-keysign\" -D_PATH_SSH_PIDDIR=\"/var/run\" -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DSSH_RAND_HELPER=\"/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c ../scp.c

../scp.c: In function ‘do_local_cmd’:

../scp.c:175: warning: implicit declaration of function ‘fork’

bfin-linux-uclibc-gcc -o scp scp.o progressmeter.o bufaux.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

scp.o: In function `sink':

../scp.c:1023: warning: the use of LEGACY `utimes' is discouraged, use `utime'

scp.o: In function `_do_local_cmd':

../scp.c:(.text+0x5d8): undefined reference to `_fork'

collect2: ld returned 1 exit status

make[6]: *** [scp] Error 1

make[6]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build'

make[5]: *** [all] Error 2

make[5]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh'

make[4]: *** [ssh] Error 2

make[4]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make[1]: *** [single_] Error 2

make[1]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make: *** [single] Error 2

 

 

../ssh-rand-helper.c: In function ‘hash_command_output’:

../ssh-rand-helper.c:331: warning: implicit declaration of function ‘fork’

bfin-linux-uclibc-gcc -o ssh-rand-helper ssh-rand-helper.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

ssh-rand-helper.o: In function `hash_command_output':

../ssh-rand-helper.c:331: undefined reference to `_fork'

collect2: ld returned 1 exit status

make[6]: *** [ssh-rand-helper] Error 1

make[6]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build'

make[5]: *** [all] Error 2

make[5]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh'

make[4]: *** [ssh] Error 2

make[4]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make[1]: *** [single_] Error 2

make[1]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make: *** [single] Error 2

 

 

ONFIG_H -c ../sftp-glob.c

bfin-linux-uclibc-gcc -o sftp progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o -L. -Lopenbsd-compat/     -mcpu=bf537-0.3 -lssh -lopenbsd-compat -lcrypto -lutil -lz  -lcrypt -lresolv -lresolv

sftp-client.o: In function `do_download':

../sftp-client.c:1123: warning: the use of LEGACY `utimes' is discouraged, use `utime'

sftp.o: In function `connect_to_server':

../sftp.c:1630: undefined reference to `_fork'

sftp.o: In function `local_do_shell':

../sftp.c:255: undefined reference to `_fork'

collect2: ld returned 1 exit status

make[6]: *** [sftp] Error 1

make[6]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh/build'

make[5]: *** [all] Error 2

make[5]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user/ssh'

make[4]: *** [ssh] Error 2

make[4]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[3]: *** [all] Error 2

make[3]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1/user'

make[2]: *** [subdirs] Error 1

make[2]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make[1]: *** [single_] Error 2

make[1]: Leaving directory `/home/shyam/Desktop/uc2010/uclinux/2010R1'

make: *** [single] Error 2

QuoteReplyEditDelete

 

 

2011-05-26 11:36:57     Re: ssh compilation in 2010

Mike Frysinger (UNITED STATES)

Message: 100873   

 

changing scp/sftp/ssh-rand-helper to vfork is fine (and tweaking the exit calls).

 

the ssh-agent wont work however.  that does the opposite of normal ... the parent does the exec while the child runs forever.  so a vfork() will cause ssh-agent to hang.  it'll probably need a bit of rework to run properly.

QuoteReplyEditDelete

 

 

2011-07-27 06:12:33     Re: ssh compilation in 2010

Richard Aldrich (UNITED KINGDOM)

Message: 102693   

 

I too am trying to compile ssh for uclinux.

 

I have come up against a different problem as follows:

 

bfin-uclinux-gcc -Wl,-elf2flt -B/home/richard/uClinux-dist.R1.1-RC3/staging/usr/lib -L/home/richard/uClinux-dist.R1.1-RC3/staging/usr/lib -L. -Lopenbsd-compat -o sshd sshd.o auth.o auth1.o auth2.o auth2-hostbased.o auth2-kbdint.o auth2-none.o auth2-passwd.o auth2-pubkey.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb5.o auth-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o auth-skey.o auth-bsdauth.o monitor_mm.o monitor.o -lssh -lopenbsd-compat -lutil -lcrypto -lz

openbsd-compat/libopenbsd-compat.a(xcrypt.o): In function `xcrypt':

/home/richard/uClinux-dist.R1.1-RC3/user/ssh/openbsd-compat/xcrypt.c:76: undefined reference to `_crypt'

collect2: ld returned 1 exit status

make[2]: *** [sshd] Error 1

make[2]: Leaving directory `/home/richard/uClinux-dist.R1.1-RC3/user/ssh'

make[1]: *** [all] Error 2

make[1]: Leaving directory `/home/richard/uClinux-dist.R1.1-RC3/user'

make: *** [subdirs] Error 1

 

 

I have done a quick search around the net for the "xcrypt.c:76: undefined reference to `_crypt'" and it looks like the -lcrypt is not being included in the make, if this is the case how do I include it?

 

Also, i wondered why mine is building with bfin-uclinux-gcc but the example above is with bfin-linux-uclibc-gcc?

 

Any help would be much appreciated.

QuoteReplyEditDelete

 

 

2011-07-27 06:25:11     Re: ssh compilation in 2010

Aaron Wu (CHINA)

Message: 102694   

 

"why mine is building with bfin-uclinux-gcc but the example above is with bfin-linux-uclibc-gcc"  pleae read   docs.blackfin.uclinux.org/doku.php?id=toolchain:executable_file_formats

QuoteReplyEditDelete

 

 

2011-07-27 06:54:25     Re: ssh compilation in 2010

Richard Aldrich (UNITED KINGDOM)

Message: 102695   

 

Thanks, makes sense!

QuoteReplyEditDelete

 

 

2011-07-27 10:21:14     Re: ssh compilation in 2010

Richard Aldrich (UNITED KINGDOM)

Message: 102696   

 

I have now managed to get it to compile, but the tunnelling over SSH is not working for me. I have enabled the Universal TUN/TAP device driver support, but still it says "Tunnel interfaces are not supported on this platform"

 

This output is coming from the misc.c source file, but I can't find why it is not defining the appropriate constant.

QuoteReplyEditDelete

 

 

2011-07-27 10:24:30     Re: ssh compilation in 2010

Richard Aldrich (UNITED KINGDOM)

Message: 102697   

 

When building ssh on my desktop, I have to go through the ./configure stage. Is this what I'm missing in the uClinux compile?

QuoteReplyEditDelete

 

 

2011-07-28 00:51:35     Re: ssh compilation in 2010

Aaron Wu (CHINA)

Message: 102698   

 

We recommend you to use the dropbear instead.

QuoteReplyEditDelete

 

 

2011-07-28 04:41:57     Re: ssh compilation in 2010

Richard Aldrich (UNITED KINGDOM)

Message: 102701   

 

I have tried dropbear but there doesn't appear to be a way to create a VPN connection through it using a tunnel. This is what I am trying to perform. Any ideas?

Attachments

    Outcomes