Bug 1166416
| Summary: | gcc selects wrong library for thumb support | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | bztdlinux |
| Component: | arm-none-eabi-gcc-cs | Assignee: | Michal Hlavinka <mhlavink> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 21 | CC: | baloghsz, hedayatv, maciek.borzecki, mhlavink, reportingsjr, rob+redhat, tarjei.knapstad, templaryum |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | arm-none-eabi-gcc-cs-4.9.2-3.fc22 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-04-28 13:11:04 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
bztdlinux
2014-11-20 23:46:04 UTC
Could you provide some reproducer? Preferably small one, not whole project. Thanks. libopencm3 (https://github.com/libopencm3/libopencm3-examples) will build libopencm3 successfully, but will then fail to link when starting to compile executables. I can whip up a smaller project if you want, but the libopencm3-examples git isn't too big. I think there's a larger problem with the toolchain, as the libraries do not seem to use EABI. Example, binary built using F21 arm-none-eabi-* toolchain: ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: REL (Relocatable file) Machine: ARM Version: 0x1 Entry point address: 0x0 Start of program headers: 0 (bytes into file) Start of section headers: 1588 (bytes into file) Flags: 0x5000000, Version5 EABI Size of this header: 52 (bytes) Size of program headers: 0 (bytes) Number of program headers: 0 Size of section headers: 40 (bytes) Number of section headers: 21 Section header string table index: 18 Let's see the incompatible libgcc.a from F21. File: /usr/lib64/gcc/arm-none-eabi/4.8.3/thumb/libgcc.a(_thumb1_case_sqi.o) ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: REL (Relocatable file) Machine: None Version: 0x1 Entry point address: 0x0 Start of program headers: 0 (bytes into file) Start of section headers: 156 (bytes into file) Flags: 0x5000000 <--- note missing EABI Size of this header: 52 (bytes) Size of program headers: 0 (bytes) Number of program headers: 0 Size of section headers: 40 (bytes) Same for rawhide. Basically the toolchain is not EABI. For comparison working arm-none-eabi 4.8.1 toolchain from F20: File: /usr/lib64/gcc/arm-none-eabi/4.8.1/thumb/libgcc.a(_thumb1_case_sqi.o) ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 Class: ELF32 Data: 2's complement, little endian Version: 1 (current) OS/ABI: UNIX - System V ABI Version: 0 Type: REL (Relocatable file) Machine: ARM Version: 0x1 Entry point address: 0x0 Start of program headers: 0 (bytes into file) Start of section headers: 592 (bytes into file) Flags: 0x5000000, Version5 EABI Size of this header: 52 (bytes) Size of program headers: 0 (bytes) Number of program headers: 0 Size of section headers: 40 (bytes) Number of section headers: 15 Section header string table index: 12 I believe just ran in to this problem as well. I had successfully compiled arm projects (libopencm3 stuff like above) on this install, but I upgraded from fedora 19 to 21 and now I'm getting this error. This is blocking some of my work so I will try to find a work around until something else can be figured out. (In reply to Jon Neal from comment #4) > I believe just ran in to this problem as well. I had successfully compiled > arm projects (libopencm3 stuff like above) on this install, but I upgraded > from fedora 19 to 21 and now I'm getting this error. This is blocking some > of my work so I will try to find a work around until something else can be > figured out. You can download previous packages from koji like this: koji download-build arm-none-eabi-gcc-cs-2013.11.24-2.fc20 --arch x86_64 koji download-build arm-none-eabi-newlib-2.1.0-3.fc20 --arch noarch koji download-build arm-none-eabi-binutils-cs-2013.11.24-1.fc20 --arch x86_64 koji download-build arm-none-eabi-gdb-7.6.2-1.fc20 --arch x86_64 And add exclude=arm-none-eabi-* in /etc/dnf/dnf.conf However I ran into problems with newlib on Cortex-M3, where scanf would consistently cause hard faults for some reason. So, I've switched to Linaro arm-none-eabi toolchain temporarily. The problem is not limited to thumb libraries. Compiling binaries with this toolchain on F21 doesn't work at all. Bug #1178520 should be marked as duplicate of this bug, and the title of this bug should be made more generic. The problem is still present in the latest rawhide packages as of today arm-none-eabi-gcc-cs-2014.05.28-1.fc22.x86_64 arm-none-eabi-binutils-cs-2014.05.28-3.fc22.x86_64 arm-none-eabi-gcc-cs-4.9.2-3.fc20,arm-none-eabi-newlib-2.2.0_1-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/arm-none-eabi-gcc-cs-4.9.2-3.fc20,arm-none-eabi-newlib-2.2.0_1-1.fc20 arm-none-eabi-gcc-cs-4.9.2-3.fc21,arm-none-eabi-newlib-2.2.0_1-1.fc21 has been submitted as an update for Fedora 21. https://admin.fedoraproject.org/updates/arm-none-eabi-gcc-cs-4.9.2-3.fc21,arm-none-eabi-newlib-2.2.0_1-1.fc21 arm-none-eabi-gcc-cs-4.9.2-3.fc22,arm-none-eabi-newlib-2.2.0_1-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/arm-none-eabi-gcc-cs-4.9.2-3.fc22,arm-none-eabi-newlib-2.2.0_1-1.fc22 Package arm-none-eabi-gcc-cs-4.9.2-3.fc22, arm-none-eabi-newlib-2.2.0_1-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing arm-none-eabi-gcc-cs-4.9.2-3.fc22 arm-none-eabi-newlib-2.2.0_1-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-6237/arm-none-eabi-gcc-cs-4.9.2-3.fc22,arm-none-eabi-newlib-2.2.0_1-1.fc22 then log in and leave karma (feedback). I can confirm that these packages for both f21 and f22 fix the problem for me. Confirmed working on F21 arm-none-eabi-gcc-cs-4.9.2-3.fc21, arm-none-eabi-newlib-2.2.0_1-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report. arm-none-eabi-gcc-cs-4.9.2-3.fc20, arm-none-eabi-newlib-2.2.0_1-1.fc20 has been pushed to the Fedora 20 stable repository. If problems still persist, please make note of it in this bug report. arm-none-eabi-gcc-cs-4.9.2-3.fc22, arm-none-eabi-newlib-2.2.0_1-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. |