Makefile.base: cleanup non selected source object files#16945
Conversation
|
I tested that this fixes the issue for me. |
|
I was trying to see if there was another way of doing this where instead of cleaning unused object files we would specify the want to use, but this information is AFAIK not easy to obtain when we are linking. Nonetheless, I'm under the impression that with this change building |
What about now? |
Still seem to increase in about 13%, but well I guess there is bound to be an increase... |
As discussed offline, I now avoid calling |
|
Please squash @leandrolanzieri! |
|
@leandrolanzieri please trigger the ci after squashing! |
92130d8 to
5bcd138
Compare
|
LGTM to me as well, quite elegant actually! |
|
Looks good; I didn't test, but it ticks all other boxes. |
|
please squash! |
0009c32 to
452333c
Compare
|
Release managers since #14754 was merged (@bergzand @jia200x @kaspar030 @MrKevinWeiss): how far do you think this should be backported? |
IMO it should only be backported to the last release. We usually don't provide LTS |
yup, or maybe not even that. this basically fixes an inconvenience. it is also non-intrusive, so merging it before the next RC wouldn't hurt. |
|
I guess that is me then 🦸 |
|
does this work for non pseudo modules? i see - it does not need to delete object of not used modules since they are just not added to the obj list |
Nonpseudomodules are ignored from linking in another stage here: Lines 669 to 674 in e804a73 MODULES that are not selected would not be in BASELIBS, the issues is that we here linking everything under MODULE/ with the wildcard, see: Lines 11 to 14 in e804a73 And conditional SRC selection is always based on PSEUDOMODULES or SUBMODULES (which are the same), or in some cases on |
|
Thanks for reviewing ! |
|
Backport provided in #16953 |
|
Were we backporting to the 07 release too or just the 10? |
Contribution description
As explained in #16942, since #14754 we select all object files when linking, which is a problem when the selection of module sources change between two builds. This adds a cleanup for non selected source object files on modules.
Testing procedure
A minimal example that shows the current issue:
Compile once with
USEMODULE += external_module_implementation_aand once withUSEMODULE += external_module_implementation_b,message_implementationwill have two implementations at link time on master. With this PR this should be fixed.Issues/PRs references
#16942
Issue introduced by #14754