Thank you Ross,
Compilation issues are gone...Only one DEPENDS appeared to be enough :-). Thank 
you again
But can give me a hand to the following because now I have QA issues during my 
"corrupted" makefile. Is there any way to pass this --sysroot=/<full 
path>/recipe-sysroot before -L/usr/lib. Eg somehow the whole path to be like 
-L/<full path>/recipe-sysroot/usr/lib in my makefile. gcc actually follows 
--sysroot  and /usr/include is to target sysroot...but one annoying warning 
appear and now this is my last issue.
cc1: warning: include location "/usr/include" is unsafe for cross-compilation 
[-Wpoison-system-directories]
QA stage (do_package_qa) does not pass. 
Here is my "corrupted" makefile:

# we will use env from poky CC := arm-linux-gnueabihf-gcc
CFLAGS := -g -Wall -fpic
RM = rm -f $(DEPDIR)/*.d $(OBJDIR)/*.o *~ $(OUTPUT)
DEPDIR := dep
OBJDIR := obj
OUTPUT := libanybus-m40.so.0.0.1

LOCAL_SRC_DIRS := .
LOCAL_SRC_DIRS += abcc_adapt
LOCAL_SRC_DIRS += abcc_drv/src
LOCAL_SRC_DIRS += abcc_drv/src/par
LOCAL_SRC_DIRS += abcc_drv/src/par30
LOCAL_SRC_DIRS += abcc_drv/src/serial
LOCAL_SRC_DIRS += abcc_drv/src/spi

LOCAL_INC_DIRS := .
LOCAL_INC_DIRS += abcc_abp
LOCAL_INC_DIRS += abcc_adapt
LOCAL_INC_DIRS += abcc_drv/inc
LOCAL_INC_DIRS += abcc_drv/src
LOCAL_INC_DIRS += abcc_drv/src/par
LOCAL_INC_DIRS += abcc_drv/src/par30
LOCAL_INC_DIRS += abcc_drv/src/serial
LOCAL_INC_DIRS += abcc_drv/src/spi
LOCAL_INC_DIRS += /usr/include

SRC := $(foreach sdir,$(LOCAL_SRC_DIRS),$(wildcard $(sdir)/*.c))
INC := $(foreach idir,$(LOCAL_INC_DIRS),-I$(idir))
LIB := -L/usr/lib
LDFLAGS := -lgpiod -shared -fPIC -Wl,-soname,libanybus-m40.so.0
OBJ := $(addprefix $(OBJDIR)/,$(notdir $(SRC:.c=.o)))
DEP := $(addprefix $(DEPDIR)/,$(notdir $(OBJ:.o=.d)))

VPATH = $(LOCAL_SRC_DIRS)

ifneq "$(findstring clean,$(MAKECMDGOALS))" "clean"
-include $(DEP)
endif

.PHONY: all clean dirtree
.DEFAULT_GOAL := all

all: $(OUTPUT)

$(OUTPUT): $(OBJ)
        $(CC) $(LDFLAGS) -o $@ $(LIB) $^

$(DEPDIR)/%.d: %.c
        $(CC) $(LIB) -MM -MF $@ -MP -MT "$(OBJDIR)/$*.o $@" $(CFLAGS) $(INC) $< 


$(OBJDIR)/%.o: %.c
        $(CC) $(LIB) $(CFLAGS) $(INC) -c -o $@ $< 

$(OBJ) $(DEP): | dirtree

dirtree:
        mkdir -p $(DEPDIR) $(OBJDIR)

clean:
        $(RM)

Cordially,
Georgi
-----Original Message-----
From: Burton, Ross [mailto:ross.bur...@intel.com] 
Sent: Tuesday, December 04, 2018 12:16 PM
To: Georgi Georgiev <georgi.georg...@woodward.com>
Cc: Yocto-mailing-list <yocto@yoctoproject.org>
Subject: [EXTERNAL] Re: [yocto] Missing dependencies in recipe-sysroot

We've already gone through this on SO but I'll copy/paste here.

On Tue, 4 Dec 2018 at 08:30, Georgi Georgiev <georgi.georg...@woodward.com> 
wrote:
> #####The only dependency
>
> RDEPENDS_${PN} = "libgpiod"
>
> RDEPENDS_${PN}-dev = "libgpiod"
>
> RDEPENDS_${PN}-dbg = "libgpiod"

DEPENDS = "libgpiod".  RDEPENDS will build libgpiod at some point, but it won't 
be in the sysroot for compilation.  Before recipe-specific-sysroots this would 
mean it *might* be present, now it reliably won't.

> Then I noticed that the command line is:
>
> arm-poky-linux-gnueabi-gcc  -march=armv7-a -mfpu=neon -mfloat-abi=hard 
> -mcpu=cortex-a9 --sysroot=/<full path>/recipe-sysroot -L/usr/lib -g -Wall 
> -fpic .....

The problem is the -L/usr/lib, which presumably should be where libgpiod is.  
The makefile is broken, or possibly some tooling that the makefile is calling.  
As you haven't shared the makefile we can't help further.

Ross
-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to