shared library location and linking

star <[email protected]>
Newsgroups org.yoctoproject.lists.poky
Message-ID <[email protected]>
Hello,
I have a problem if a shared lib should be located in some other than
usual folder - in /opt/lib in my example. Althoug not usual, it should
be possible, right?
The lib itself is created well and with that including in recipe (which
tooks me some time to find):
SYSROOT_DIRS += "/opt/lib"
this lib is also populated into sysroot-destdir/opt/lib

But recipe of app, that is depending on that lib, will not link -
although the lib is located in build directory of app in
recipe-sysroot/opt/lib (thanks to the trick above).

I couldn't figure out what is the problem:

| arm-poky-linux-gnueabi-gcc  -mfpu=neon -mfloat-abi=hard
-mcpu=cortex-a9 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2
-Wformat -Wformat-security -Werror=format-security
--sysroot=/home/user/y/yocto_4014_sp2/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/sps/0.1-r0/recipe-sysroot
sps.c -L/opt/lib -lvision-device -o sps
|
/home/user/y/yocto_4014_sp2/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/sps/0.1-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.4.0/ld:
cannot find -lvision-device: No such file or directory
| collect2: error: ld returned 1 exit status

I don't know where the linker is looking for? Just as a dirty hack I
copied the libs in recipe as below, it works:

do_compile () {
     cp recipe-sysroot/opt/lib/* recipe-sysroot/usr/lib
     oe_runmake -f Makefile-sps
}

I seems the -L is not passed through!? Is it a bug? Or what do I miss?

Best regards and any help is welcome.
Steve

PS: Makefile is as simple:

LIBSINC  = -L/opt/lib
LIBS     = -lvision-device

all: sps

sps: *.c
         $(CC) sps.c $(LIBSINC) $(LIBS) -o sps

clean:
         rm -f sps
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.