AnsweredAssumed Answered

Cross compile openssh use imx6ul toolchain

Question asked by gaoyuan on May 17, 2016
Latest reply on May 17, 2016 by igorpadykov

I've built standalone toolchian for imx6ul, and install it.

When I  compiled openssh using the toolchain and running it on target board, then I got “Segmentation fault” error.

I think it caused by CFLAGS or LDFLAGS but I don't know how to modify it.

So should someone help me, thank you!


followed is my cross-compile flowchart:

$ git branch

* V_7_2


$ autoconf

$ autoheader

$ export CFLAGS="$CFLAGS -I/data/lib/openssl-1.0.2f/include/ -fPIC"

$  export LDFLAGS="-L/data/lib/openssl-1.0.2f/"

$ ./configure --with-ssl-dir=/data/modules/c0402.git/lib/openssl-1.0.2f --with-zlib=../zlib.git/ --host=arm-poky-linux-gnueabi


OpenSSH has been configured with the following options:

                     User binaries: /usr/local/bin

                   System binaries: /usr/local/sbin

               Configuration files: /usr/local/etc

                   Askpass program: /usr/local/libexec/ssh-askpass

                      Manual pages: /usr/local/share/man/manX

                          PID file: /var/run

  Privilege separation chroot path: /var/empty

            sshd default user PATH: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

                    Manpage format: doc

                       PAM support: no

                   OSF SIA support: no

                 KerberosV support: no

                   SELinux support: no

                 Smartcard support:

                     S/KEY support: no

              MD5 password support: no

                   libedit support: no

  Solaris process contract support: no

           Solaris project support: no

         Solaris privilege support: no

       IP address in $DISPLAY hack: no

           Translate v4 in v6 hack: yes

                  BSD Auth support: no

              Random number source: OpenSSL internal ONLY

             Privsep sandbox style: seccomp_filter



              Host: arm-poky-linux-gnueabi

          Compiler: arm-poky-linux-gnueabi-gcc  -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 --sysroot=/data/toolchain/imx-a7/sysroots/cortexa7hf-vfp-neon-poky-linux-gnueabi

    Compiler flags:  -O2 -pipe -g -feliminate-unused-debug-types -I/data/lib/openssl-1.0.2f/include/ -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-unused-result -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-strong -fPIE

Preprocessor flags: -I../zlib.git/

      Linker flags: -L../zlib.git/ -L/data/lib/openssl-1.0.2f/ -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-strong -pie

         Libraries: -lcrypto -ldl -lutil -lz  -lcrypt -lresolv


and modify LDFLAGS in Makefile to:

"LDFLAGS=-L. -Lopenbsd-compat/ -L../zlib.git/ -L/data/lib/openssl-1.0.2f/ -shared"

$ make