Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value

So after doing some exhaustive research tonight on this problem, I'm still stumped. I'm running Debian Wheezy and I'm trying to get curl to support ssl, which it just plainly refuses to do. I've tried to remove all traces of OpenSSL and Curl. Then use apt-get install OpenSSL, which installs "OpenSSL 1.0.1e". I then went and tried to compile curl from source, thinking maybe apt-get was just being silly with installing curl. I tried to configure using this.

./configure --with-ssl LDFLAGS="-ldl"

because it would pass some errors other wise. Without LDFLAGS I'll get this in my log. config.log But as I said, with LDFLAGS on, I'm able to actually create the config, but then when I go to make.. well.. that's when all heck seems to break loose and she won't install.

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [libcurl.la] Error 1
make[2]: Leaving directory `/home/openssl/curl-7.27.0/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/openssl/curl-7.27.0/lib'
make: *** [all-recursive] Error 1

After some research, some people suggested building OpenSSL with -fPIC. SO I purged OpenSSL from the system and tried to install from source, choosing to install version, 1.0.2 from this link https://www.openssl.org/source/openssl-1.0.2.tar.gz

This actually went pretty well and I made sure to include the -fPIC flag. I then went to install Curl again and still ended up getting this error.. which was strange.. so now I'm sitting here scratching my head. I've uninstalled, reinstalled, recompiled and installed and done every mix of things I can think of and I'm still pretty darn stumped.

Sorry if my formatting is terrible tonight, it's rather late for me. But if anyone could give me a hand, it'd be much appreciated.

like image 694
TheStuntman Avatar asked Mar 18 '23 05:03

TheStuntman


1 Answers

/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(ecp_nistz256.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value

Rebuild your local copy of OpenSSL with -fPIC. The local copy is the one located in /usr/local/ssl/lib/.

I've seen this issue on Fedora, too. Sometimes you can fix it with export CFLAGS=-fPIC. Other times you have to modify Makefile.org so its present.

like image 187
jww Avatar answered Mar 19 '23 18:03

jww