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

Add missing library in Makefile #8661

Merged
merged 1 commit into from Dec 5, 2017

Conversation

lumbric
Copy link

@lumbric lumbric commented Dec 4, 2017

When using RELOC_WORKAROUND library needs to be linked explicitly, otherwise
eeprom functions are not available.

Thanks to @rfjakob for finding the crucial hint to solve this issue.

This solves the following issue: when enabling EEPROM_SETTINGS make reports the following error:

$ make
...
  CXX   applet/Marlin.elf
/tmp/ccUqfxN6.ltrans7.ltrans.o: In function `MarlinSettings::read_data(int&, unsigned char*, unsigned int, unsigned int*)':
ccUqfxN6.ltrans7.o:(.text._ZN14MarlinSettings9read_dataERiPhjPj+0x30): undefined reference to `eeprom_read_byte'
/tmp/ccUqfxN6.ltrans7.ltrans.o: In function `MarlinSettings::write_data(int&, unsigned char const*, unsigned int, unsigned int*)':
ccUqfxN6.ltrans7.o:(.text._ZN14MarlinSettings10write_dataERiPKhjPj+0x4e): undefined reference to `eeprom_read_byte'
ccUqfxN6.ltrans7.o:(.text._ZN14MarlinSettings10write_dataERiPKhjPj+0x5a): undefined reference to `eeprom_write_byte'
ccUqfxN6.ltrans7.o:(.text._ZN14MarlinSettings10write_dataERiPKhjPj+0x60): undefined reference to `eeprom_read_byte'
collect2: error: ld returned 1 exit status
Makefile:515: recipe for target 'applet/Marlin.elf' failed
make: *** [applet/Marlin.elf] Error 1

Setting RELOC_WORKAROUND=0 fixes the problem, but I guess the correct fix is to include the missing library explicitly when -nodefaultlibs is used because of RELOC_WORKAROUND=1.

Branch 1.0.x is not affected.

Tested with arduino 1.8.5.

When using RELOC_WORKAROUND library needs to be linked explicitly, otherwise
eeprom functions are not available.

Thanks to @rfjakob for finding the crucial hint to solve this issue.
@thinkyhead thinkyhead added the T: HAL & APIs Topic related to the HAL and internal APIs. label Dec 5, 2017
@thinkyhead thinkyhead merged commit ff258d4 into MarlinFirmware:bugfix-1.1.x Dec 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T: HAL & APIs Topic related to the HAL and internal APIs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants