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

[Bug] Crkbd firmware will not link #9147

Closed
soweliniko opened this issue May 20, 2020 · 1 comment · Fixed by #9267
Closed

[Bug] Crkbd firmware will not link #9147

soweliniko opened this issue May 20, 2020 · 1 comment · Fixed by #9267

Comments

@soweliniko
Copy link

Describe the Bug

When I try and build the crkbd default firmware (make crkbd:default) it will not link, giving me this error:

Linking: .build/crkbd_rev1_default.elf                                                              [ERRORS]
 | 
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/./lib/layer_state_reader.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/./lib/logo_reader.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/./lib/keylogger.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/keyboards/crkbd/crkbd.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/keyboards/crkbd/rev1/rev1.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | /usr/bin/avr-ld: .build/obj_crkbd_rev1_default/keyboards/crkbd/keymaps/default/keymap.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: multiple definition of `display'; .build/obj_crkbd_rev1_default/ssd1306.o:/home/nihilazo/projects/qmk_firmware/keyboards/crkbd/ssd1306.h:68: first defined here
 | collect2: error: ld returned 1 exit status
 | 
make[1]: *** [tmk_core/rules.mk:306: .build/crkbd_rev1_default.elf] Error 1
Make finished with errors

This does not happen with other crkbd keymaps, nor with firmware for other keyboards.

System Information

  • Keyboard: crkbd
  • Operating system: Arch Linux
  • AVR GCC version: 10.1.0
  • ARM GCC version: 10.1.0
  • QMK Firmware version: 0.8.168
@zvecr
Copy link
Member

zvecr commented May 20, 2020

Seems to be an issue with avr-gcc 10, which we avoid in the install scripts by forcing 8.3 https://github.com/qmk/qmk_firmware/blob/master/util/linux_install.sh#L80.

Changing where display is created allows the build to pass (however ive not tested this at runtime)

diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c
index 20c2738db..ea91ab129 100644
--- a/keyboards/crkbd/ssd1306.c
+++ b/keyboards/crkbd/ssd1306.c
@@ -13,6 +13,8 @@
 #include "sendchar.h"
 #include "timer.h"
 
+struct CharacterMatrix display;
+
 extern const unsigned char font[] PROGMEM;
 
 // Set this to 1 to help diagnose early startup problems
diff --git a/keyboards/crkbd/ssd1306.h b/keyboards/crkbd/ssd1306.h
index ea8c92328..8b83085d0 100644
--- a/keyboards/crkbd/ssd1306.h
+++ b/keyboards/crkbd/ssd1306.h
@@ -66,7 +66,7 @@ struct CharacterMatrix {
   bool dirty;
 };
 
-struct CharacterMatrix display;
+extern struct CharacterMatrix display;
 
 bool iota_gfx_init(bool rotate);
 void iota_gfx_task(void);

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

Successfully merging a pull request may close this issue.

2 participants