Static library for libyajl is "libyajl_s.a" and pkg-config lies about it

Bug #1772711 reported by Adam Novak
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
yajl (Debian)
Confirmed
Unknown
yajl (Ubuntu)
Triaged
Low
Unassigned

Bug Description

The static library for libyajl-dev is installed as /usr/lib/x86_64-linux-gnu/libyajl_s.a and not /usr/lib/x86_64-linux-gnu/libyajl.a. This means that static linking with "-lyajl" will not find it; you need to use "-lyajl_s".

This has not been explained to pkg-config (and I suspect the pkg-config file format can't express it). So when you do "pkg-config --static --libs yajl", you get back "-lyajl" and not "-lyajl_s". You also get the erroneous "-lyajl" when you ask pkg-config about anything that *depends* on yajl, such as raptor2:

$ pkg-config --libs --static raptor2
-lraptor2 -lcurl -lxml2 -lxslt -lxml2 -lyajl

This makes pkg-config not work for linking statically against any library that depends on yajl.

The Debian bug for this problem is at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877285 and has been sitting idel for several months. I've also opened an upstream bug at https://github.com/lloyd/yajl/issues/209 but the upstream project seems suspiciously quiet, and I think the upstream maintainer may have quit.

I believe the actual problem with the upstream code is at https://github.com/lloyd/yajl/blob/5e3a7856e643b4d6410ddc3f84bc2f38174f2872/src/CMakeLists.txt#L38-L40 where CMake is told to build a static library and a dynamic library with different names. (This might be necessary on Windows, but nobody knows how to deal with it in Linux.)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: libyajl-dev 2.1.0-2
ProcVersionSignature: Ubuntu 4.4.0-124.148-generic 4.4.117
Uname: Linux 4.4.0-124-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.17
Architecture: amd64
CurrentDesktop: XFCE
Date: Tue May 22 12:37:28 2018
Dependencies:
 gcc-6-base 6.2.0-3ubuntu11~12.04 [origin: unknown]
 libc6 2.23-0ubuntu10
 libgcc1 1:6.2.0-3ubuntu11~12.04 [origin: unknown]
 libyajl2 2.1.0-2
 multiarch-support 2.23-0ubuntu10
EcryptfsInUse: Yes
InstallationDate: Installed on 2013-04-18 (1859 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
SourcePackage: yajl
UpgradeStatus: Upgraded to xenial on 2018-02-26 (85 days ago)

Revision history for this message
Adam Novak (interfect) wrote :
Changed in yajl (Debian):
status: Unknown → New
Changed in yajl (Ubuntu):
status: New → Confirmed
Robie Basak (racb)
Changed in yajl (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Unfortunately it's probably too far down our backlog to ever make it to the top. In the meantime, patches welcome - though those would probably be better going to Debian or upstream first.

Changed in yajl (Debian):
status: New → Confirmed
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.