openssh cross compilation issue

Prassidice prassidice at gmail.com
Fri Apr 26 04:34:41 EST 2013


Hi,

I'm cross compiling openSSH-6.2p1 on a ARM architecture
with
zlib-1.2.7
openssl-1.0.1e


the compilation succeeds but when I launch sftp x.y.z.t it fails:
exec: /home/working_area/disk1/usr/bin/ssh: No such file or directory

the problem is that /home/working_area/disk1/ is the path within the host PC

Is there a way to fix the cross-compilation or to export a variable in 
the target system such that the PATH is correct?

I'm compiling with this commands:

/home/working_area/disk1


./configure \
CC=arm-linux-gnueabi-gcc \
--host=arm-linux \
--build=arm-linux-gnueabi \
--with-ssl-dir=/home/working_area/disk1 \
--with-zlib=/home/working_area/disk1/usr \
--prefix=/home/working_area/disk1/usr \
--disable-etc-default-login

(at the end of this commands it explicitly says:
sshd default user PATH: 
/usr/bin:/bin:/usr/sbin:/sbin:/home/working_area/disk1/usr/bin

while it should be:
sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/bin)

then I do:
make
make install


I already tried with  make install-nosysconf, but I had the same problem

how can I fix this?

to be more precise,
after the ./configure ...

in order to have the compilation to proceeds without problems I have to 
edit Makefile and modify in this way:

1) near check-config:
from:
     -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
to:
     /usr/sbin/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config

2) near host-key: ssh-keygen$(EXEEXT)
from:
     ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \
to:
     /usr/bin/ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \

from:
     ./ssh-keygen -t dsa -f $(sysconfdir)/ssh_host_dsa_key -N "" ; \
to:
     /usr/bin/ssh-keygen -t dsa -f $(sysconfdir)/ssh_host_dsa_key -N "" ; \

from:
     ./ssh-keygen -t rsa -f $(sysconfdir)/ssh_host_rsa_key -N "" ; \
to:
     /usr/bin/ssh-keygen -t rsa -f $(sysconfdir)/ssh_host_rsa_key -N "" ; \

from:
     ./ssh-keygen -t ecdsa -f $(sysconfdir)/ssh_host_ecdsa_key -N "" ; \
to:
     /usr/bin/ssh-keygen -t ecdsa -f $(sysconfdir)/ssh_host_ecdsa_key -N 
"" ; \

3) near (umask 022...)
from:
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) 
$(DESTDIR)$(bindir)/scp$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) 
$(DESTDIR)$(sbindir)/sshd$(EXEEXT)
     $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) 
$(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) 
$(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) 
$(DESTDIR)$(bindir)/sftp$(EXEEXT)
     $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) 
$(DESTDIR)$(SFTP_SERVER)$(EXEEXT)

to:
     $(INSTALL) -m 0755 ssh-agent$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
     $(INSTALL) -m 0755 ssh-keygen$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
     $(INSTALL) -m 0755 ssh-keyscan$(EXEEXT) 
$(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
     $(INSTALL) -m 0755 sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
     $(INSTALL) -m 0755 ssh-keysign$(EXEEXT) 
$(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
     $(INSTALL) -m 0755 ssh-pkcs11-helper$(EXEEXT) 
$(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
     $(INSTALL) -m 0755 sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(bindir)/sftp$(EXEEXT)
     $(INSTALL) -m 0755 sftp-server$(EXEEXT) 
$(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
     arm-linux-gnueabi-strip $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)

here the problem is with the strip option that cannot use the host functions


best regards,

     Prassidice





More information about the openssh-unix-dev mailing list