Bug 213851 - libboost -fPIC compile error on x86_64
Summary: libboost -fPIC compile error on x86_64
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: boost (Show other bugs)
(Show other bugs)
Version: 4.4
Hardware: x86_64 Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Benjamin Kosnik
QA Contact:
URL:
Whiteboard:
Keywords: Reopened
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-11-03 14:09 UTC by Paul Dwyer
Modified: 2013-08-09 05:48 UTC (History)
2 users (show)

Fixed In Version: RHBA-2007-0312
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-01 22:58:07 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
boost -fPIC patch (539 bytes, patch)
2006-11-07 15:09 UTC, Paul Dwyer
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0312 normal SHIPPED_LIVE boost bug fix update 2007-04-30 14:42:42 UTC

Description Paul Dwyer 2006-11-03 14:09:33 UTC
Description of problem:
When compiling the code below, linking against boost libraries, it throws the
following link error
usr/bin/ld:
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libboost_serialization.a(basic_iarchive.o):
relocation R_X86_64_32S against `vtable for
boost::archive::detail::basic_iarchive' can not be used when making a shared
object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libboost_serialization.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status

Version-Release number of selected component (if applicable):
x86_64 version of boost

How reproducible:
evey compile

Steps to Reproduce:
> cat S.cpp
#include  <iostream>
#include  <vector>

#include <boost/archive/tmpdir.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>

using namespace std;
using namespace boost::archive;
using namespace boost::serialization;

using std::setw;
using std::left;

class DebugInfo_t
{
public:
template<class Archive> void serialize(Archive & ar,
                                       const unsigned int=0 /*
file_version */);
};

class DebugInfo_m
{
public:
template<class Archive> void serialize(Archive & ar,
                                       const unsigned int=0 /*
file_version */) const;
bool serialize(std::ostream & out) const;
bool deserialize(std::istream & is);  
}; // DebugInfo_m

bool DebugInfo_m::deserialize(istream & is)
{
boost::archive::binary_iarchive ar(is);
serialize (ar);
return true;
} 

Compile using
/usr/bin/g++ -shared -fPIC S.cpp -lboost_serialization -o S.so

Actual results:
usr/bin/ld:
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libboost_serialization.a(basic_iarchive.o):
relocation R_X86_64_32S against `vtable for
boost::archive::detail::basic_iarchive' can not be used when making a shared
object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/3.4.3/../../../../lib64/libboost_serialization.a:
could not read symbols: Bad value
collect2: ld returned 1 exit status

Expected results:
Clean compile

Additional info:
This compiles under RHEL5 Beta1

Comment 25 Benjamin Kosnik 2006-11-13 10:41:50 UTC
Fixed.

Comment 27 Benjamin Kosnik 2006-11-22 09:37:07 UTC
Suzanne. 

Consider this devel_ack.

This has been fixed in CVS (See comment #13) and has been rebuilt (See Comment #23).

-benjamin

Comment 35 Red Hat Bugzilla 2007-05-01 22:58:07 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0312.html



Note You need to log in before you can comment on or make changes to this bug.