pciutils-dev possibly somewhat broken in feisty?

Bug #87436 reported by Matt Galvin
4
Affects Status Importance Assigned to Milestone
pciutils (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: pciutils-dev

Although this specific case is not supported, there seems to be a greater underlying issue, here is what happens...

While trying to build the mactel macbook pro backlight control app I get the following error messages

--- snip ---
mgalvin@bender:~/Projects/macbook-backlight$ make
gcc -Wall -g -Wextra -DVERSION=\"0.1.1\" backlight.c -o backlight -lpci
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `pci_load_name_list':
(.text+0x538): undefined reference to `gzopen'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `pci_load_name_list':
(.text+0x5d1): undefined reference to `gzgets'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L154':
(.text+0x6d6): undefined reference to `gzclose'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L154':
(.text+0x6f8): undefined reference to `gzeof'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L154':
(.text+0x795): undefined reference to `gzclose'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L154':
(.text+0xbdb): undefined reference to `gzopen'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L157':
(.text+0xd78): undefined reference to `gzerror'
/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/libpci.a(names.o): In function `.L157':
(.text+0xd9b): undefined reference to `gzclose'
collect2: ld returned 1 exit status
make: *** [backlight] Error 1
--- snip ---

Some digging turned up this stack of debian bugs which seem to also apply to feisty since we are using the same version of pciutils. The list of debian bugs is at:

http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=pkg&data=pciutils-dev&archive=no&version=&dist=unstable

Revision history for this message
TJ (tj) wrote :

Trying to build the suspend package utility s2ram on Feisty 32-bit I also ran into this problem. Based on what other people had said I believed initially it was a bug in the pciutils package, and libpci in particular.

After considerable hacking about between the configure scripts and Makefiles of pciutils/libpci and suspend-0.5 I realised that the compiler/linker errors detailed above were a bug in the Makefile of suspend-0.5.

pciutils/libpci is installed to /usr/lib/libpci.a and is a static library. It in turn relies on the zlib static library /usr/lib/libz.a. In its configure script it correctly passes the linker parameter "-lz" which causes ld (the GNU linker) to link libpci against libz.

suspend-0.5's Makefile omits to pass the same "-lz" to the linker, although it does pass "-lpci" correctly. Adding "-lz" as an additional linker parameter, and using LD_FLAGS in the s2ram target rule, solves the problem:

LD_FLAGS=-L/usr/local/lib
LD_FLAGS += -lz

s2ram: s2ram.c dmidecode.c whitelist.c radeontool.c $(S2RAMOBJ)
 $(CC) $(CFLAGS) -g s2ram.c $(S2RAMOBJ) $(LD_FLAGS) -lpci -o s2ram

I'm guessing that compilation issues with other source packages are caused by this same error in their configure scripts and/or Makefile.

Revision history for this message
thatmattbone (thatmattbone) wrote :

So using TJ's comment, if you want to get backlight working, just add -lz to the LIBS in the makefile. You also probably need to make sure you have zlib installed.

Revision history for this message
Andreas Moog (ampelbein) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering is this still an issue for you? Can you try with latest Ubuntu release? Thanks in advance.

Changed in pciutils:
assignee: nobody → andreas-moog
status: New → Incomplete
Revision history for this message
Andreas Moog (ampelbein) wrote :

Closing this bug since no answer came if this is still an issue. Don't hesitate to submit bug reports in the future.

To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in pciutils:
assignee: andreas-moog → nobody
status: Incomplete → Invalid
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.