2

I am trying to cross-compile openssh for ARM. I have suceesfully installed zlib and openssl. I configured openssh package as following:

./configure --prefix=/usr/openssharm --host=arm --    oldincludedir=/usr/opensslarm/include --includedir=/usr/opensslarm/include --with-libs --with-zlib=/usr/zlibArm --with-ssl-dir=/usr/opensslarm --disable-etc-default-login CC=arm-linux-gnueabi-gcc AR=arm-linux-gnueabi-ar

Now when I am trying to make it, I get the following error:

arm-linux-gnueabi-ld -o ssh ssh.o readconf.o clientloop.o sshtty.o sshconnect.o sshconnect1.o sshconnect2.o mux.o roaming_common.o roaming_client.o -L. -Lopenbsd-compat/ -L/usr/opensslarm/lib -L/usr/zlibArm/lib -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -shared-fstack-protector-all -lssh -lopenbsd-compat -lcrypto -ldl -lutil -lz -lnsl -lresolv arm-linux-gnueabi-ld: unrecognized option '-Wl,-z,relro'

I tried searching for the same, but could not get what the error is. I thought of modifying the LDFLAGS in the makefile but it was not useful either. My LDFLAGS line look like:

LDFLAGS=-L. -Lopenbsd-compat/ -L/usr/opensslarm/lib -L/usr/zlibArm/lib  -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-all

What could be the possible solution of the same?

chollida
  • 7,834
  • 11
  • 55
  • 85
user361537
  • 21
  • 3
  • 1
    Those command line options should be passed to arm-linux-gnueabi-gcc, which will invoke arm-linux-gnueabi-ld with the correct command line options to perform the link. Try setting LD=arm-linux-gnueabi-gcc in your configure step – Charles Baylis Mar 25 '15 at 01:57
  • Thanks. :) When I do as you suggested the make completes successfully but make install fails with the following error: /usr/bin/install -c -m 0755 -s ssh /usr/openssharm/bin/ssh strip: Unable to recognise the format of the input file `/usr/openssharm/bin/ssh' I was wondering why are we setting LD as gcc. There are already CFLAGS defined for gcc and since these flags start with -L (the usual format for ld command), I thought LD command should be working with it. And also when I give LD=arm-linux-gnueabi-gcc, the make succeeds. I am not able to understand this step. – user361537 Mar 25 '15 at 05:25
  • Ok I understood. Thanks! :) It ran successfully. – user361537 Mar 25 '15 at 09:26

0 Answers0