问题
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?
来源:https://stackoverflow.com/questions/29236378/cross-compilation-of-openssh-for-arm