Force linking of application-specific components

apuder
Posts: 53
Joined: Mon Mar 26, 2018 7:27 pm

Force linking of application-specific components

Postby apuder » Mon Feb 18, 2019 4:45 am

Hi,

I have an application-specific component that is not referenced from anywhere else. Because of that the linker is not including the module. While this behavior is OK for the vast library of ESP-specific components, it causes issues for my app. Of course I can add an artificial dependency to that application-specific component but I wonder if there are any flags/parameters where I can tell the linker to always include my components.

Thanks,
AP

apuder
Posts: 53
Joined: Mon Mar 26, 2018 7:27 pm

Re: Force linking of application-specific components

Postby apuder » Tue Feb 19, 2019 5:46 am

answering my own question: in component.mk, add:

Code: Select all

COMPONENT_ADD_LDFLAGS=-Wl,--whole-archive build/$(COMPONENT_NAME)/lib$(COMPONENT_NAME).a -Wl,--no-whole-archive

Who is online

Users browsing this forum: No registered users and 177 guests