使用“共享"选项编译OpenSSL吗? [英] Compile OpenSSL with the 'shared' option?

查看:94
本文介绍了使用“共享"选项编译OpenSSL吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在CentOS 5.4上,OpenSSL可以正常编译,而无需使用共享"选项.但是当我通过该选项时,编译失败并显示为:

On CentOS 5.4, OpenSSL compiles fine without 'shared' option. But when I passed that option the compilation fails with:

/usr/bin/ld:libcrypto.a(x86_64-gcc.o):在创建共享库时不能使用针对本地符号"的重定位R_X86_64_32;用-fPIC重新编译

/usr/bin/ld: libcrypto.a(x86_64-gcc.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC

当我尝试:./config shared CFLAGS=-fPIC时不起作用.

When I try: ./config shared CFLAGS=-fPIC that doesn't work.

如何使OpenSSL使用共享"选项进行编译?

What can I do to get OpenSSL to compile with the 'shared' option?

谢谢

推荐答案

这里存在同样的问题,但通常Makefile将考虑环境变量作为编译器或链接器选项.

Same problem here, BUT usually Makefiles will consider environment variables for compiler or linker options.

因此,如果在调用configure脚本之前将-fPIC选项 放置,则应注意这一点.您可以执行以下操作:

So, if you place the -fPIC option before calling the configure script, it should take care of it. You can do it with:

CFLAGS=-fPIC ./config shared --prefix=/your/path

export CFLAGS=-fPIC
./config shared --prefix=/your/path

对我有用.

这篇关于使用“共享"选项编译OpenSSL吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆