Bug 2405563 - Compiling for cortex-m0plus fails with "relocations in generic ELF"
Summary: Compiling for cortex-m0plus fails with "relocations in generic ELF"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: arm-none-eabi-gcc-cs
Version: 43
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Michal Hlavinka
QA Contact: Fedora Extras Quality Assurance
URL: https://gcc.gnu.org/bugzilla/show_bug...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-21 22:48 UTC by Xaver Hugl
Modified: 2025-11-27 01:00 UTC (History)
4 users (show)

Fixed In Version: arm-none-eabi-gcc-cs-15.2.0-1.fc43 arm-none-eabi-gcc-cs-15.2.0-1.fc42
Clone Of:
Environment:
Last Closed: 2025-11-27 00:46:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Xaver Hugl 2025-10-21 22:48:48 UTC
The practical impact to me is that compiling any project targeting the Raspberry Pi Pico fails with these warnings:
```
/usr/lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o: relocations in generic ELF (EM: 0)
/usr/lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o: relocations in generic ELF (EM: 0)
/usr/lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o: relocations in generic ELF (EM: 0)
/usr/lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
```
https://github.com/raspberrypi/pico-examples can be used for testing this.

I also just checked and found out that Fedora 42 uses the same arm-none-eabi-gcc version, yet it works fine there.
The linked gcc bug report also has a more minimal example, but while it doesn't hit this issue, it doesn't fully compile on Fedora 42 either.

Reproducible: Always

Steps to Reproduce:
1. git clone https://github.com/raspberrypi/pico-examples.git
2. git clone https://github.com/raspberrypi/pico-sdk.git
3. mkdir pico-examples/build
4. cd pico-examples/build
5. PICO_SDK_PATH=../../pico-sdk cmake ..
6. cmake --build .

Comment 1 Xaver Hugl 2025-10-26 18:57:33 UTC
I tested the gcc build from rawhide (https://koji.fedoraproject.org/koji/buildinfo?buildID=2817394) and things work fine with that one

Comment 2 Thomas 2025-11-11 22:58:29 UTC
I can confirm this behaviour. I've updated to fedora 43 recently and my previously working build chain for a raspberry pi pico dosn't work anymore with the failes explained above. After upgradeing the arm-none-eabi-gcc-cs package to rawhide, the project successfully links again.

Comment 3 Ed Beroset 2025-11-16 01:50:52 UTC
(In reply to Thomas from comment #2)
> I can confirm this behaviour. I've updated to fedora 43 recently and my
> previously working build chain for a raspberry pi pico dosn't work anymore
> with the failes explained above. After upgradeing the arm-none-eabi-gcc-cs
> package to rawhide, the project successfully links again.

I can also confirm that a previously working Pico project compiled and now with Fedora 43 it does not with exactly the linker messages here.  Per Thomas' suggestion I executed `sudo dnf upgrade arm-none-eabi-gcc-cs --enablerepo=rawhide` (which also brings along `arm-none-eabi-gcc-cs-c++`) and now everything links and works again.

Comment 4 Michal Hlavinka 2025-11-18 15:07:31 UTC
Not sure why it builds fine for me, but as more ppl suggested that gcc from rawhide helps, I've build 15.2.0 from rawhide for f43 and f42. Expect in updates-testing repository soon-ish

Comment 5 Fedora Update System 2025-11-18 15:09:59 UTC
FEDORA-2025-30e1f16dc3 (arm-none-eabi-gcc-cs-15.2.0-1.fc43) has been submitted as an update to Fedora 43.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-30e1f16dc3

Comment 6 Fedora Update System 2025-11-18 15:10:01 UTC
FEDORA-2025-3b28288d93 (arm-none-eabi-gcc-cs-15.2.0-1.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-3b28288d93

Comment 7 Fedora Update System 2025-11-19 00:53:47 UTC
FEDORA-2025-3b28288d93 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-3b28288d93`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-3b28288d93

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2025-11-19 01:27:50 UTC
FEDORA-2025-30e1f16dc3 has been pushed to the Fedora 43 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-30e1f16dc3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-30e1f16dc3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2025-11-27 00:46:53 UTC
FEDORA-2025-30e1f16dc3 (arm-none-eabi-gcc-cs-15.2.0-1.fc43) has been pushed to the Fedora 43 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2025-11-27 01:00:00 UTC
FEDORA-2025-3b28288d93 (arm-none-eabi-gcc-cs-15.2.0-1.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.