Makefile.base: fix AR keeping removed source files objects#7952
Makefile.base: fix AR keeping removed source files objects#7952kYc0o merged 2 commits intoRIOT-OS:masterfrom
Conversation
|
I enable murdock to show the broken output and see if other fixes than #7951 could be necessary. |
e830f10 to
688a90c
Compare
688a90c to
5fea2ae
Compare
|
It also requires fix for mips cpus to work #8019 |
80057d9 to
3a71827
Compare
3a71827 to
e56ca23
Compare
e56ca23 to
cf1f032
Compare
f3e4e8e to
c729d32
Compare
|
Is this still waiting for other PR? |
c729d32 to
710f4d2
Compare
|
It should not be anymore. I will add another PR to add a note in the http://doc.riot-os.org/creating-modules.html page to mention that MODULE names should be unique because with this it will be explicitly enforced. |
I'd say put it here, it's the right context and more easy to find if everything is here. |
|
I added some lines in the section talking about the MODULE name. |
doc/doxygen/src/creating-modules.md
Outdated
| ### Pitfalls ### | ||
|
|
||
| The `MODULE` name should be uniq or build will break as modules overwrite | ||
| the same output file. |
There was a problem hiding this comment.
I suggest to change this to "unique" or build breaks.
doc/doxygen/src/creating-modules.md
Outdated
| * Packages root directory (libfixmath/u8g2) | ||
| * boards/cpu/periph and their common boards/cpu/periph | ||
|
|
||
| Note: even if all boards and cpus implement the `board` and `cpu` modules only |
There was a problem hiding this comment.
I suggest to rephrase: "... modules, only ..."
kYc0o
left a comment
There was a problem hiding this comment.
Looks ok but I have some doubts...
| $(Q)$(AR) $(ARFLAGS) $@ $? | ||
| @# Recreate archive to cleanup deleted/non selected source files objects | ||
| $(Q)$(RM) $@ | ||
| $(Q)$(AR) $(ARFLAGS) $@ $^ |
There was a problem hiding this comment.
Are we sure we want to remove it ALWAYS, and not only under certain conditions?
There was a problem hiding this comment.
Yes always, because we want to re-create a new archive. If not, old files are kept as ar is incremental.
There was a problem hiding this comment.
When doing gcc -o out.o it overwrites the previous object with the new one, and that is what we expect.
The RM here, is implementing an --overwrite option that ar does not have.
|
Updated the doc as you suggested. |
a1958fb to
03ea7ba
Compare
|
I re-worded the commit messages to fix "unique" too. |
|
@kYc0o Do you like the changes ? And so can I rebase. |
|
Yep, let's go ahead. |
|
Murdock, complains though. Can you check? |
|
I think it's on the |
AR incrementally adds file without removing files. If a c file is deleted or disabled(submodule removal) it is not removed from archive and still ends up in the final elf file. This fix removes the need to do 'make clean' for this case. However it will break cases where an APPLICATION and a MODULE or two modules have the same name and only worked because source files names where different.
Modules produce an output archive called `${MODULE}.a` if several modules use
the same name, the output is overwritten.
03ea7ba to
e5d234e
Compare
AR incrementally adds file without removing files.
If a c file is deleted or disabled(submodule removal) it is not removed from
archive and still ends up in the final elf file.
This fix removes the need to do 'make clean' for this case.
However it will break cases where an APPLICATION and a MODULE or two modules
have the same name and only worked because source files names where different.
This requires:
#7951to not break compilation. I only tested native and samr21-xpro right now.Edit: This also requires
#8019, I added a fix that will be proposed as a separate PR. The only important file change for this PR isMakefile.base.