libupsclient.pc contains unresolved symbols

Bug #743484 reported by Fabrice Coutadeur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nut (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Binary package hint: nut

Hi,

While I was investigating a FTBFS in collectd:
...
configure:22249: checking for upscli_connect in -lupsclient
configure:22274: i686-linux-gnu-gcc -o conftest -Wall -g -O2 -I/build/fabrice-collectd_4.10.1-2.1build1-i386-7yH3eE/collectd-4.10.1/debian/include -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL' -UCONFIGFILE -DCONFIGFILE='"/etc/collectd/collectd.conf"' -Wl,-Bsymbolic-functions @LIBSSL_LDFLAGS@ -L/lib -lupsclient conftest.c -lupsclient -ldl >&5
i686-linux-gnu-gcc: @LIBSSL_LDFLAGS@: No such file or directory
I discovered that this reference to LIBSSL_LDFLAGS comes from libupsclient.pc.

As you can see in actual .pc file, this reference has not been resolved at compile time (content of more /usr/lib/pkgconfig/libupsclient.pc in a natty schroot):
prefix=/usr
exec_prefix=/
libdir=/lib
includedir=/usr/include
sysconfdir=/etc/nut
statepath=/var/run/nut
nutuser=nut

Name: libupsclient
Description: UPS monitoring with Network UPS Tools
Version: 2.6.0
Libs: -L${libdir} -lupsclient @LIBSSL_LDFLAGS@
Cflags: -I${includedir}

This is because configure script and all makefile.in has been updated to use and substitute LIBSSL_LIBS instead of LIBSSL_LDFLAGS, but libupsclient.pc.in has not been updated.
By replacing LIBSSL_LDFLAGS with LIBSSL_LIBS in .in files, the generated .pc file is correct.

Thanks,
Fabrice

Related branches

Changed in nut (Ubuntu):
assignee: nobody → Fabrice Coutadeur (fabricesp)
status: New → In Progress
Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Patch that fix the error and make collectd more buildable (there is still an error because of gcc4.5 that I'll fix after the fix for nut is uploaded)

Changed in nut (Ubuntu):
assignee: Fabrice Coutadeur (fabricesp) → nobody
status: In Progress → Confirmed
importance: Undecided → High
Revision history for this message
Chris Halse Rogers (raof) wrote :

This looks right to me; could the next sponsor - someone who can actually upload this - please do so!

Revision history for this message
Arnaud Quette (aquette) wrote : Re: [Bug 743484] [NEW] libupsclient.pc contains unresolved symbols

Salut Fabrice

2011/3/27 Fabrice Coutadeur <email address hidden>

> Public bug reported:
>
> Binary package hint: nut
>
> Hi,
>
> While I was investigating a FTBFS in collectd:
> ...
> configure:22249: checking for upscli_connect in -lupsclient
> configure:22274: i686-linux-gnu-gcc -o conftest -Wall -g -O2
> -I/build/fabrice-collectd_4.10.1-2.1build1-i386-7yH3eE/collectd-4.10.1/debian/include
> -DLT_LAZY_OR_NOW='RTLD_LAZY|RTLD_GLOBAL' -UCONFIGFILE
> -DCONFIGFILE='"/etc/collectd/collectd.conf"' -Wl,-Bsymbolic-functions
> @LIBSSL_LDFLAGS@ -L/lib -lupsclient conftest.c -lupsclient -ldl >&5
> i686-linux-gnu-gcc: @LIBSSL_LDFLAGS@: No such file or directory
> I discovered that this reference to LIBSSL_LDFLAGS comes from
> libupsclient.pc.
>
> As you can see in actual .pc file, this reference has not been resolved at
> compile time (content of more /usr/lib/pkgconfig/libupsclient.pc in a natty
> schroot):
> prefix=/usr
> exec_prefix=/
> libdir=/lib
> includedir=/usr/include
> sysconfdir=/etc/nut
> statepath=/var/run/nut
> nutuser=nut
>
> Name: libupsclient
> Description: UPS monitoring with Network UPS Tools
> Version: 2.6.0
> Libs: -L${libdir} -lupsclient @LIBSSL_LDFLAGS@
> Cflags: -I${includedir}
>
> This is because configure script and all makefile.in has been updated to
> use and substitute LIBSSL_LIBS instead of LIBSSL_LDFLAGS, but
> libupsclient.pc.in has not been updated.
> By replacing LIBSSL_LDFLAGS with LIBSSL_LIBS in .in files, the generated
> .pc file is correct.
>

fully right, thanks for investigation and patch.
For the sake of completion, lib/libupsclient-config.in (a replacement when
pkg-config is not present) also need to be fixed.

I've just applied it upstream (in NUT, commit r2960) while waiting for a new
Debian upload (I may lag a bit more, considering my current workload...):
http://trac.networkupstools.org/projects/nut/changeset/2960

Note that the above link may not yet be active by the reception of this
mail.

cheers,
Arnaud
--
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/

Revision history for this message
Fabrice Coutadeur (fabricesp) wrote :

Salut Arnaud!

I was going to report the patch (that contains both .in files) to Debian as soon as it got uploaded to Ubuntu: you've been faster!

Thanks!

Fabrice

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

This bug was fixed in the package nut - 2.6.0-1ubuntu2

---------------
nut (2.6.0-1ubuntu2) natty; urgency=low

  * fix_pc_file.patch: fix .pc source files by using LIBSSL_LIBS instead of
    LIBSSL_LDFLAGS to avoid a FTBFS in packages that uses libupsclient.pc
    (LP: #743484)
 -- Fabrice Coutadeur <email address hidden> Sun, 27 Mar 2011 08:21:01 +0200

Changed in nut (Ubuntu):
status: Confirmed → 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.