前言:
在使用mpis平台的交叉编译工具编译openssl+curl库时,遇到uClibc was built without large file support和undefined reference to `getcontext`编译报错。
问题分析
uClibc was built without large file support:
该问题是由于开发人员在配置和构建uClibc编译器时没有开启Large File Support大文件支持导致的。可通过增加编译选项-D_FILE_OFFSET_BITS==32解决。
undefined reference to `getcontext`:
该问题是由于mpis平台没有提供GNU C的ucontext库导致的。可通过增加no-async命令进行解决
解决方法:
配置openssl工程时输入命令:
./config no-async no-asm shared --prefix=自定义openssl最终安装路径 CC=交叉编译工具链路径/mips-linux-gcc
在生成的Makefile文件中检索m64这个编译FLAG,将其删除,并在编译选项中加入-D_FILE_OFFSET_BITS==32。
最后执行make && make install即可
配置curl工程时输入命令:
./configure --prefix=自定义curl最终安装路径 --with-ssl=自定义openssl最终安装路径 CC=交叉编译工具链路径/mips-linux-gcc --host=arm-linux
最后执行make && make install即可