Skip to content

Commit a7252c8

Browse files
committed
workaround for arduino-builder core cache
syscalls symbols are not found if the object file is not specified directly using the pre-built core.a archive does not work cached core build prevents the object file to be rebuilt workaround is to move syscalls source to variant directory, since variant files are not cached and gets rebuilt each time
1 parent 06f5eea commit a7252c8

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

Diff for: sam/1.0.5/platform.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ compiler.elf2hex.cmd=arm-none-eabi-objcopy
3737
compiler.ldflags=
3838
compiler.size.cmd=arm-none-eabi-size
3939
compiler.define=-DARDUINO=
40-
compiler.combine.flags="{build.path}/core/syscalls_sam3.c.o"
41-
#the following adds around 7KB to final binary
42-
#compiler.combine.flags=-u _sbrk -u link -u _close -u _fstat -u _isatty -u _lseek -u _read -u _write -u _exit -u kill -u _getpid
40+
4341

4442
# This can be overridden in boards.txt
4543
build.extra_flags=
@@ -82,7 +80,7 @@ archive_file_path={build.path}/{archive_file}
8280
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
8381

8482
## Combine gc-sections, archives, and objects
85-
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group {compiler.combine.flags} {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
83+
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -mcpu={build.mcu} -mthumb {compiler.c.elf.flags} "-T{build.variant.path}/{build.ldscript}" "-Wl,-Map,{build.path}/{build.project_name}.map" {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" "-L{build.path}" -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--entry=Reset_Handler -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--start-group {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc
8684

8785
## Create output (.bin file)
8886
recipe.objcopy.bin.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

0 commit comments

Comments
 (0)