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

15,760

Solution 1

/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.

Solution 2

recompile your openssl with ./config shared CFLAGS=-fPIC

Share:
15,760
TheStuntman
Author by

TheStuntman

Updated on June 04, 2022

Comments

  • TheStuntman
    TheStuntman almost 2 years

    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.

  • TheStuntman
    TheStuntman about 9 years
    Ended up being a crud ton of bad package installs and packages missing from the system. I forgot to update my OP with this. I originally got this system from two junior system admins. Just learning this stuff and unfortunately didn't know what they were doing. They had repos on there for the bleeding edge version of Debian as well as mint. When I was fixing things, apparently it uninstalled some packages it needed. I figured it out once I re-installed the openssh server. Rather interesting little experience. Eventually I just redid the whole box, easier like that.