Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Can';使用OpenSSL链接libCURL_Linux_Cross Platform_Openssl_Libcurl - Fatal编程技术网

Linux Can';使用OpenSSL链接libCURL

Linux Can';使用OpenSSL链接libCURL,linux,cross-platform,openssl,libcurl,Linux,Cross Platform,Openssl,Libcurl,构建和安装OpenSSL 1.0.0.e没有问题,我所要做的就是在Makefile中设置正确的编译器 在不使用OpenSSL的情况下编译libCURL工作正常,但在使用 ./configure --host=mipsel-angstrom-linux PCRECONFIG=/usr/local/crosstoolchain/usr/local/bin/pcre-config --with-openssl 我收到以下错误消息: ld: libssl.a(s2_clnt.o): relocatio

构建和安装OpenSSL 1.0.0.e没有问题,我所要做的就是在Makefile中设置正确的编译器

在不使用OpenSSL的情况下编译libCURL工作正常,但在使用

./configure --host=mipsel-angstrom-linux PCRECONFIG=/usr/local/crosstoolchain/usr/local/bin/pcre-config --with-openssl
我收到以下错误消息:

ld: libssl.a(s2_clnt.o): relocation R_MIPS_HI16 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
libssl.a: could not read symbols: Bad value

我尝试用
-fPIC
编译OpenSSL,也尝试将
-fPIC
用于libCURL,但都没有用。如何解决此问题?

打开tarball根目录中名为
Configure
的OpenSSL文件。向下移动到第610行左右,您将看到MIPS的以下内容(如果这一点不好,请找到更好的匹配项):

-fPIC
添加到所使用的选项中


或者,在tarball的根目录中打开名为
Makefile.org
的OpenSSL文件。向下移动到第60行左右,您将看到以下内容:

CC= gcc
$ export CFLAGS="-fPIC"
$ ./config
将以下内容添加为
CC

CC= gcc -fPIC
这是一种黑客行为,因为您希望对
CFLAGS
执行此操作,但Makefile不接受宏


或者,您可以等待OpenSSL的配置完成(即,在运行
/config
之后),然后打开所有makefiles并将其添加到从
Makefile.org
模板创建的
CFLAGS
。确保访问子目录中的makefile,如
crypto
引擎


OpenSSL的最终解决方案是在
config
Configure
中添加自定义行。Ben Laurie和其他人在执行自定义构建时会这样做。搜索
config
Configure
中的“debug ben”或“ben debug”或类似内容


对于
libcurl
,我认为这是一个汽车制造项目。只需执行以下操作:

CC= gcc
$ export CFLAGS="-fPIC"
$ ./config

我认为这是最好的,因为它不涉及黑客文件

./Configure linux-x86_64 -fPIC
我是通过跑步找到的

./config -h
做一些猜测。我通过使用

grep PIC Makefile