From: star <star@gmx.li>
To: "poky@lists.yoctoproject.org" <poky@lists.yoctoproject.org>
Subject: shared library location and linking
Date: Mon, 20 Nov 2023 15:27:46 +0100 [thread overview]
Message-ID: <67de211f-f0a6-43c4-a7b7-bc88e02ca475@gmx.li> (raw)
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
reply other threads:[~2023-11-20 14:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67de211f-f0a6-43c4-a7b7-bc88e02ca475@gmx.li \
--to=star@gmx.li \
--cc=poky@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).