libjsonrpccpp-common.a is not compiled with -fPIC flag

Bug #1592433 reported by Kamil Gardziejczyk
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libjson-rpc-cpp (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

I have C++11 application that uses libjsonrpccpp. The application was working fine with previous library packages.

Packages are installed using apt-get:

ii libjsonrpccpp-client0 0.6.0-2build1 amd64 library implementing json-rpc C++ clients
ii libjsonrpccpp-common0 0.6.0-2build1 amd64 common functionality for server and client library
ii libjsonrpccpp-dev 0.6.0-2build1 amd64 development files for JSON-RPC C++ framework
ii libjsonrpccpp-server0 0.6.0-2build1 amd64 library implementing json-rpc C++ servers
ii libjsonrpccpp-stub0 0.6.0-2build1 amd64 library for stub generation of libjsonrpccpp based applications
ii libjsonrpccpp-tools 0.6.0-2build1 amd64 stub generator for libjsonrpccpp based applications

Currently, during compilation (for both, clang and gcc) I`m getting the following error.

clang:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsonrpccpp-common.a(specificationparser.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libjsonrpccpp-common.a: error adding symbols: Bad value

gcc:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libjsonrpccpp-common.a(procedure.cpp.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib/x86_64-linux-gnu/libjsonrpccpp-common.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

GCC ver:
gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.

CLang Ver:
clang version 3.8.0-2ubuntu3 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu

Ubuntu:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04 LTS
Release: 16.04
Codename: xenial

affects: pigz (Ubuntu) → libjson-rpc-cpp (Ubuntu)
Revision history for this message
Peter Spiess-Knafl (7ev) wrote :

You are trying to link against the static versions of the library, which are not -fPIC compiled by design.

Revision history for this message
Kamil Gardziejczyk (belussi-pl) wrote :

Ok. Got it. In previous version of my app the library was compiled by me in static mode with -fPIC. Now, I`d like to use the one provided by OS. What is the reason to not compile it by default with -fPIC in static version?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.