Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 315987 - sys-devel/gcc-4.5+: please enable hardfloat building on ARM EABI by default
Summary: sys-devel/gcc-4.5+: please enable hardfloat building on ARM EABI by default
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-18 16:31 UTC by Raúl Porcel (RETIRED)
Modified: 2010-04-25 18:05 UTC (History)
3 users (show)

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


Attachments
toolchain.patch (patchy,489 bytes, patch)
2010-04-18 16:32 UTC, Raúl Porcel (RETIRED)
Details | Diff
toolchainv2.patch (patchy2,529 bytes, patch)
2010-04-19 17:59 UTC, Raúl Porcel (RETIRED)
Details | Diff
toolchainv3.patch (attachment.cgi?id=228421,539 bytes, patch)
2010-04-20 17:49 UTC, Raúl Porcel (RETIRED)
Details | Diff
toolchain-funcs.patch (toolchain-funcs.patch,654 bytes, patch)
2010-04-21 19:23 UTC, Raúl Porcel (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raúl Porcel (RETIRED) gentoo-dev 2010-04-18 16:31:48 UTC
For gcc-4.5.0, the hardfloat method for ARM EABI has been implemented. It gives a higher performance on systems that have hardware FPU.

On ARM EABI, the default float method is *SOFT*, thats why if we want to build a hardfloat toolchain on ARM EABI we need to pass --with-float=hard.

I'll attach a patch

On <gcc-4.5 if you use eabi and hardfloat, it will fail to configure. Would you like to keep it that way or filter it so it only passes that if gcc-4.5?
Comment 1 Raúl Porcel (RETIRED) gentoo-dev 2010-04-18 16:32:08 UTC
Created attachment 228297 [details, diff]
toolchain.patch
Comment 2 Raúl Porcel (RETIRED) gentoo-dev 2010-04-19 17:59:25 UTC
Created attachment 228421 [details, diff]
toolchainv2.patch

solar says it would be better to add the check for the gcc version, so i've added it.
Comment 3 SpanKY gentoo-dev 2010-04-19 21:56:11 UTC
the proposed patch looks fine, although when indenting the second line, please use tabs to match the "if" part, but then use spaces to line it up with the [[

<tab>if [[ ....
<tab><space><space><space>tc_version_........

the confgcc= line is indented one too many times

also, the style is '<space>;<space>then'

fixes those issues and feel free to commit this change
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2010-04-20 17:49:02 UTC
Created attachment 228535 [details, diff]
toolchainv3.patch

Commited, i'm attaching the definitive patch for convenience
Comment 5 Raúl Porcel (RETIRED) gentoo-dev 2010-04-20 20:20:56 UTC
Mike,

Something came to my mind, if a system is using *-unknown-*, this option will be enabled. This would break all systems since a softfp system can't be converted to hard.

Do you mind if i change it to:
if [[ ${CTARGET##*-} == *eabi ]] && [[ ${CTARGET//_/-} == *-hardfloat-* ]] && \
?

Thanks

Also, is it fine if i add a case for *-softfp-*, where --with-float=softfp would be used? So we would have three:
-softfloat
-softfp (instead of unknown which is currently used in the arm stages where a FPU is required)
-hardfloat (after 4.5)

Thanks
Comment 6 SpanKY gentoo-dev 2010-04-20 21:22:03 UTC
if people want softfloat, then they should use a softfloat tuple.  but that's me.

if we're going to add a hardfloat magic chost, then checking should be unified just like the existing tc-is-softfloat.  then the logic can be split out from arm so that it applies to all targets
Comment 7 Raúl Porcel (RETIRED) gentoo-dev 2010-04-21 19:18:08 UTC
Okay,

Looking at toolchain-funcs.eclass, i can see this at the tc-is-softfloat function:
<snip>
# The possible return values:
#  - only: the target is always softfloat (never had fpu)
#  - yes:  the target should support softfloat
#  - no:   the target should support hardfloat
<snip>
tc-is-softfloat() {
        case ${CTARGET} in
                bfin*|h8300*)
                        echo "only" ;;
                *)
                        [[ ${CTARGET//_/-} == *-softfloat-* ]] \
                                && echo "yes" \
                                || echo "no"
                        ;;
        esac
}

The definition of 'no' should be changed, am i right?

I'll put an attachment to add a new function for hardfloat

Comment 8 Raúl Porcel (RETIRED) gentoo-dev 2010-04-21 19:23:10 UTC
Created attachment 228655 [details, diff]
toolchain-funcs.patch

Does this look right?

Thanks
Comment 9 SpanKY gentoo-dev 2010-04-22 02:28:37 UTC
looks fine to me, thanks
Comment 10 Raúl Porcel (RETIRED) gentoo-dev 2010-04-22 18:31:23 UTC
Ok, applied, regarding toolchain.eclass(i'm not posting a patch since its a one-liner):

@@ -1347,6 +1353,7 @@
 
 
        [[ $(tc-is-softfloat) == "yes" ]] && confgcc="${confgcc} --with-float=soft"
+       [[ $(tc-is-hardfloat) == "yes" ]] && confgcc="${confgcc} --with-float=hard"
 
        # Native Language Support
        if use nls ; then

Is that fine?

Thanks
Comment 11 SpanKY gentoo-dev 2010-04-25 07:09:35 UTC
yes, that's fine, thanks
Comment 12 Raúl Porcel (RETIRED) gentoo-dev 2010-04-25 18:05:17 UTC
Applied. Closing.