Bug 777407

Summary: pthread and dl not linked by default
Product: [openSUSE] openSUSE 12.1 Reporter: Alain Bertrand <alainbe>
Component: BasesystemAssignee: David Liang <dliang>
Status: RESOLVED INVALID QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: dliang
Version: Final   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE 12.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Alain Bertrand 2012-08-25 23:00:39 UTC
User-Agent:       Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:14.0) Gecko/20100101 Firefox/14.0.1

I installed opensuse on my laptop instead of ubuntu : very impressed, 
far more polished and easy to use. Congrats !

I had nonetheless a problem : I couldn't compile Tagainijisho (maybe
the best Japanese free dictionary). The developer, though, was very
diligent and found out a solution.

------------------

Ok, I finally got the time to check on OpenSuse and found a fix. Please
edit src/sqlite/CMakeLists.txt and add the following two lines at line
98 (just before the last "if (APPLE)"):

target_link_libraries(tagaini_sqlite pthread)
target_link_libraries(tagaini_sqlite dl)

Then recompile and everything should go fine. These two libraries are
automatically linked on most systems, but not on OpenSuse.
------------

May I suggest to align opensuse library linking to those of other
distros ? it would be to bad that other pieces of good software could
not compile on opensuse because of a minor problem.

Best regards,

Alain

Reproducible: Always

Steps to Reproduce:
1.Try to compile Tagainijisho from 0.9.4 sources.
Actual Results:  
Build fails

Expected Results:  
Build succeeds.

Tagaini source code https://github.com/downloads/Gnurou/tagainijisho/tagainijisho-0.9.4.tar.gz
Comment 2 Jiaying Ren 2012-11-02 06:15:38 UTC
Alain,thank you for your report. We've forwarded the problem you've mentioned to desktop QA team.

And this is also a problem about new packaging,you can mail to opensuse-packaging@opensuse.org, asking packager to build it into repo. :)
Comment 3 David Liang 2012-11-02 09:15:49 UTC
'-pthread' and '-ldl' were not provided while using qt4 in opensuse. But in qt4 document, it says the multi-thread should always be used. I guess these two links should be provided by default.
Comment 4 David Liang 2012-11-07 09:23:22 UTC
Still working on it, I find lots of complains about this linking problem, but not only on opensuse. Someone said it refers to the a glibc update. I try to make a reasonable explanation on this issue.
Comment 5 David Liang 2012-11-08 07:07:27 UTC
Some documents on this link issue: 
https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking
http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

openSUSE was updated to follow this DOS link change, we need to add '-lpthread -ldl' explicitly. 

I check the source code in https://github.com/Gnurou/tagainijisho, your patch 
  --target_link_libraries(tagaini_sqlite pthread)
  --target_link_libraries(tagaini_sqlite dl)
was already included, so I think this bug could be resolved as fixed.
Comment 6 David Liang 2012-11-16 08:14:13 UTC
close