Came across an annoying packaging situation on Fedora the other night – I was backporting a kernel from Fedora 15 to Fedora 13 in order to try and fix a stability issue on my Lenovo X201 with docking/undocking.
When building the kernel, came across the following error during compile:
/home/build/packages/BUILDROOT/kernel-2.6.38.8-32.fc13.x86_64/usr/src/kernels -name ‘.*.cmd’ -exec rm -f ‘{}’ ‘;’+ make -j4 -C tools/perf -s V=1 HAVE_CPLUS_DEMANGLE=1 prefix=/usr allPERF_VERSION = 2.6.38.8-32.fc13.x86_64 * new build flags or prefix/usr/bin/ld: cannot find -liberty collect2: ld returned 1 exit statusmake: *** [perf] Error 1error: Bad exit status from /var/tmp/rpm-tmp.po5h29 (%build)RPM build errors: Bad exit status from /var/tmp/rpm-tmp.po5h29 (%build)
Typically, when a library is missing, it’s a case of installing the library-devel package in order to statisfy build requirements.
-liberty is a special situation though, I was unable to find development package – or for that matter, even a regular package.
Turns out, the package is actually GNU libiberty and doesn’t ship as a separate package – instead it’s only used when compiling binutils and the Fedora 13 version appears to be missing various files required.
I ended up backporting binutils from Fedora 15 and install both binutils-devel to get libiberty headers, along with binutils-debuginfo in order to get the source tree for libiberty installed to /usr/src/.
After this, my kernel build completed quite happily. :-)
I faced the same “cannot find -liberty” error while compiling 2.6.38.11.49 on my Ubuntu Natty. Installing the binutils-dev package helped me solve that.
Thanks for the entry, dude!
Thank you very much astro for posting about the binutils-dev package. I also solved my Issue.
It’s in binutils-static on F13
For those who may come across this while compiling on a ubuntu machine i also had to install libiberty-dev