Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error for arduino due and arduino 1.5.8 #13

Open
chrta opened this issue Feb 2, 2015 · 1 comment
Open

Linker error for arduino due and arduino 1.5.8 #13

chrta opened this issue Feb 2, 2015 · 1 comment

Comments

@chrta
Copy link

chrta commented Feb 2, 2015

Hello,

i am trying to use the Makefile in Linux (fedora 21). Compilation works fine, but linking fails:

Building "build/arduino_due_x_dbg/libAuser_.a"... 
cp build/arduino_due_x_dbg/core_/libAcore_.a build/arduino_due_x_dbg/core_/libarduino_core.a
"/opt/arduino-1.5.8/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/arm-none-eabi-gcc" -Os -Wl,--gc-sections -mcpu=cortex-m3 "-T/opt/arduino-1.5.8/hardware/arduino/sam/variants/arduino_due_x/linker_scripts/gcc/flash.ld" "-Wl,-Map,build/arduino_due_x_dbg/Blink.map" -Wl,--relax -Lbuild/arduino_due_x_dbg/core_  -o "build/arduino_due_x_dbg/Blink.elf" "-Lbuild/arduino_due_x_dbg" -mthumb -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,--warn-unresolved-symbols -Wl,--start-group "build/arduino_due_x_dbg/syscalls_sam3.c.o" build/arduino_due_x_dbg/Blink_ino.o  -lAuser_   "/opt/arduino-1.5.8/hardware/arduino/sam/variants/arduino_due_x/libsam_sam3x8e_gcc_rel.a" "build/arduino_due_x_dbg/core_/libarduino_core.a" -Wl,--end-group -lm -gcc
arm-none-eabi-gcc: error: build/arduino_due_x_dbg/syscalls_sam3.c.o: No such file or directory
_Makefile.master:1181: recipe for target 'build/arduino_due_x_dbg/Blink.hex' failed
make: *** [build/arduino_due_x_dbg/Blink.hex] Error 1

I use the simple blink example and added include "Arduino.h"

My Makefile looks like this:

BOARD=arduino_due_x_dbg
PORT=/dev/ACM0
ARD_HOME=/opt/arduino-1.5.8
MAKE_QUIET_LINK=

include _Makefile.master

The file build/arduino_due_x_dbg/syscalls_sam3.c.o does not exist, but ./build/arduino_due_x_dbg/core_/syscalls_sam3_c.o exists.

The file ./hardware/arduino/sam/platform.txt in arduino 1.5.8 contains this:

## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mcpu={build.mcu} "-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}" -mthumb -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,--warn-unresolved-symbols -Wl,--start-group "{build.path}/syscalls_sam3.c.o" {object_files} "{build.variant.path}/{build.variant_system_lib}" "{build.path}/{archive_file}" -Wl,--end-group -lm -gcc

@chrta
Copy link
Author

chrta commented Feb 2, 2015

Here is a temporary (and ugly) workaround for this:

recipe_aDjOkT_c_aDjOkT_combine_aDjOkT_pattern_2 =$(subst /syscalls_sam3_aDjOkT_c_aDjOkT_o,/core_/syscalls_sam3_c_aDjOkT_o,$(recipe_aDjOkT_c_aDjOkT_combine_aDjOkT_pattern))
GO_LINK =$(recipe_aDjOkT_c_aDjOkT_combine_aDjOkT_pattern_2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant