[LinuxBIOS] Can't compile flashrom

Shocky shocky1 at users.sourceforge.net
Mon Nov 26 21:34:59 CET 2007

On Monday 26 November 2007 12:52, Uwe Hermann wrote:
> Please post the full compile output here.
> Do you have pciutils-dev and zlib-dev (or whatever it's called on your
> distribution) installed?
> Also, there's a Mandriva package already (don't know in which "branch"
> of Mandriva though). Doesn't that work?
> http://linuxbios.org/Flashrom#Installation
> If all else fails, edit the Makefile to remove the check for
> pciutils-dev etc. and see if it works anyway. Maybe it's just the check
> which is broken.
> Uwe.

Yes, pciutils-devel and zlib-devel are installed. 

There is no package Mandriva package in any of the standard repositories named 
flashrom or linuxbios, and no packages that contain any file whose name 
contains the string "flashrom". This is the first thing I tried before 
resorting to trying a build.

Here's the output from when I compiled and tried to link the test program 
extracted from the Makefile, and a few lines to show that the files are there 
that should be.

[flashrom]$ cat test.c
#include <pci/pci.h>
struct pci_access *pacc;
int main(int argc, char **argv)
{ pacc = pci_alloc(); return 0; }
[flashrom]$ gcc -c test.c
[flashrom]$ ld -lpci -lz -static test.o
ld: warning: cannot find entry symbol _start; defaulting to 0000000008048094
test.o: In function `main':
test.c:(.text+0x12): undefined reference to `pci_alloc'
[flashrom]$ ls -l /usr/lib/libpci.a
-rw-r--r-- 1 root root 138094 2007-08-14 16:11 /usr/lib/libpci.a
[flashrom]$ ls -l /usr/include/pci/pci.h
-rw-r--r-- 1 root root 6479 2007-08-14 16:11 /usr/include/pci/pci.h
[flashrom]$ grep pci_alloc /usr/include/pci/pci.h
struct pci_access *pci_alloc(void);

I tried removing the pciutils dependency from the all target in Makefile, 
though I didn't expect this to work (if it can't find the symbol in the test 
file, it's not going to find the symbol in the real program, is it?). This 
gives me a different ld error:

/usr/bin/ld: cannot find -lc

These are my opinions. Get your own.

More information about the coreboot mailing list