Qmk_firmware: [Bug] arm-none-eabi-gcc error on Arch Linux

Created on 15 Apr 2020  Â·  15Comments  Â·  Source: qmk/qmk_firmware

bug help wanted

Most helpful comment

Leaving a breadcrumb for anyone else on Arch/Manjaro. I got it working downgrading to 8.3 like this:
image

All 15 comments

Can you post the output you get with arm-none-eabi-gcc 8.3 or is it the same?

Make sure your repo is up to date, and run make git-submodule.

Those boards are ARM, whereas the v2 ones are AVR, so that would be why.

Interestingly, I tried compiling the dz60rgb/v1 myself, and got this:

Linking: .build/dztech_dz60rgb_v1_default.elf                                                       [ERRORS]
 | 
 | /usr/local/Cellar/arm-gcc-bin@8/8-2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld: cannot open linker script file ./lib/chibios/os/common/startup/ARMCMx/compilers/GCC/ld/.ld: No such file or directory
 | collect2: error: ld returned 1 exit status
 | 
make[1]: *** [.build/dztech_dz60rgb_v1_default.elf] Error 1
make: *** [dztech/dz60rgb/v1:default] Error 1
Make finished with errors

Oh, never mind, false alarm, that has to do with some stuff I'm working on in mcu_selection.mk regarding firmware size checks for ARM. It compiles fine with that reverted.

Can you post the output of git submodule status?
Mine is:

 313416b8fda90d9973a749a0a35970956852c286 lib/chibios (breaking_2020_q1)
 e3a3a24047717af33b098266e11c2e4e5102206a lib/chibios-contrib (breaking_2020_q1)
 ec44c6c1675c25b9827aacd08c02433cccde7780 lib/googletest (release-1.8.0)
 ce10f7642b0459e409839b23cc91498945119b4d lib/lufa (LUFA-170418-97-gce10f76)
 40b48f470addad6a4fb1177de1a69a181158739b lib/ugfx (v2.7-203-g40b48f47)

Could you try a make distclean first?

I tried, but the output is the same. Also used make dztech/dz60rgb_ansi/v1:default:dfu-util but I receive the same error. Do you think it could have anything to do with the AUR package?

Just for testing i downloaded the AUR Package and tried it with this but it worked for me.

I have the same problem right now (using dz60rgb_ansi):
qmk compile -kb dztech/dz60rgb_ansi/v1 -km default
returns

Ψ Compiling keymap with make dztech/dz60rgb_ansi/v1:default


QMK Firmware 0.8.120
Making dztech/dz60rgb_ansi/v1 with keymap default

make[1]: Entering directory '/home/{myuser}/qmk_firmware'
arm-none-eabi-gcc (Arch Repository) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Linking: .build/dztech_dz60rgb_ansi_v1_default.elf                                                  [ERRORS]
 |
 | /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(lib_a-abort.o): in function `abort':
 | abort.c:(.text.abort+0xa): undefined reference to `_exit'
 | /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(lib_a-signalr.o): in function `_kill_r':
 | signalr.c:(.text._kill_r+0xe): undefined reference to `_kill'
 | /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/9.3.0/../../../../arm-none-eabi/lib/thumb/v7e-m/nofp/libg_nano.a(lib_a-signalr.o): in function `_getpid_r':
 | signalr.c:(.text._getpid_r+0x0): undefined reference to `_getpid'
 | collect2: error: ld returned 1 exit status
 |
make[1]: *** [tmk_core/rules.mk:306: .build/dztech_dz60rgb_ansi_v1_default.elf] Error 1
make[1]: Leaving directory '/home/{myuser}/qmk_firmware'
Make finished with errors
make: *** [Makefile:579: dztech/dz60rgb_ansi/v1:default] Error 1

although when running it with v2 I get everything okay. The problem is.. I need V1.
qmk doctor:

Ψ QMK Doctor is checking your environment.
Ψ Detected Linux.
âš  Missing udev rules for 'dfu' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'tmk' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'input_club' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'stm32' boards. You'll need to use `sudo` in order to flash them.
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 9.3.0
☒ We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.
Ψ Found avrdude version 6.3
Ψ Found dfu-util version 0.9
Ψ Found dfu-programmer version 0.7.2
Ψ Submodules are up to date.
Ψ Problems detected, please fix these problems before proceeding.

I will downgrade avr-gcc later, but as I saw it does not work now so I wrote that before downgrading.
Edit: I downgraded to 8.x and even 7.x and all I have is:

Ψ Compiling keymap with make dztech/dz60rgb_ansi/v1:default


QMK Firmware 0.8.120
Making dztech/dz60rgb_ansi/v1 with keymap default

make[1]: Entering directory '/home/{user}/qmk_firmware'
arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: keyboards/dztech/dz60rgb_ansi/dz60rgb_ansi.c                                            arm-none-eabi-gcc: error trying to exec 'cc1': execvp: No such file or directory
 [ERRORS]
 |
 |
 |
make[1]: *** [tmk_core/rules.mk:386: .build/obj_dztech_dz60rgb_ansi_v1_default/keyboards/dztech/dz60rgb_ansi/dz60rgb_ansi.o] Error 1
make[1]: Leaving directory '/home/{user}/qmk_firmware'

Edit2: And yes, i linked everything properly (which gives something strange: gcc is in 7.x version but the warning is still there):

Ψ QMK Doctor is checking your environment.
Ψ Detected Linux.
âš  Missing udev rules for 'dfu' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'tmk' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'input_club' boards. You'll need to use `sudo` in order to flash them.
âš  Missing udev rules for 'stm32' boards. You'll need to use `sudo` in order to flash them.
Ψ All dependencies are installed.
Ψ Found arm-none-eabi-gcc version 7.3.1
☒ We do not recommend avr-gcc newer than 8. Downgrading to 8.x is recommended.
Ψ Found avrdude version 6.3
Ψ Found dfu-util version 0.9
Ψ Found dfu-programmer version 0.7.2
Ψ Submodules are up to date.
Ψ Problems detected, please fix these problems before proceeding.

Something is off with Arch's arm-none-eabi-gcc bundle because I cannot recreate it on Fedora with either 9.2 or 8.3.

In the meantime, could you please try to build you firmware with make dztech/dz60rgb_ansi/v1:adi EXTRAFLAGS+=--specs=nosys.specs and see if anything breaks?

I have this:

QMK Firmware 0.8.120
Making dztech/dz60rgb_ansi/v1 with keymap default and target adi                               [ERRORS]
make[1]: Entering directory '/home/{user}/qmk_firmware'
make[1]: *** No rule to make target 'adi'.  Stop.
make[1]: Leaving directory '/home/{user}/qmk_firmware'
Making dztech/dz60rgb_ansi/v1 with keymap via and target adi                                   [ERRORS]
make[1]: Entering directory '/home/{user}/qmk_firmware'
Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.
If unsure, set LINK_TIME_OPTIMIZATION_ENABLE = no.
make[1]: *** No rule to make target 'adi'.  Stop.
make[1]: Leaving directory '/home/{user}/qmk_firmware'
Make finished with errors
make: *** [Makefile:579: dztech/dz60rgb_ansi/v1:adi] Error 1

both on 7.x and 9.x

@Mesysz becaues you don't have galmio's keymap.
Try make dztech/dz60rgb_ansi/v1:default EXTRAFLAGS+=--specs=nosys.specs.

It works on my side with EXTRAFLAGS. Should I close the issue?

No, as the underlying issue still needs to be fixed in either Arch's arm-none-eabi-gcc or our build scripts.

Is there any option to pass EXTRAFLAGS to qmk flash? Because I can make it correctly, but flashing tries to build it without flags and gives the same error
Edit: I just added EXTRAFLAGS += --specs=nosys.specs to newly created rules.mk file in dztech/dz60rgb/keymaps/default dir. But I will leave it here for others.

Yes, make dztech/dz60rgb_ansi/v1:default:flash EXTRAFLAGS+=--specs=nosys.specs should also work, but the rules.mk file is probably more convenient.

Can confirm that this is now occurring on Ubuntu 20.04 as well.
EXTRAFLAGS+=--specs=nosys.specs does get things compiling. Output untested.

Leaving a breadcrumb for anyone else on Arch/Manjaro. I got it working downgrading to 8.3 like this:
image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaeldauria picture michaeldauria  Â·  3Comments

ghost picture ghost  Â·  3Comments

fredizzimo picture fredizzimo  Â·  4Comments

vokeio picture vokeio  Â·  3Comments

helluvamatt picture helluvamatt  Â·  4Comments