Adding specific library build on the fly with RT-Druid

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
Phil0031
Newbie
Posts: 3
Joined: Mon Feb 12, 2018 2:33 pm

Adding specific library build on the fly with RT-Druid

Post by Phil0031 » Tue Feb 20, 2018 7:14 pm

Hi
I am trying to implement a specific library built on the fly with the link, but I do no see effect in the make file.
What I did :
I did the following change c

In file conf.oil I added
EE_OPT = "__ADD_LIBS__";
LIB = ENABLE { NAME = "mylib"; };

In hiearchy ee_files/contrib I created a folder mylib with cfg, inc (includes files), src (sources files)
with in cfg.mk file
ifeq ($(call islibopt, __LIB_MYLIB__), yes)
ifeq ($(call iseeopt, __TC27xxMYLIB__), yes)
INCLUDE_PATH += $(EEBASE)/contrib/mylib/inc
endif # __TC27xxMYLIB__
endif # __LIB_MYLIB__
with in libcfg.mk file
ifeq ($(call iseeopt, __TC27xxMYLIB__), yes)
ifeq ($(findstring __LIB_MYLIB__,$(LIB_OPT)) , __LIB_MYLIB__)
INCLUDE_MYLIB = YES
endif
ifeq ($(call iseeopt, __BUILD_ALL_LIBS__), yes)
INCLUDE_MYLIB = YES
endif
ifeq ($(INCLUDE_MYLIB), YES)
INCLUDE_PATH += $(EEBASE)/contrib/mylib/inc
## Add each file individually
EE_SRCS_MYLIB += contrib/mylib/src/src0.c
## Make list of object files and add it to libraries global list
EE_OBJS_MYLIB := $(addprefix $(OBJDIR)/, $(patsubst %.c,%.o,$(patsubst %.s,%.o,$(EE_SRCS_MYLIB))))
LIBSRCS += $(EE_SRCS_MYLIB)
MYLIBLIB := libmylib.a
$(MYLIBLIB): $(EE_OBJS_MYLIB)
@echo "AR $(MYLIBLIB)";
$(QUIET)$(EE_AR) $(COMPUTED_OPT_AR) $@ $^
OPT_LIBS += $(MYLIBLIB)
ALL_LIBS += $(MYLIBLIB)
endif # INCLUDE_MYLIB
endif # __TC27xxMYLIB__

And in make file added
LIB_OPT += __LIB_MYLIB__

But in the make execution I do see libee.a for ERIKA, but not the build of my library.
Do I missed something is respective declaration, I didn't find a clear description in the wiki for this purpose.

Thanks for your help.
Phil

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: Adding specific library build on the fly with RT-Druid

Post by e.guidieri » Fri Feb 23, 2018 11:09 am

Hi Phil,

good job, you almost got everyrthing right in an not easy task.

Try to add:

LIBDEP += $(MYLIBLIB)

This should do the trick.

Regards,
Errico

paolo.gai
Administrator
Posts: 864
Joined: Thu Dec 07, 2006 12:11 pm

Re: Adding specific library build on the fly with RT-Druid

Post by paolo.gai » Fri Feb 23, 2018 11:48 am

Once you get it done, it would be nice if you could update or write a new wiki page on the topic :-)

Thanks!

PJ

Phil0031
Newbie
Posts: 3
Joined: Mon Feb 12, 2018 2:33 pm

Re: Adding specific library build on the fly with RT-Druid

Post by Phil0031 » Mon Feb 26, 2018 5:45 pm

Hi Paolo

I did the change in libcfg.mk to add LIBDEP += $(MYLIBLIB), but there is no effect no compiling of mylib library
I tested also the change in the make, cfg but not in the OIL as syntax is not support.
I seems that contrib/mylib/cfg is not visible ! in my oil the configuration is defined for MCU_DATA = TRICORE { MODEL = TC27xC;/

Phil0031
Newbie
Posts: 3
Joined: Mon Feb 12, 2018 2:33 pm

Re: Adding specific library build on the fly with RT-Druid

Post by Phil0031 » Wed Mar 07, 2018 3:27 pm

Hi again

I even applies the patch from Matthias - Some patches for ERIKA v2.8 - but no success
1. MIssing $(LIBS) ./RT-Druid/plugins/com.eu.evidence.ee_2.8.0.20171025_0922/ee_files/pkg/cfg/arch/rules_infineon_tc_generic.mk and added $(QUIET)$(EE_LINK) $(OPT_LINK) $(TARGET_LD_FILE) $(OBJS) $(LIBDEP) $(LINK_REDIRECT) $(LIBS)

MatzeB.
Newbie
Posts: 14
Joined: Fri Jul 08, 2016 11:19 am
Contact:

Re: Adding specific library build on the fly with RT-Druid

Post by MatzeB. » Thu Mar 15, 2018 1:57 pm

Hi Phil,
I think that my patch isn't related to your problem. The reason for my patch was, that the linker for an AURIX/Tricore ignored the user defined libs from the oil file. But this is/was the case for already compiled libs. If your build doesn't generate a libmylib.a then there must be something wrong before the final linker call.

Regards
Matthias

Post Reply