1
0
Florian Fleissner e5b97afa48 Fix link order problems with inter-library/inter-plugin dependencies
Before this change, when Arduino was linking the elf binary, it added all
objects and archives (libraries/plugins) to a long linker command line.
This would sometimes cause issues due to the linker's gargabe collection feature.
When one library A referenced a symbol from a library B but library A appeared after B
in the linker command line, the referenced symbol was in some cases garbage
collected as to the linker it appeared to be unreferenced.

To understand this better it is important to know that the linker processes
objects and archives one by one in the order of their appearance at the command
line. For every object or archive encountered it runs garbage collection individually.
That's why symbols might get discarded although an object or archives that is
encountered later on while processing the linker command line might have referenced it.

To fix this problem this commit divides up the linker process into two steps.

First, all objects and archives are combined in a large .a archive. Then, this
archive is passed to the original linker command line, thereby replacing the
original set of objects and archives.

The final link now sees all symbols together. Thus, it is able to determine the true
interdependencies and do a proper garbage collection without accidentally
generating unresolved symbols.

With this fix, the order of appearance of include directives in the sketch file that formerly had an
influence on the link order (as Arduino passes library archives to the linker in
the order of the appearance of the matching includes in the sketch),
can now be savely chosen arbitrarily.

To erase the joined archive file that is generated from all objects and
archives, we have to use different solutions on Linux/macOS and Windows. This is
done via defining tools.rm.cmd differently for those platforms.

Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
2019-05-29 17:18:18 +02:00
2019-03-03 22:44:42 -08:00

Arduino Core for the Keyboardio Model 01

This repository contains a number of git submodules.

As an end-user, you can recursively check out all the referenced modules:

% make checkout-submodules

As a maintainer, you can pull all the referenced modules to the latest upstream tips of the modules' canonical branches:

% make maintainer-update-submodules

Do note that in order to commit the changes to the submodules of a given repository, you'll need to commit and push the changes in that repository

To add a submodule, use a commandline like this:

% git submodule add https://github.com/Keyboardio/Kaleidoscope-Plugin/ libraries/Kaleidoscope-Plugin
Description
No description provided
Readme 240 KiB
Languages
C 57.2%
C++ 41.6%
Makefile 1.2%