0

I am compiling pciutils (but it's not important, it could be another source code) with a gcc ARM version.

When I compile, the process stops because it cannot find the required libraries:

/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crt1.o: No such file or directory
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crti.o: No such file or directory
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtbegin.o: No such file or directory
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lz
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lresolv
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc_s
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lc
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find -lgcc_s
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtend.o: No such file or directory
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/i686-linux/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/4.9.2/ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
Makefile:103: recipe for target 'lspci' failed
make: *** [lspci] Error 1

But, for example, crt1.o can be found in three directories:

/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/overo-tcbootstrap/usr/lib/crt1.o
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/overo/usr/lib/crt1.o
/home/simo/development/gcc-armhf-yocto-sysroot/sysroots/overo/usr/include/glibc-locale-internal-cortexa8hf-vfp-neon-poky-linux-gnueabi/usr/lib/crt1.o

How can I avoid this issue ? It could be useful also for other source codes (since I have to compile a few sets of).

Thank you.

2
  • Where did the Makefile come from?
    – njsg
    Nov 26, 2015 at 12:54
  • from the source code of pciutils (I am trying to compile version 3.3.1 from kernel.org/pub/software/utils/pciutils) and I modified the CROSS_COMPILE flag and added the required flags for sysroot and include directories of gcc.
    – xyx
    Nov 26, 2015 at 13:06

1 Answer 1

1

Generally in makefiles you can add -L/path/to/lib to the linker-flags. However I dont know if this is a good solution for your concrete problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.