当前位置:网站首页>Cross compilation correlation of curl Library

Cross compilation correlation of curl Library

2022-06-25 14:59:00 qq_ twenty-three million nine hundred and fifty-three thousand

Preset conditions

 compile curl Compile before openssl, And you need to openssl Install on the compiled machine 

To configure

Such as ./configure CPPFLAGS=-fPIC --without-zlib --disable-ldap --disable-ldaps --without-nss --with-ssl=/usr/local/ssl_arm --enable-ipv6 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ --host=arm-none-linux

  1. CPPFLAGS=-fPIC If you want to use curl To compile dynamic libraries , You must add -fPIC This option , And it must be CPPFLAGS, I always thought it was CXXFLAGS... In the pit
  2. –with-ssl ssl Installation path for ,openssl Be sure to install before compiling curl
  3. –host=arm-none-linux What architecture does the compiled library use ,Config.sub All schema information is recorded in the file . Sometimes this option is not added , The dynamic library cannot be compiled , That is to compile the dynamic library , This field must be added
  4. Shenwei –build=alpha --host=alpha-none-linux

Problem solving

Use after the first compilation libcurl.a When compiling your own dynamic library , I have the following problems :
unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `[email protected]@GLIBC_2.17’
Solution : compile curl add PPFLAGS=-fPIC

原网站

版权声明
本文为[qq_ twenty-three million nine hundred and fifty-three thousand ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200514582084.html