mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-18 12:54:25 +01:00
Don't include .o files from the variant in core.a
If a variant supplied source files, these would be included in core.a before. However, object files from core.a would only actually be included in the build if they supplied a symbol for a strong reference that was still missing. In practice, this meant that a variant source file that only defines interrupt handlers, or only defines strong versions of functions that already had weak versions available, was not included. By moving the variant .o files out of core.a and including them in the build directly, this problem is solved. Furthermore, the compilation of variant files is moved to after the generation of core.a, to make it clearer in the code and verbose output what is now happening.
This commit is contained in:
parent
7d71b84ae2
commit
4eb686673f
@ -690,6 +690,8 @@ public class Compiler implements MessageConsumer {
|
||||
|
||||
// 3. compile the core, outputting .o files to <buildPath> and then
|
||||
// collecting them into the core.a library file.
|
||||
// Also compiles the variant (if it supplies actual source files),
|
||||
// which are included in the link directly (not through core.a)
|
||||
void compileCore()
|
||||
throws RunnerException {
|
||||
|
||||
@ -702,13 +704,9 @@ public class Compiler implements MessageConsumer {
|
||||
if (variantFolder != null)
|
||||
includeFolders.add(variantFolder);
|
||||
|
||||
List<File> objectFiles = compileFiles(buildFolder, coreFolder, true,
|
||||
includeFolders);
|
||||
if (variantFolder != null)
|
||||
objectFiles.addAll(compileFiles(buildFolder, variantFolder, true,
|
||||
includeFolders));
|
||||
|
||||
for (File file : objectFiles) {
|
||||
List<File> coreObjectFiles = compileFiles(buildFolder, coreFolder, true,
|
||||
includeFolders);
|
||||
for (File file : coreObjectFiles) {
|
||||
|
||||
PreferencesMap dict = new PreferencesMap(prefs);
|
||||
dict.put("ide_version", "" + Base.REVISION);
|
||||
@ -724,6 +722,10 @@ public class Compiler implements MessageConsumer {
|
||||
}
|
||||
execAsynchronously(cmdArray);
|
||||
}
|
||||
|
||||
if (variantFolder != null)
|
||||
objectFiles.addAll(compileFiles(buildFolder, variantFolder, true,
|
||||
includeFolders));
|
||||
}
|
||||
|
||||
// 4. link it all together into the .elf file
|
||||
|
Loading…
x
Reference in New Issue
Block a user