libgtest.a needs to be built with -fPIC

Bug #949244 reported by Chase Douglas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gtest (Debian)
Fix Released
Unknown
gtest (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Currently, only the shared library version of libgtest is compiled with -fPIC, but the shared library is not distributed. This creates a problem when linking with other code compiled with -fPIC:

cndougla@cndougla:~/Canonical/ubuntu/xorg-server/xorg-server/build-main/test/integration$ /bin/bash ../../libtool --tag=CXX --mode=link g++ -DDUMMY_CONF_PATH=/usr/share/xorg/gtest/dummy.conf -g -O0 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -lpthread -Wl,-Bsymbolic-functions -pie -Wl,-z,relro -Wl,-Bsymbolic -o integration-test two_window_test.o two_window_touch_test.o one_accept.o -lgtest -lxorg-gtest_main -lxorg-gtest -lXi -lutouch-evemu -lm -lrt
libtool: link: g++ -DDUMMY_CONF_PATH=/usr/share/xorg/gtest/dummy.conf -g -O0 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wl,-Bsymbolic-functions -pie -Wl,-z -Wl,relro -Wl,-Bsymbolic -o integration-test two_window_test.o two_window_touch_test.o one_accept.o -lpthread -lgtest -lxorg-gtest_main -lxorg-gtest -lXi -lutouch-evemu -lm -lrt
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libgtest.a(gtest-all.cc.o): relocation R_X86_64_32S against `vtable for testing::internal::TestEventRepeater' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libgtest.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gtest - 1.6.0-1ubuntu1

---------------
gtest (1.6.0-1ubuntu1) precise; urgency=low

  * Build all libraries with -fPIC (LP: #949244)
 -- Chase Douglas <email address hidden> Wed, 07 Mar 2012 11:28:38 -0800

Changed in gtest (Ubuntu):
status: New → Fix Released
Changed in gtest (Debian):
status: Unknown → Won't Fix
Changed in gtest (Debian):
status: Won't Fix → Fix Released
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.