我正在尝试创建一个带有curl和openssl的PyCurl轮,它是静态编译的,但是没有成功。
这是我要执行的步骤
cd /openssl-1.1.1b/ && ./config -static -lpthread no-shared && make
configure --prefix=/tmp/libcurl/compiled --with-openssl=/openssl-1.1.1b/ --disable-shared && make && make install
cd /tmp/libcurl/compiled && CURL_STATICLIB=1 CURL_STATIC=1 PYCURL_CURL_CONFIG=/tmp/libcurl/compiled/bin/curl-config LDFLAGS='-L/tmp/libcurl/compiled/lib' python -m pip wheel pycurl
这会产生以下错误:
/usr/bin/ld: /usr/local/lib/libcrypto.a(bio_lib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libcrypto.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
我不编译共享库,所以应该在哪里使用-fPIC?