Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 519738 - dev-libs/protobuf USE=static-libs - ld: /usr/lib/lib64/libprotobuf.a(common.o): relocation R_X86_64_32S against `_ZTVN6google8protobuf7ClosureE' can not be used when making a shared object; recompile with -fPIC
Summary: dev-libs/protobuf USE=static-libs - ld: /usr/lib/lib64/libprotobuf.a(common.o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Tim Harder
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-12 15:13 UTC by Doug
Modified: 2014-11-28 14:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge_info.txt,16.52 KB, text/plain)
2014-08-12 15:13 UTC, Doug
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doug 2014-08-12 15:13:04 UTC
Created attachment 382760 [details]
emerge --info

With the use flag 'static-libs' enabled for the package "dev-libs/protobuf-2.5.0", the -fPIC flag should be used to enable builds with the static library. Linking against the resultant static library gives relocations errors like:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../lib64/libprotobuf.a(common.o): relocation R_X86_64_32S against `_ZTVN6google8protobuf7ClosureE' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../lib64/libprotobuf.a: could not read symbols: Bad value

Looking at the emerge output, it does seem to be the case that -fPIC is not present.

libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -O2 -pipe -c google/protobuf/stubs/common.cc -o common.o >/dev/null 2>&1

I've attacked my emerge --info dump
Comment 1 Tim Harder gentoo-dev 2014-11-28 14:30:42 UTC
This appears to be fixed in 2.5.0-r2.