Status: Unconfirmed
Owner: ----
Labels: Pri-2 Via-Wizard Type-Bug OS-Linux
New issue 452464 by
lmini...@gmail.com: Can't compile shared library of
BoringSSL
https://code.google.com/p/chromium/issues/detail?id=452464
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like
Gecko) Chrome/41.0.2224.3 Safari/537.36
Steps to reproduce the problem:
I tried to ask about this problem on the discuss-webrtc but I got no
response, so I'm trying here now. I'm trying to compile BoringSSL as a
library to use in another probject, so this is not Chrome related: anyway,
I found other BoringSSL related issues notified here so I thought I'd ask
here too. If this is not the place to ask, please refer me to the proper
place to do so, as I couldn't find anything by myself.
About the issue, I'm trying to compile a shared version of BoringSSL on a
64-bit Fedora, and failed so far. I changed the STATIC in
crypto/CMakeLists.txt and ssl/CMakeLists.txt to SHARED and I added the
-DBORINGSSL_SHARED_LIBRARY definition to the already existing
-DBORINGSSL_IMPLEMENTATION, as suggested in the BUILDING doc. I also had to
remove the -Wshadow flag as it gave a warning on my compiler which caused
an error (all warnings are treated as errors). That said, the linking fails
(details below).
What is the expected behavior?
A shared build of libssl.so and libcrypto.so
What went wrong?
Everything seems to go fine until it's time to link:
Linking C shared library libcrypto.so
/usr/bin/ld: sha/CMakeFiles/sha.dir/sha1-x86_64.S.o: relocation
R_X86_64_PC32 against symbol `OPENSSL_ia32cap_P' can not be used when
making a shared object; recompile with -fPIC
I already tried setting the -fPIC in several different ways as suggested,
but that didn't solve it. When inspecting with readelf, I get this, so this
might be a different issue:
readelf --relocs crypto/sha/CMakeFiles/sha.dir/sha1-x86_64.S.o
Relocation section '.rela.text' at offset 0x2370 contains 3 entries:
Offset Info Type Sym. Value Sym. Name +
Addend
000000000003 000800000002 R_X86_64_PC32 0000000000000000
OPENSSL_ia32cap_P - 4
00000000000a 000800000002 R_X86_64_PC32 0000000000000000
OPENSSL_ia32cap_P + 0
000000000011 000800000002 R_X86_64_PC32 0000000000000000
OPENSSL_ia32cap_P + 4
Did this work before? N/A
Chrome version: 41.0.2224.3 Channel: n/a
OS Version:
Flash Version: Shockwave Flash 15.0 r0
Any clue? Is this a bug in the cmake setup, or something wrong in my
environment?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings