All of lore.kernel.org
 help / color / mirror / Atom feed
* sd-bus.h not found even with DEPENDS += "systemd"
@ 2020-09-26 18:32 Bel Hadj Salem Talel
  2020-09-26 19:58 ` Bel Hadj Salem Talel
  0 siblings, 1 reply; 14+ messages in thread
From: Bel Hadj Salem Talel @ 2020-09-26 18:32 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1323 bytes --]

Hi Community,

I'm trying to make a recipe for source files with a Makefile , files are under : https://github.com/wirepas/gateway/tree/master/sink_service

I can't add the recipe directly from the URL, so I cloned the repo and zipped only the sink_service file.

When I added the zip file with devtool it added DEPEND = "systemd" in the recipe file. But when compiling :

> 
> fatal error: systemd/sd-bus.h: No such file or directory

The Makefile just needs "make" and it worked on my native host. Here is the recipe:
LICENSE = " Unknown "
LIC_FILES_CHKSUM = " file://c-mesh-api/LICENSE;md5=b8b4f77337154d1f64ebe68dcd93fab6 "
SRC_URI = " file:///media/talel/data/multigate/multigate/meta-wirepas/recipes-wirepas/wirepas-sink-tool/files/sink_service.zip "
DEPENDS = " systemd "
do_configure () {
# Specify any needed configure commands here
:
}

do_compile () {
# You will almost certainly need to add additional arguments here
oe_runmake
}

do_install () {
# NOTE: unable to determine what to put here - there is a Makefile but no
# target named "install", so you will need to define this yourself
:
}

The only problem is in do_compile , I need to fix it and then I can manage the install part.
How can I specify the libsystemd in BUILD time , do I need EXTRA_OEMAKE ?

Thanks, Talel

[-- Attachment #2: Type: text/html, Size: 5482 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: sd-bus.h not found even with DEPENDS += "systemd"
  2020-09-26 18:32 sd-bus.h not found even with DEPENDS += "systemd" Bel Hadj Salem Talel
@ 2020-09-26 19:58 ` Bel Hadj Salem Talel
  2020-09-27 12:42   ` Bel Hadj Salem Talel
  0 siblings, 1 reply; 14+ messages in thread
From: Bel Hadj Salem Talel @ 2020-09-26 19:58 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 3558 bytes --]

HI Again,

The systemd issue is solved by installing the libsystemd in my native host, but I got another problem linking the lib with "ld" :

| /media/talel/data/menzu-zeus/menzu/tmp/work/aarch64-poky-linux/wirepas-sink-tool/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/ld: c-mesh-api/lib/build/mesh_api_lib.a(logger.o): Relocations in generic ELF (EM: 62)
| /media/talel/data/menzu-zeus/menzu/tmp/work/aarch64-poky-linux/wirepas-sink-tool/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/ld: c-mesh-api/lib/build/mesh_api_lib.a(logger.o): Relocations in generic ELF (EM: 62)
| /media/talel/data/menzu-zeus/menzu/tmp/work/aarch64-poky-linux/wirepas-sink-tool/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/ld: c-mesh-api/lib/build/mesh_api_lib.a: error adding symbols: file in wrong format
| collect2: error: ld returned 1 exit status
| makefile:102: recipe for target 'build/sinkService' failed

Here is the Makefile:

---------------------------

# Makefile for Wirepas Dbus Sink module

# Toolchain
CC  ?= gcc
AS  ?= as
LD  ?= ld
AR  ?= ar

# Paths, including trailing path separator
SOURCEPREFIX   := source/
BUILDPREFIX    := build/

# This example needs the mesh lib
MESH_LIB_FOLDER := c-mesh-api/lib/
MESH_LIB := $(MESH_LIB_FOLDER)build/mesh_api_lib.a

# General compiler flags
CFLAGS  := -std=gnu99 -Wall -Werror -O

# Targets definition
MAIN_APP := sinkService

TARGET_APP := $(BUILDPREFIX)$(MAIN_APP)

# Add Api header (including logger files)
CFLAGS  += -I$(MESH_LIB_FOLDER)api
# Add pthtread lib as needed by Mesh Lib
LDFLAGS += -pthread
# Add Reentrant flag as using pthread
CFLAGS  += -D_REENTRANT

# Add systemd lib as needed for sd-bus
LDFLAGS += -lsystemd

# Add current directory for headers
CFLAGS  += -I$(SOURCEPREFIX)

# Specific sources for this application
SOURCES := $(SOURCEPREFIX)main.c
SOURCES += $(SOURCEPREFIX)config.c
SOURCES += $(SOURCEPREFIX)data.c
SOURCES += $(SOURCEPREFIX)otap.c

OBJECTS := $(patsubst $(SOURCEPREFIX)%,                     \
$(BUILDPREFIX)%,                          \
$(SOURCES:.c=.o))

# Functions

# Also create the target directory if it does not exist
define COMPILE
echo "  CC $(2)"
mkdir -p $(dir $(1))
$(CC) $(CFLAGS) -c -o $(1) $(2)
endef

define LINK
echo "  Linking $(1)"
$(CC) $(CFLAGS) -o $(1) $(2) $(MESH_LIB) $(LDFLAGS)
endef

define CLEAN
echo "  Cleaning up"
$(RM) -r $(BUILDPREFIX)
make -C $(MESH_LIB_FOLDER) clean
endef

# Target rules

# Use dependency files automatically generated by GCC.
# First collect all C source files
AUTODEPS := $(patsubst $(SOURCEPREFIX)%.c, $(BUILDPREFIX)%.d, $(SOURCES))

ifeq ($(V),1)
# "V=1" on command line, print commands.
else
# Default, do not print commands.
.SILENT:
endif

.PHONY: all
all: app

app: $(TARGET_APP)

.PHONY: clean
clean:
$(call CLEAN)

$(MESH_LIB_FOLDER):
$(error Please add the c-mesh-api library under c-mesh-api folder.\
It is needed to handle dualmcu protocol)

.PHONY: $(MESH_LIB)
$(MESH_LIB): $(MESH_LIB_FOLDER)
make -C $(MESH_LIB_FOLDER)

$(BUILDPREFIX)%.o: $(SOURCEPREFIX)%.c
$(call COMPILE,$@,$<)

$(BUILDPREFIX)$(MAIN_APP): $(OBJECTS) $(MESH_LIB)
$(call LINK,$@,$^)

---------------------------

What is wrong ?

Thanks ,Talel

[-- Attachment #2: Type: text/html, Size: 4799 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: sd-bus.h not found even with DEPENDS += "systemd"
  2020-09-26 19:58 ` Bel Hadj Salem Talel
@ 2020-09-27 12:42   ` Bel Hadj Salem Talel
  2020-09-28  7:41     ` [yocto] " Josef Holzmayr-Khosh Amoz
  0 siblings, 1 reply; 14+ messages in thread
From: Bel Hadj Salem Talel @ 2020-09-27 12:42 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

Hi,

A response came only to me :

> 
> Hey Bel,
> 
> Please remove the libsystemd from your host. It will cause host
> contamination.
> 
> You need to tell in your makefile where make can find include path and lib
> path
> 
> Normally it should work
> 
> Include: -I${STAging_incdir}
> -L for ld path
> 
> 
> Cheers
> 

So I added

EXTRA_OEMAKE += "-I ${STAGING_INCDIR}
to fix the systemd include error.

But I still get the error of :

/media/talel/data/menzu-zeus/menzu/tmp/work/aarch64-poky-linux/wirepas-sink-tool/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/ld: c-mesh-api/lib/build/mesh_api_lib.a: error adding symbols: file in wrong format

I don't know what is the problem.
Help me on this please.

Thanks for your support.

[-- Attachment #2: Type: text/html, Size: 2018 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2020-09-27 12:42   ` Bel Hadj Salem Talel
@ 2020-09-28  7:41     ` Josef Holzmayr-Khosh Amoz
  2023-12-19  6:27       ` ashujoshi35
  0 siblings, 1 reply; 14+ messages in thread
From: Josef Holzmayr-Khosh Amoz @ 2020-09-28  7:41 UTC (permalink / raw)
  To: Bel Hadj Salem Talel; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1360 bytes --]

Without digging into the details, it sounds very very much like the most of
your problems are caused by handcrafting a Makefile which is not cross
compile aware and probably has multiple other issues. Therefore I strongly
suggest to use a build system like autotools, cmake or meson. You can find
an introduction to a cmake-based setup here: https://youtu.be/NmPta5w6P70

Greetz

Am So., 27. Sept. 2020 um 14:42 Uhr schrieb Bel Hadj Salem Talel <
bhstalel@gmail.com>:

> Hi,
>
> A response came only to me :
>
> Hey Bel,
>
> Please remove the libsystemd from your host. It will cause host
> contamination.
>
> You need to tell in your makefile where make can find include path and lib
> path
>
> Normally it should work
>
> Include: -I${STAging_incdir}
> -L for ld path
>
>
> Cheers
>
> So I added
>
> EXTRA_OEMAKE += "-I${STAGING_INCDIR}
> to fix the systemd include error.
>
> But I still get the error of :
>
>  /media/talel/data/menzu-zeus/menzu/tmp/work/aarch64-poky-linux/wirepas-sink-tool/1.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/../../libexec/aarch64-poky-linux/gcc/aarch64-poky-linux/9.2.0/ld:
> c-mesh-api/lib/build/mesh_api_lib.a: error adding symbols: file in wrong
> format
>
> I don't know what is the problem.
> Help me on this please.
>
> Thanks for your support.
>
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 2547 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2020-09-28  7:41     ` [yocto] " Josef Holzmayr-Khosh Amoz
@ 2023-12-19  6:27       ` ashujoshi35
  2023-12-19 17:07         ` Khem Raj
  0 siblings, 1 reply; 14+ messages in thread
From: ashujoshi35 @ 2023-12-19  6:27 UTC (permalink / raw)
  To: Josef Holzmayr, yocto

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

Was this issue resolved? Even I am facing same issue and not able to figure out the solution on how to resolve sd-bus dependency

[-- Attachment #2: Type: text/html, Size: 130 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2023-12-19  6:27       ` ashujoshi35
@ 2023-12-19 17:07         ` Khem Raj
  2024-01-09 10:12           ` ashujoshi35
  0 siblings, 1 reply; 14+ messages in thread
From: Khem Raj @ 2023-12-19 17:07 UTC (permalink / raw)
  To: yocto, ashujoshi35; +Cc: Josef Holzmayr

On Tue, Dec 19, 2023 at 12:08 AM <ashujoshi35@gmail.com> wrote:
>
> Was this issue resolved? Even I am facing same issue and not able to figure out the solution on how to resolve sd-bus dependency

can you check if sd-bus.h is in the recipe sysroot ? and if yes whats
the path to it, is your package adding the needed path to CLFLAGS via
-I ?

> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#61978): https://lists.yoctoproject.org/g/yocto/message/61978
> Mute This Topic: https://lists.yoctoproject.org/mt/77141718/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2023-12-19 17:07         ` Khem Raj
@ 2024-01-09 10:12           ` ashujoshi35
  2024-01-09 15:33             ` Khem Raj
  0 siblings, 1 reply; 14+ messages in thread
From: ashujoshi35 @ 2024-01-09 10:12 UTC (permalink / raw)
  To: Khem Raj, yocto

[-- Attachment #1: Type: text/plain, Size: 673 bytes --]

I am able to build this now. But seems the binary that it is generating is for native and not for target. What do we need to specify in recipe file to make sure image is generated for target.
On running file sinkService, this is what I get in output.

however, my target needs below type of file.

My service when installed in target keeps on rebooting continuously with below message:

Though it says file not present, but i can see file present in the location. Somehow target is not able to read the file. It may be because of architecture difference which I have specified above. Can anyone suggest what exactly can be the issue and what am I doing wrong here?

[-- Attachment #2: Type: text/html, Size: 328033 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-09 10:12           ` ashujoshi35
@ 2024-01-09 15:33             ` Khem Raj
  2024-01-10 17:11               ` ashujoshi35
  0 siblings, 1 reply; 14+ messages in thread
From: Khem Raj @ 2024-01-09 15:33 UTC (permalink / raw)
  To: yocto, ashujoshi35


[-- Attachment #1.1: Type: text/plain, Size: 1471 bytes --]

It seems you are mixing multilib distro with non-multilib distro. Is your
distro including multilib.conf ?
maybe check

bitbake-getvar MULTILIBS

if it is empty then you are using non-multilib variant

On Tue, Jan 9, 2024 at 2:12 AM <ashujoshi35@gmail.com> wrote:

> I am able to build this now. But seems the binary that it is generating is
> for native and not for target. What do we need to specify in recipe file to
> make sure image is generated for target.
> On running file sinkService, this is what I get in output.
>
>
> however, my target needs below type of file.
>
>
> My service when installed in target keeps on rebooting continuously with
> below message:
>
>
> Though it says file not present, but i can see file present in the
> location. Somehow target is not able to read the file. It may be because of
> architecture difference which I have specified above. Can anyone suggest
> what exactly can be the issue and what am I doing wrong here?
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#62114):
> https://lists.yoctoproject.org/g/yocto/message/62114
> Unfollow This Topic: https://lists.yoctoproject.org/unft/77141718/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #1.2: Type: text/html, Size: 2505 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 131141 bytes --]

[-- Attachment #3: dummyfile.1.part --]
[-- Type: image/png, Size: 74778 bytes --]

[-- Attachment #4: dummyfile.2.part --]
[-- Type: image/png, Size: 39414 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-09 15:33             ` Khem Raj
@ 2024-01-10 17:11               ` ashujoshi35
  2024-01-10 19:39                 ` Khem Raj
  0 siblings, 1 reply; 14+ messages in thread
From: ashujoshi35 @ 2024-01-10 17:11 UTC (permalink / raw)
  To: Khem Raj, yocto

[-- Attachment #1: Type: text/plain, Size: 76 bytes --]

seems it is blank, I get below output on running bitbake-getvar MULTILIBS

[-- Attachment #2: Type: text/html, Size: 21453 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-10 17:11               ` ashujoshi35
@ 2024-01-10 19:39                 ` Khem Raj
  2024-01-11  8:44                   ` ashujoshi35
  0 siblings, 1 reply; 14+ messages in thread
From: Khem Raj @ 2024-01-10 19:39 UTC (permalink / raw)
  To: yocto, ashujoshi35


[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]

I do not understand when you have multilib disabled then how can a target
binary embed /lib64/ld-linux-x86_64.so.2  as desired dynamic linker. it
would be understood if multilib was enabled.

On Wed, Jan 10, 2024 at 9:11 AM <ashujoshi35@gmail.com> wrote:

> seems it is blank, I get below output on running bitbake-getvar MULTILIBS
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#62128):
> https://lists.yoctoproject.org/g/yocto/message/62128
> Unfollow This Topic: https://lists.yoctoproject.org/unft/77141718/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #1.2: Type: text/html, Size: 1613 bytes --]

[-- Attachment #2: dummyfile.0.part --]
[-- Type: image/png, Size: 15991 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-10 19:39                 ` Khem Raj
@ 2024-01-11  8:44                   ` ashujoshi35
  2024-01-11 12:17                     ` Ross Burton
  0 siblings, 1 reply; 14+ messages in thread
From: ashujoshi35 @ 2024-01-11  8:44 UTC (permalink / raw)
  To: Khem Raj, yocto

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

I tried to even override the linker using LDFLAGS but still linker embedded is /lib64/ld-linux-x86_64.so.2 only. Below is how i tried to explicitly set lib/ld-linux-x86-64.so.2

EXTRA_OEMAKE += "LD_LIBRARY_PATH=${COMPONENTS_DIR}/core2-64/glibc/lib/ld-linux-x86-64.so.2:${LD_LIBRARY_PATH}"
LDFLAGS += " -dynamic-linker ${COMPONENTS_DIR}/core2-64/glibc/lib/ld-linux-x86-64.so.2"

[-- Attachment #2: Type: text/html, Size: 431 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-11  8:44                   ` ashujoshi35
@ 2024-01-11 12:17                     ` Ross Burton
  2024-01-12  9:08                       ` ashujoshi35
  0 siblings, 1 reply; 14+ messages in thread
From: Ross Burton @ 2024-01-11 12:17 UTC (permalink / raw)
  To: yocto, ashujoshi35; +Cc: Khem Raj

On 11 Jan 2024, at 08:44, ashujoshi35 via lists.yoctoproject.org <ashujoshi35=gmail.com@lists.yoctoproject.org> wrote:
> 
> I tried to even override the linker using LDFLAGS but still linker embedded is /lib64/ld-linux-x86_64.so.2 only. Below is how i tried to explicitly set lib/ld-linux-x86-64.so.2
> 
> EXTRA_OEMAKE += "LD_LIBRARY_PATH=${COMPONENTS_DIR}/core2-64/glibc/lib/ld-linux-x86-64.so.2:${LD_LIBRARY_PATH}"
> LDFLAGS += " -dynamic-linker ${COMPONENTS_DIR}/core2-64/glibc/lib/ld-linux-x86-64.so.2”

What package are you building and can you share the recipe? It sounds like the makefiles are broken.

Ross


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-11 12:17                     ` Ross Burton
@ 2024-01-12  9:08                       ` ashujoshi35
  2024-01-12 10:46                         ` Ross Burton
  0 siblings, 1 reply; 14+ messages in thread
From: ashujoshi35 @ 2024-01-12  9:08 UTC (permalink / raw)
  To: Ross Burton, yocto

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

Sorry, will not be able to share entire recipe file but make file is open source, I am just trying to call it from recipe.
make file path : https://github.com/wirepas/gateway/tree/master/sink_service

Ideally it should not be broken. Issue seems to be more from point that somehow make file is not generating image for target, rather it is doing for host only. Seems it is failing to cross compile.

[-- Attachment #2: Type: text/html, Size: 531 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [yocto] sd-bus.h not found even with DEPENDS += "systemd"
  2024-01-12  9:08                       ` ashujoshi35
@ 2024-01-12 10:46                         ` Ross Burton
  0 siblings, 0 replies; 14+ messages in thread
From: Ross Burton @ 2024-01-12 10:46 UTC (permalink / raw)
  To: ashujoshi35; +Cc: yocto



> On 12 Jan 2024, at 09:08, ashujoshi35 via Lists.Yoctoproject.Org <ashujoshi35=gmail.com@lists.yoctoproject.org> wrote:
> 
> Sorry, will not be able to share entire recipe file but make file is open source, I am just trying to call it from recipe. 
> make file path : https://github.com/wirepas/gateway/tree/master/sink_service
> 
> Ideally it should not be broken. Issue seems to be more from point that somehow make file is not generating image for target, rather it is doing for host only. Seems it is failing to cross compile.

The makefiles are hand written and therefore it’s wise to assume that they’re broken by design: writing a proper makefile is harder than people think.

Check the compile log, it should be calling the cross compiler and passing —sysroot, if it’s just running “gcc” then your recipe needs to force the makefiles to do the right thing.

Ross

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-12 10:46 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-26 18:32 sd-bus.h not found even with DEPENDS += "systemd" Bel Hadj Salem Talel
2020-09-26 19:58 ` Bel Hadj Salem Talel
2020-09-27 12:42   ` Bel Hadj Salem Talel
2020-09-28  7:41     ` [yocto] " Josef Holzmayr-Khosh Amoz
2023-12-19  6:27       ` ashujoshi35
2023-12-19 17:07         ` Khem Raj
2024-01-09 10:12           ` ashujoshi35
2024-01-09 15:33             ` Khem Raj
2024-01-10 17:11               ` ashujoshi35
2024-01-10 19:39                 ` Khem Raj
2024-01-11  8:44                   ` ashujoshi35
2024-01-11 12:17                     ` Ross Burton
2024-01-12  9:08                       ` ashujoshi35
2024-01-12 10:46                         ` Ross Burton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.