Skip to contentSkip to conversation

shared library location and linking

poky star 3 participants 6 messages Nov 21, 2023 – May 3, 2024 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

star

author
#1 lore raw

I found my issue described here, more or less exactly:

https://docs.yoctoproject.org/ref-manual/variables.html#term-SYSROOT_DIRS_IGNORE

For me it turns out to need in recipe of lib:
SYSROOT_DIRS:append = " /opt/lib"

and in recipe of app, using that lib:
TARGET_LDFLAGS:append = " -L${RECIPE_SYSROOT}/opt/lib"

But that's not helping. Looking at bitbake <recipe_app> -e I can't see why linker does not find it. As mentioned ${WORKDIR}/recipe-sysroot/opt/lib is populated for the app. A bug? Usually I am just miss something, but I don't have a clue how to debug.

Best regards,
Steve

Quoted 60 lines

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

(quoted diff) +0 -3
-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

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#13208): https://lists.yoctoproject.org/g/poky/message/13208
Mute This Topic: https://lists.yoctoproject.org/mt/102707949/3618575
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

avahi configuration (without d-bus/X11)

Hello,
I need the avahi to announce my embedded device to network and give it an IP if DCHP is not working.
Over the normal "avahi-daemon.conf" I want to disable d-bus and ipv6. That is working by do_install:append changing that file.

But, adding to image the package "avahi-daemon" (avahi-autoipd is not a problem) bloats my rootfs with dbus-daemon and libs and libX11 libs. I don't have an screen attached.

So question: How to avoid that?

In my avahi_%.bbappend I added:

EXTRA_OECONF += " \
    --disable-dbus \
    --disable-gtk \
    --disable-gtk3 \
    --disable-libevent \
    --disable-qt5 \

"
But that doesn't seem to help.

I am using a sysV system with poky distro (Yocto 4.0)

Best regards,
Arno

#3 lore raw

Re: [poky] avahi configuration (without d-bus/X11)

Quoted 14 lines · Steve via lists.yoctoproject.org

Hello,
I need the avahi to announce my embedded device to network and give it an IP if DCHP is not working.
Over the normal "avahi-daemon.conf" I want to disable d-bus and ipv6. That is working by do_install:append changing that file.

But, adding to image the package "avahi-daemon" (avahi-autoipd is not a problem) bloats my rootfs with dbus-daemon and libs and libX11 libs. I don't have an screen attached.

So question: How to avoid that?

In my avahi_%.bbappend I added:

Quoted 8 lines
EXTRA_OECONF += " \
   --disable-dbus \
   --disable-gtk \
   --disable-gtk3 \
   --disable-libevent \
   --disable-qt5 \

"
But that doesn't seem to help.

Have a look at the recipe, specifically the PACKAGECONFIG options. You want to disable the dbus and gtk3 options. Note that if you have a headless device so don’t need X11 at all, then remove x11 from DISTRO_FEATURES and that will never be built.

Ross

author
#4 lore raw

Re: [poky] avahi configuration (without d-bus/X11)

Quoted 24 lines · Ross Burton via lists.yoctoproject.org
Quoted 14 lines · Steve via lists.yoctoproject.org

Hello,
I need the avahi to announce my embedded device to network and give it an IP if DCHP is not working.
Over the normal "avahi-daemon.conf" I want to disable d-bus and ipv6. That is working by do_install:append changing that file.

But, adding to image the package "avahi-daemon" (avahi-autoipd is not a problem) bloats my rootfs with dbus-daemon and libs and libX11 libs. I don't have an screen attached.

So question: How to avoid that?

In my avahi_%.bbappend I added:

Quoted 8 lines
EXTRA_OECONF += " \
    --disable-dbus \
    --disable-gtk \
    --disable-gtk3 \
    --disable-libevent \
    --disable-qt5 \

"
But that doesn't seem to help.

Quoted 3 lines

Have a look at the recipe, specifically the PACKAGECONFIG options. You want to disable the dbus and gtk3 options. Note that if you have a headless device so don’t need X11 at all, then remove x11 from DISTRO_FEATURES and that will never be built.

Ross

Well Ross, you made my day ... again! Thanks.
Yes, as above mentioned I already disabled dbus and gtk3. But it seems I have to write also PACKAGECONFIG[dbus] = "--disable-dbus, --disable-dbus,dbus"
Frankly speaking I don't understand why this is to be configured twice and why PACKAGECONFIG overrule that, but that helps to get rid of both d-bus and libX11.

#5 lore raw

Re: [poky] avahi configuration (without d-bus/X11)

Quoted 31 lines · Steve via lists.yoctoproject.org
Quoted 1 line · Ross Burton via lists.yoctoproject.org

On 2 May 2024, at 13:00, Steve via lists.yoctoproject.org <star=

Quoted 23 lines · [email protected]> wrote:
Quoted 14 lines

Hello,
I need the avahi to announce my embedded device to network and give it an IP if DCHP is not working.
Over the normal "avahi-daemon.conf" I want to disable d-bus and ipv6. That is working by do_install:append changing that file.

But, adding to image the package "avahi-daemon" (avahi-autoipd is not a problem) bloats my rootfs with dbus-daemon and libs and libX11 libs. I don't have an screen attached.

So question: How to avoid that?

In my avahi_%.bbappend I added:

Quoted 8 lines
EXTRA_OECONF += " \
    --disable-dbus \
    --disable-gtk \
    --disable-gtk3 \
    --disable-libevent \
    --disable-qt5 \

"
But that doesn't seem to help.

Quoted 1 line

Have a look at the recipe, specifically the PACKAGECONFIG options. You

want to disable the dbus and gtk3 options. Note that if you have a headless device so don’t need X11 at all, then remove x11 from DISTRO_FEATURES and that will never be built.

Quoted 1 line
Quoted 7 lines
Quoted 1 line

Ross

Well Ross, you made my day ... again! Thanks.
Yes, as above mentioned I already disabled dbus and gtk3. But it seems I have to write also PACKAGECONFIG[dbus] = "--disable-dbus, --disable-dbus,dbus"

That is not what you needed to change. What you need to change is the "weak" default value of the PACKACONFIG ??= "dbus ..."
So just setting PACKAGECONFIG = ""

https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGECONFIG
https://git.yoctoproject.org/poky/tree/meta/recipes-connectivity/avahi/avahi_0.8.bb#n50

Quoted 15 lines

Frankly speaking I don't understand why this is to be configured twice and why PACKAGECONFIG overrule that, but that helps to get rid of both d-bus and libX11.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#13338):
https://lists.yoctoproject.org/g/poky/message/13338
Mute This Topic: https://lists.yoctoproject.org/mt/105861001/924729
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#6 lore raw

Re: [poky] avahi configuration (without d-bus/X11)

Quoted 51 lines · Tim Orling via lists.yoctoproject.org

On Thu, May 2, 2024 at 7:18 AM Steve via lists.yoctoproject.org
<http://lists.yoctoproject.org> <[email protected] <mailto:[email protected]>> wrote:

On 5/2/24 14:54, Ross Burton via lists.yoctoproject.org
<http://lists.yoctoproject.org> wrote:
> On 2 May 2024, at 13:00, Steve via lists.yoctoproject.org
<http://lists.yoctoproject.org> <[email protected] <mailto:[email protected]>> wrote:
>>
>> Hello,
>> I need the avahi to announce my embedded device to network and
give it
>> an IP if DCHP is not working.
>> Over the normal "avahi-daemon.conf" I want to disable d-bus and
ipv6.
>> That is working by do_install:append changing that file. >>
>> But, adding to image the package "avahi-daemon" (avahi-autoipd
is not a
>> problem) bloats my rootfs with dbus-daemon and libs and  libX11
libs. I
>> don't have an screen attached.
>>
>> So question: How to avoid that?
>>
>> In my avahi_%.bbappend I added:
>> EXTRA_OECONF += " \
>>     --disable-dbus \
>>     --disable-gtk \
>>     --disable-gtk3 \
>>     --disable-libevent \
>>     --disable-qt5 \
>> "
>> But that doesn't seem to help.
>
> Have a look at the recipe, specifically the PACKAGECONFIG
options.  You want to disable the dbus and gtk3 options.  Note that if you have a headless device so don’t need X11 at all, then remove x11 from DISTRO_FEATURES and that will never be built.
>
> Ross

Well Ross, you made my day ... again! Thanks.
Yes, as above mentioned I already disabled dbus and gtk3. But it seems I have to write also PACKAGECONFIG[dbus] = "--disable-dbus, --disable-dbus,dbus"

Quoted 7 lines

That is not what you needed to change. What you need to change is the "weak" default value of the PACKACONFIG ??= "dbus ..."
So just setting PACKAGECONFIG = ""

https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGECONFIG <https://docs.yoctoproject.org/ref-manual/variables.html#term-PACKAGECONFIG>
https://git.yoctoproject.org/poky/tree/meta/recipes-connectivity/avahi/avahi_0.8.bb#n50 <https://git.yoctoproject.org/poky/tree/meta/recipes-connectivity/avahi/avahi_0.8.bb#n50>

Thanks Tim, you are right!
That is even better.