Skip to content

Bootloader does not compile with GCC 15 #400

Description

@tomlo76

Hello,

Cross-compiling bootloader (at least for n0110) with gcc 15 leads to an error with the linker :

/usr/lib/gcc/arm-none-eabi/15.2.0/../../../../arm-none-eabi/bin/ld: output/release/device/n0110/bootloader/jump_to_firmware.o(jump_to_firmware): Unknown destination type (ARM/Thumb) in /tmp/ccarcTNa.ltrans0.ltrans.o
/tmp/ccarcTNa.ltrans0.ltrans.o: in function `Bootloader::UpsilonRecoveryMenu::postOpen()':
/home/thomas/Projets/numworks/bootloader/bootloader/interface/menus/upsilon_recovery.cpp:44:(.text._ZN10Bootloader19UpsilonRecoveryMenu8postOpenEv+0x27e): dangerous relocation: unsupported relocation
/usr/lib/gcc/arm-none-eabi/15.2.0/../../../../arm-none-eabi/bin/ld: output/release/device/n0110/bootloader/jump_to_firmware.o(jump_to_firmware): Unknown destination type (ARM/Thumb) in /tmp/ccarcTNa.ltrans0.ltrans.o
/tmp/ccarcTNa.ltrans0.ltrans.o: in function `Bootloader::Slot::boot() const':
/home/thomas/Projets/numworks/bootloader/bootloader/slots/slot.cpp:80:(.text._ZNK10Bootloader4Slot4bootEv+0xfc): dangerous relocation: unsupported relocation

This can be reproduced by making the bootloader :

make MODEL=n0110 bootloader -j

I asked an LLM chatbot and it answers me that the jump_to_firmware label in bootloader/jump_to_firmware.s (first linker error) must be specified as a function, proposing to add the following (lines 7 and 11) :

.syntax unified
.section .text.jump_to_firmware
.align 2
.thumb
.global jump_to_firmware
.type jump_to_firmware, %function
jump_to_firmware:
  msr msp, r0
  bx r1
.size jump_to_firmware, .-jump_to_firmware

This change allows GCC to compile. If an ARM assembly developer can review it, I think it could be interesting to add this change to follow the last GCC versions.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions