How to customize the linker input object order in generated makefile

1 次查看(过去 30 天)
I'm trying to customize the order of libraries that get linked together in a final build output, but can't seem to find any hook to do that.
I've created a Custom Toolchain, but can't find any hooks to alter the "LD" command. There does not appear to be any documentation on the "commandParameter" argument, in terms to what macros ('|>TOOL<| |>TOOL_OPTIONS<| |>OUTPUT_FLAG<||>OUTPUT<|') are possible for each tool and how to control what gets put in place of these. Also does anyone have a clue on how to influence what the contents of some of the makefile macros that get generated such as (PREBUILT_OBJS and SYSTEM_LIBS, I think that one may come from the Library configuration settings)?
Here is what I am getting for an output of the linker step:
$(LD) $(LDFLAGS) -o $(PRODUCT) $(OBJS) $(MODELREF_LIBS) $(LIBS) $(SYSTEM_LIBS) $(TOOLCHAIN_LIBS)
What I need is:
$(LD) $(LDFLAGS) -o $(PRODUCT) $(ALL_OBJS) $(MODELREF_LIBS) --start-group $(TOOLCHAIN_LIBS) --end-group $(LIBS) $(SYSTEM_LIBS)
The reason for my need is due to the fact the some of the $TOOLCHAIN_LIBS object reference objects in $(LIBS). Yes there is some unavoidable circular referencing going on in this build.
Any ideas will be appreciated.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by