ubuntu 16.04下交叉编译wget1.20.3和curl7.70.0(与centOS下编译差别很大,且出现一些问题)

wget下载和交叉编译
下载:https://ftp.gnu.org/gnu/wget/

sudo ./configure --prefix=/opt/source/wget-1.20.3/arm_build/ --host=arm-linux CC=/opt/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc --without-ssl --without-zlib
sudo make && make install

这段编译没有问题
curl下载和交叉编译:
下载:https://curl.se/download/
编译:(x86 x64)

sudo CPPFLAGS="-I/opt/north/openssl-1.1.1g/build/ -I/opt/north/openssl-1.1.1g/build/include/" LDFLAGS="-L/opt/north/openssl-1.1.1g/build/lib" LIBS="-ldl" ./configure --with-ssl --enable-shared --enable-static --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib --prefix=/opt/north/curl-7.70.0/build/

sudo make && make install

测试交叉编译正常

交叉编译:(ARM)

 sudo CPPFLAGS="-I/opt/source/openssl-1.1.1g/arm_build/ -I/opt/source/openssl-1.1.1g/arm_build/include" LDFLAGS="-L/opt/source/openssl-1.1.1g/arm_build/lib" LIBS="-ldl" ./configure --host=arm-linux CC=/opt/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CXX=/opt/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --with-ssl --enable-shared --enable-static --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib --prefix=/opt/source/curl-7.70.0/arm_build/

sudo make && make install

出现问题1:
交叉编译libcurl,遇到libtool: eval: line 1722: syntax error near unexpected token `|’
解决方案参照:文章
问题2:
在这里插入图片描述
提示不能加载libz.so.1
解决方案:文章2
内容:

sudo apt-get update
sudo apt-get install lib32z1

这样做的原因是对于64为系统,没有32位的类库
对于centos系统,则需要:

yum install zlib.i686

参照:
https://blog.csdn.net/sdd220/article/details/78520405

重大问题:
在这里插入图片描述
这里提示

/opt/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libssl.so.1.1, needed by ../lib/.libs/libcurl.so, not found (try using -rpath or -rpath-link)
/opt/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.3.1/../../../../arm-linux-gnueabihf/bin/ld: warning: libcrypto.so.1.1, needed by ../lib/.libs/libcurl.so, not found (try using -rpath or -rpath-link)

也就是没有找到可以使用的libssl.so.1.1,但是实际上是有这些的,
参照centOS的交叉编译和Ubuntu下通过gcc编译的配置后的内容发现有两个异同:
Ubuntu下的gcc编译链和centOS下 在config之后的打印信息
在这里插入图片描述
这两种均可以正常编译curl7.70
但是,在Ubuntu下使用交叉编译链编译时是不同的。
在这里插入图片描述
在编译时出现以上描述的问题。
于是我就把centOS使用的openssl库拿过来使用,发现可以在Ubuntu16.04中进行编译了。

我对比了下两者的区别:

在这里插入图片描述
在这里插入图片描述
发现两者基本一致。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值