Bug 813825 - [Patch] gtest does not properly link against pthread
[Patch] gtest does not properly link against pthread
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: gtest (Show other bugs)
16
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Akira TAGOH
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-18 10:00 EDT by Tim Niemueller
Modified: 2012-10-16 05:18 EDT (History)
2 users (show)

See Also:
Fixed In Version: gtest-1.6.0-1.fc18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-10-16 05:18:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix linker problem (2.84 KB, patch)
2012-04-18 10:00 EDT, Tim Niemueller
no flags Details | Diff

  None (edit)
Description Tim Niemueller 2012-04-18 10:00:43 EDT
Created attachment 578363 [details]
Patch to fix linker problem

Description of problem:
When trying to build PCL 1.5 (package pcl) on F-16 I get the following errors:
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libgtest.so: undefined reference to `pthread_key_create'
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libgtest.so: undefined reference to `pthread_getspecific'
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libgtest.so: undefined reference to `pthread_key_delete'
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/../../../../lib64/libgtest.so: undefined reference to `pthread_setspecific'

This is caused by gtest not properly linking against pthread. The attached patch applies to the recent master of the gtest package repository (git am) and adds "-lpthread" to the link libraries.


Version-Release number of selected component (if applicable):
gtest-1.5.0-6.fc16.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Get src rpm from http://koji.fedoraproject.org/koji/buildinfo?buildID=311730
2. rpmbuild --rebuild pcl-1.5-1.src.rpm

  
Actual results:
Linker errors.

Expected results:
Successful build.

Additional info:
The patch adds a minimal patch to add the -lpthread flag.
Comment 1 Tim Niemueller 2012-09-27 13:24:27 EDT
Any idea if and when you fix this? Or has this been fixed?
Comment 2 Akira TAGOH 2012-09-27 23:01:34 EDT
Well, this issue seems not happening when building with cmake which is recommended way. new upstream version is also available but "make test" seems not passed. I'm trying to see what's wrong.
Comment 3 Fedora Update System 2012-09-28 05:18:50 EDT
gtest-1.6.0-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/gtest-1.6.0-1.fc18
Comment 4 Fedora Update System 2012-09-28 05:34:30 EDT
gtest-1.6.0-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/gtest-1.6.0-1.fc17
Comment 5 Fedora Update System 2012-09-28 05:35:19 EDT
gtest-1.6.0-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gtest-1.6.0-1.fc16
Comment 6 Terje Røsten 2012-09-28 06:28:54 EDT
Akira,

can you provide some feedback on comment  #1 in
 https://bugzilla.redhat.com/show_bug.cgi?id=737268
Comment 7 Akira TAGOH 2012-09-28 07:10:57 EDT
Hmm, given that they think there are the violation of the ODR in gtest itself, roughly speaking, IMHO API is to protect this case. if they give up to maintain their APIs and address some conflict then, hmm, yeah, it may be better stop shipping it in Fedora perhaps. fortunately mozc doesn't require gtest anymore. I don't mind either.

Anyway, I guess it's not introduced by 1.6.0 but just they realized and stopped "make install" since. so it should be a separate issue so far.

I'm wondering if it can be avoided with shipping the static library only?

We should open an another bug for that maybe.
Comment 8 Akira TAGOH 2012-09-28 07:15:45 EDT
FWIW I haven't ever tried to write any test cases with it. so I may be wrong.
Comment 9 Tim Niemueller 2012-09-28 07:29:45 EDT
From my side all I asked for was linking against pthread. It seems stupid to have a library that you cannot ship prebuilt. Is there a link to the reasoning behind this?
Comment 10 Akira TAGOH 2012-09-28 08:36:51 EDT
I think the above bugzilla link explains all. in addition to, if you aren't sure what's the One Definition Rule, http://en.wikipedia.org/wiki/One_Definition_Rule.
Comment 11 Fedora Update System 2012-09-28 13:22:52 EDT
Package gtest-1.6.0-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gtest-1.6.0-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-15034/gtest-1.6.0-1.fc18
then log in and leave karma (feedback).
Comment 12 Akira TAGOH 2012-10-16 05:18:42 EDT
dunno why this bug wasn't closed even though the updated package has already been pushed to the stable. anyway closing.

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