Bug 2413789

Summary: arm-none-eabi-gcc fails to link
Product: [Fedora] Fedora Reporter: Mark Spencer <markster>
Component: arm-none-eabi-gcc-csAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 43CC: beroset, christophe.clienti, epel-packagers-sig, mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: arm-none-eabi-gcc-cs-15.2.0-1.fc43 arm-none-eabi-gcc-cs-15.2.0-1.fc42 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-11-27 00:46:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mark Spencer 2025-11-10 14:43:32 UTC
Description of problem:

the compiler fails to link executables, likely due to miscompiled crtbegin.o:

arm-none-eabi-gcc -Wmissing-braces -std=c99 -D_POSIX_C_SOURCE=199309L -funsigned-char -ffunction-sections -fdata-sections -Dxfsplatform_teensy4 -Werror -Wall          -Os -std=gnu99           -Dasm=__asm__ -MMD -DF_CPU=600000000 -DUSB_SERIAL -D__IMXRT1062__ -DARDUINO_TEENSY41 -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb                          -Wno-unused-result      -I../../include -I../../include -I../../include/xfs -I../../include/xfs -I../../include/xfd -I../../src -I../../src -I../../src/os/teensy4    -I../../src/os/teensy4/libteensy -I../../src/os/teensy4/stack     -Wl,--gc-sections,--relax,-Map=output.map -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -mthumb -T/usr/src/git/xfs-tmp/src/os/teensy4/imxrt1062_t41.ld  -o xfs_actime xfs_actime.o ../../src/fonts/libxfsfonts.a ../../src/hids/libxfshids.a ../../src/libxfs/libxfs.a ../../src/os/compat/libxfscompat.a ../../src/os/teensy4/libxfsos.a ../../src/fonts/libxfsfonts.a ../../src/hids/libxfshids.a ../../src/libxfs/libxfs.a ../../src/os/compat/libxfscompat.a ../../src/os/teensy4/libxfsos.a  -lm 
/usr/lib/gcc/arm-none-eabi/15.1.0/../../../../arm-none-eabi/bin/ld: /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v7e-m+dp/hard/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/v7e-m+dp/hard/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/v7e-m+dp/hard/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/v7e-m+dp/hard/crtbegin.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

Version-Release number of selected component (if applicable):


How reproducible:

Easy to reproduce


Steps to Reproduce:
1. Build an object file
2. Attempt to link the object file into an ELF file
3. Note results

Actual results:

Fails to link due to "wrong format"

Expected results:

Links as it does in previous versions

Additional info:

Note that the intermediate object files build correctly:

src/core/xfs_actime.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped

However the crtbegin.o included with the compiler is nonsensical (is not for a machine):

/usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v7e-m+dp/hard/crtbegin.o: ELF 32-bit LSB relocatable, no machine, version 1 (SYSV), not stripped

Whereas on previous fedora, we have properly (ARM, EAB15):

/usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v7e-m+dp/hard/crtbegin.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped

Comment 1 Christophe Clienti 2025-11-11 08:57:27 UTC
I noticed exactly the same issue yesterday for ARM Cortex M0 (raspberry pico/rp2040). The crt files are provided by the package arm-none-eabi-gcc-cs-1:15.1.0-3.fc43.x86_64.

Hereafter the link error with fc43 packages:

/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

And I agree, the crtbegin.o seems not correct:

$ file /usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o
/usr/lib/gcc/arm-none-eabi/15.1.0/thumb/v6-m/nofp/crtbegin.o: ELF 32-bit LSB relocatable, no machine, version 1 (SYSV), not stripped

A temporary workaround is to downgrade to fc42 if mandatory:

$ mkdir arm-rpms && pushd arm-rpms
$ dnf download --releasever=42 arm-none-eabi-gcc arm-none-eabi-newlib arm-none-eabi-gcc-cs-c++ arm-none-eabi-binutils-cs
$ sudo rpm -ivh *.rpm
$ popd

Then add the following in the /etc/dnf/dnf.conf file:

[main]
exclude=arm-none-eabi-gcc-cs arm-none-eabi-newlib arm-none-eabi-gcc-cs-c++ arm-none-eabi-binutils-cs

Comment 2 Ed Beroset 2025-11-16 01:58:49 UTC
As noted in seemingly duplicate bug https://bugzilla.redhat.com/show_bug.cgi?id=2405563 another workaround is to upgrade to the rawhide version of arm-none-eabi-gcc-cs via the command "sudo dnf upgrade arm-none-eabi-gcc-cs --enablerepo=rawhide"

Comment 3 Michal Hlavinka 2025-11-18 15:08:29 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 4 Fedora Update System 2025-11-18 15:10:02 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 5 Fedora Update System 2025-11-18 15:10:05 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 6 Fedora Update System 2025-11-19 00:53:50 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 7 Fedora Update System 2025-11-19 01:27:52 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 8 Fedora Update System 2025-11-27 00:46:56 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 9 Fedora Update System 2025-11-27 01:00:03 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.