[openssl-users] -fPIC option missing for crypto/bn/x86_64-gcc.c and some other files in 1.0.2l that exists in 1.0.1m & 1.1.0c
Bill Smith
bsmith at progress.com
Fri Jun 2 12:10:32 UTC 2017
Hi,
I'm building OpenSSL 1.0.2l on Centos Linux 5.4. When linking the libcrypto.a library against my application, I'm getting the error:
/usr/bin/ld: /vobs_prgs/src/openssl/linuxx86_64/lib/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
Looking at the openssl build output, sure enough, it's missing -fPIC.
gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -c -o x86_64-gcc.o asm/x86_64-gcc.c
If I compare compilation output with 1.0.1m, I see that -fPIC is included. Ditto for 1.1.0c.
I look at the configure output for 1.0.2l and see -fPIC is missing for CFLAG:
IsMK1MF=0
CC =gcc
CFLAG =-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
The configure output for 1.0.1m has -fPIC for CFLAG:
IsMK1MF=0
CC =gcc
CFLAG =-DOPENSSL_THREADS -D_REENTRANT -DDSO_LINUX-SHARED -m64 -fvisibility=hidden -fPIC -DPIC -DL_ENDIAN -DTERMIO -O3 -Wall -DMD32_REG_T=int -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM
What is the correct way for me to add the -fPIC option so that crypto/bn/x86_64-gcc.c is compiled with it? Thanks!
More information about the openssl-users
mailing list