编译环境:ubuntu 18.04
一、安装交叉编译器arm-sgmstar-gnueabihf-9.1.0--gcc
1、下载交叉编译包
ARM交叉编译器的免安装解压包链接:
ARM交叉编译器:arm-sgmstar-gnueabihf-9.1.0--gcc
tar -zxvf SSC357_arm-sgmstar-gnueabihf-9.1.0-.tar.gz
讯享网
2、解压交叉编译包
进入解压后的文件夹内
讯享网cd gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf
进入bin 文件夹
cd bin
查看路径名
讯享网pwd
/usr/local/arm/gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf/bin

3、配置交叉编译环境变量
讯享网sudo vim /etc/profile
在文件最后添加新的一行,如下内容
export PATH=$PATH:/usr/local/arm/gcc-sigmastar-9.1.0-2020.07-x86_64_arm-linux-gnueabihf/bin
4、查看交叉编译器
重启reboot虚拟机Ubuntu,查看交叉编译器版本
讯享网arm-sgmstar-gnueabihf-9.1.0--gcc -v


二、arm-sgmstar-gnueabihf-9.1.0--gcc交叉编译openssl
参考博文
【Linux-ARM】安装 arm-linux-gnueabihf 交叉编译openssl-arm静态库与动态库
三、arm-sgmstar-gnueabihf-9.1.0--gcc交叉编译curl
参考博文
【Linux-ARM】arm-linux-gnueabihf、arm-himix200-linux交叉编译curl-arm 静态库.a与动态库.so
1、配置Makefile文件
CPPFLAGS="-I/home/hanhui/krtcode/thirdparty/openssl/openssl-1.0.2t_sgmstar/ -I/home/hanhui/krtcode/thirdparty/openssl/openssl-1.0.2t_sgmstar/include" LDFLAGS="-L/home/hanhui/krtcode/lib/sgmstar/1.0.0/lib" LIBS="-ldl" ./configure --host=arm-sgmstar-gnueabihf CC=arm-sgmstar-gnueabihf-9.1.0--gcc CXX=arm-sgmstar-gnueabihf-9.1.0--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=/home/hanhui/local/curl/curl_sgmstar
CPPFLAGS="-I/home/hanhui/krtcode/thirdparty/openssl/openssl-1.0.2t_sgmstar/ -I/home/hanhui/krtcode/thirdparty/openssl/openssl-1.0.2t_sgmstar/include" LDFLAGS="-L/home/hanhui/krtcode/lib/sgmstar/1.0.0/lib" LIBS="-ldl" ./configure --host=arm-sgmstar-gnueabihf CC=arm-sgmstar-gnueabihf-9.1.0--gcc CXX=arm-sgmstar-gnueabihf-9.1.0--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=/home/hanhui/local/curl/curl_sgmstar
2、make编译
讯享网make -j 4
3、编译结果
ls lib/.libs


4、查看是否ARM库
讯享网file lib/.libs/libcurl.so.4.7.0

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/109064.html