错误:为armv5tel交叉编译openssh时出现类型冲突

错误:为armv5tel交叉编译openssh时出现类型冲突

在 wheezy 上为 armv5tel 交叉编译 openssh-7.2p2 时,出现以下错误。Before this, I have successfully cross compiled and installed zlib-1.2.8 and openssl-1.0.2h. For openssl,我用作./configure命令:./Configure linux-armv4 --prefix=/usr/local。也尝试过linux-elf,但出现汇编错误。

在没有openssl的情况下交叉编译openssh时,似乎没有问题

任何建议或想法,我做错了什么

In file included from /usr/local/include/openssl/x509.h:107,
                 from /usr/local/include/openssl/pem.h:70,
                 from sshkey.c:37:
/usr/local/include/openssl/sha.h:139: error: conflicting types for 'SHA256_CTX'
openbsd-compat/sha2.h:72: error: previous declaration of 'SHA256_CTX' was here
/usr/local/include/openssl/sha.h:150: error: conflicting types for 'SHA256_Init'
openbsd-compat/sha2.h:81: error: previous declaration of 'SHA256_Init' was here
/usr/local/include/openssl/sha.h:151: error: conflicting types for 'SHA256_Update'
openbsd-compat/sha2.h:84: error: previous declaration of 'SHA256_Update' was here
/usr/local/include/openssl/sha.h:152: error: conflicting types for 'SHA256_Final'
openbsd-compat/sha2.h:87: error: previous declaration of 'SHA256_Final' was here
/usr/local/include/openssl/sha.h:154: error: conflicting types for 'SHA256_Transform'
openbsd-compat/sha2.h:82: error: previous declaration of 'SHA256_Transform' was here
/usr/local/include/openssl/sha.h:191: error: conflicting types for 'SHA512_CTX'
openbsd-compat/sha2.h:77: error: previous declaration of 'SHA512_CTX' was here
/usr/local/include/openssl/sha.h:199: error: conflicting types for 'SHA384_Init'
openbsd-compat/sha2.h:98: error: previous declaration of 'SHA384_Init' was here
/usr/local/include/openssl/sha.h:200: error: conflicting types for 'SHA384_Update'
openbsd-compat/sha2.h:101: error: previous declaration of 'SHA384_Update' was here
/usr/local/include/openssl/sha.h:201: error: conflicting types for 'SHA384_Final'
openbsd-compat/sha2.h:104: error: previous declaration of 'SHA384_Final' was here
/usr/local/include/openssl/sha.h:203: error: conflicting types for 'SHA512_Init'
openbsd-compat/sha2.h:115: error: previous declaration of 'SHA512_Init' was here
/usr/local/include/openssl/sha.h:204: error: conflicting types for 'SHA512_Update'
openbsd-compat/sha2.h:118: error: previous declaration of 'SHA512_Update' was here
/usr/local/include/openssl/sha.h:205: error: conflicting types for 'SHA512_Final'
openbsd-compat/sha2.h:121: error: previous declaration of 'SHA512_Final' was here
/usr/local/include/openssl/sha.h:207: error: conflicting types for 'SHA512_Transform'
openbsd-compat/sha2.h:116: error: previous declaration of 'SHA512_Transform' was here
make: *** [sshkey.o] Error 1

openssh的配置总结如下:

OpenSSH has been configured with the following options:  
                     User binaries: /usr/local/bin  
                   System binaries: /usr/local/sbin  
               Configuration files: /usr/local/etc/ssh  
                   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:   
             Privsep sandbox style: none  
Host: arm-none-linux-gnu  
Compiler: arm-none-linux-gcc  
Compiler flags: -g -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security -Wno-pointer-sign -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -ftrapv -fno-builtin-memset -fstack-protector-all -std=gnu99 -fPIE 
Preprocessor flags: -I/usr/local/include  
Linker flags: -L/usr/local/include  -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -fstack-protector-all -pie  
Libraries: -lrt -lutil -lz  -lcrypt -lresolv

答案1

配置选项--with-ssl-dir不应直接指向openssl目录,而应指向上一级目录(包含内容位于openssl目录内)。

配置为--with-ssl-dir=/usr/local/而不是--with-ssl-dir=/usr/local/openssl使交叉编译工作得很好。

相关内容