Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 245315 - armv4tl-softfloat-linux-uclibceabi/gcc-4.1.2 breaks armv4t code, generated code has armv5t instructions
Summary: armv4tl-softfloat-linux-uclibceabi/gcc-4.1.2 breaks armv4t code, generated co...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: ARM Linux
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-02 19:47 UTC by Balint SZENTE
Modified: 2009-01-10 11:23 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for the GCC ebuild which checks the CTARGET (gcc-4.1.2.ebuild.patch,425 bytes, patch)
2008-11-02 19:50 UTC, Balint SZENTE
Details | Diff
Patch replacement for the sed line (gcc-4.3.2-armv4-eabi-fix.patch,488 bytes, patch)
2009-01-05 21:02 UTC, Sven 'sleipnir' Rebhan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balint SZENTE 2008-11-02 19:47:15 UTC
GCC defaults with ARM EABI to the ARM10TDMI core, i.e. armv5t. Thus the code generated with this cross GCC with CTARGET=armv4tl-softfloat-linux-uclibceabi will contain non armv4t instructions too (clz for example).

Reproducible: Always

Steps to Reproduce:
1. Generate the cross toolchain by the following command:
USE="-iconv -nls -fortran" UCLIBC_CPU=ARM920T crossdev -S --libc 0.9.30_rc3 --target armv4tl-softfloat-linux-uclibceabi
2. Check C library libc.so.0 for the clz instructions:
armv4tl-softfloat-linux-uclibceabi-objdump --disassemble libc.so.0 | grep clz
Actual Results:  
The C library libc.so.0 has armv5t instructions.

Expected Results:  
The generated code should have only armv4t instructions.
Comment 1 Balint SZENTE 2008-11-02 19:50:06 UTC
Created attachment 170568 [details, diff]
Patch for the GCC ebuild which checks the CTARGET

Possible solution is to check whether the CTARGET is armv4t with EABI, and then change GCC's default TARGET_CPU_arm10tdmi to TARGET_CPU_arm9tdmi.

This patch should be applied to all GCC version >=4.1.2
Comment 2 Dmitry Ivankov 2009-01-04 14:12:06 UTC
This sed line exists in toolchain.eclass v1.374, see unbreak_arm() there.
But it doesn't help me, crossdev -t armv4t-softfloat-linux-gnueabi fails on stage2.
Comment 3 SpanKY gentoo-dev 2009-01-04 17:18:22 UTC
i just reverted said change to toolchain.eclass ... it needs to be a patch in the gcc patchset tarball, not a random sed in the eclass
Comment 4 Sven 'sleipnir' Rebhan 2009-01-05 21:02:01 UTC
Vapier, your change broke the working armv4 toolchain!
Please use the attached patch and fix the toolchain again!!! This patch possibly also applies for other versions of gcc, so we have to fix them all...
Comment 5 Sven 'sleipnir' Rebhan 2009-01-05 21:02:49 UTC
Created attachment 177508 [details, diff]
Patch replacement for the sed line
Comment 6 solar (RETIRED) gentoo-dev 2009-01-05 22:05:08 UTC
un-reverted his revert. if the function is removed again with zero notification and zero attempts to fix the problem then that is tree abuse and will likely result in him losing commit privs to the tree.

If he wants to use patches that fine. But he needs to patch *all* gcc with the same logic used in the function.
Comment 7 SpanKY gentoo-dev 2009-01-10 11:23:12 UTC
you have control over infra so you certainly have the power to remove my access.  doesnt matter to me.

added patch to gcc-4.3.2-r3

http://sources.gentoo.org/gentoo/src/patchsets/gcc/4.3.2/gentoo/47_all_arm-unbreak-armv4t.patch?rev=1.1