Bug 25635 - arm: Wrong sysdep order selection for soft-fp
Summary: arm: Wrong sysdep order selection for soft-fp
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.30
: P2 normal
Target Milestone: 2.32
Assignee: Adhemerval Zanella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-05 13:56 UTC by Adhemerval Zanella
Modified: 2020-07-31 09:08 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adhemerval Zanella 2020-03-05 13:56:16 UTC
The commit "arm: Split BE/LE abilist" (1673ba87fefe019c834c09d33673d1d453ea698d) changed the soft-fp order for ARM selection when __SOFTFP__ is defined by the compiler.

On 2.31 the sysdeps order is:

2.31
sysdeps/unix/sysv/linux/arm
sysdeps/arm/nptl
sysdeps/unix/sysv/linux
sysdeps/nptl
sysdeps/pthread
sysdeps/gnu
sysdeps/unix/inet
sysdeps/unix/sysv
sysdeps/unix/arm
sysdeps/unix
sysdeps/posix
sysdeps/arm/nofpu
sysdeps/ieee754/soft-fp
sysdeps/arm
sysdeps/wordsize-32
sysdeps/ieee754/flt-32
sysdeps/ieee754/dbl-64
sysdeps/ieee754
sysdeps/generic

While on master is:

sysdeps/unix/sysv/linux/arm/le
sysdeps/unix/sysv/linux/arm
sysdeps/arm/nptl
sysdeps/unix/sysv/linux
sysdeps/nptl
sysdeps/pthread
sysdeps/gnu
sysdeps/unix/inet
sysdeps/unix/sysv
sysdeps/unix/arm
sysdeps/unix
sysdeps/posix
sysdeps/arm/le
sysdeps/arm
sysdeps/wordsize-32
sysdeps/ieee754/flt-32 
sysdeps/ieee754/dbl-64
sysdeps/arm/nofpu
sysdeps/ieee754/soft-fp
sysdeps/ieee754
sysdeps/generic

It make the build select some routines (fadd, fdiv, fmul, fsub, and fma) on ieee754/flt-32 and ieee754/dbl-64 that requires fenv support to be correctly rounded which in turns lead to math failures since the __SOFTFP__ does not have fenv support.

As a side note, the SH similar change ('sh: Split BE/LE abilist' - 605f38177dba31fe0d0183abb67e25a28fd37d15) does not change the soft-fp order in relation with sysdeps/ieee754 ones.
Comment 1 Sourceware Commits 2020-03-06 12:59:32 UTC
The master branch has been updated by Adhemerval Zanella <azanella@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=af09e5e5d9ec3ca20891e61a6922eac984fcbdc4

commit af09e5e5d9ec3ca20891e61a6922eac984fcbdc4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 5 13:14:41 2020 +0000

    arm: Fix softp-fp Implies (BZ #25635)
    
    The commit "arm: Split BE/LE abilist"
    (1673ba87fefe019c834c09d33673d1d453ea698d) changed the soft-fp order for
    ARM selection when __SOFTFP__ is defined by the compiler.
    
    On 2.30 the sysdeps order is:
    
    2.30
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptl
    sysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/ieee754
    sysdeps/generic
    
    While on master is:
    
    sysdeps/unix/sysv/linux/arm/le
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptl
    sysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/le
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/ieee754
    sysdeps/generic
    
    It make the build select some routines (fadd, fdiv, fmul, fsub, and fma)
    on ieee754/flt-32 and ieee754/dbl-64 that requires fenv support to be
    correctly rounded which in turns lead to math failures since the
    __SOFTFP__ does not have fenv support.
    
    With this patch the order is now:
    
    sysdeps/unix/sysv/linux/arm/le
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptlsysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/le/nofpu
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/arm/le
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/ieee754
    sysdeps/generic
    
    Checked on arm-linux-gnuaebi.
Comment 2 Adhemerval Zanella 2020-03-06 13:01:13 UTC
Fixed on 2.32.
Comment 3 Sandra Loosemore 2020-03-10 06:24:19 UTC
I'm seeing this bug on the 2.31 branch as well, and the patch on master appears to fix it.  Do you want to backport it to the branch?
Comment 4 Adhemerval Zanella 2020-03-10 12:13:35 UTC
(In reply to sandra from comment #3)
> I'm seeing this bug on the 2.31 branch as well, and the patch on master
> appears to fix it.  Do you want to backport it to the branch?

I will backport it.
Comment 5 Sourceware Commits 2020-03-24 11:51:01 UTC
The release/2.30/master branch has been updated by Adhemerval Zanella <azanella@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4f0ae74135a58eb88c76cd061a984e919e5a2433

commit 4f0ae74135a58eb88c76cd061a984e919e5a2433
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 5 13:14:41 2020 +0000

    arm: Fix softp-fp Implies (BZ #25635)
    
    The commit "arm: Split BE/LE abilist"
    (1673ba87fefe019c834c09d33673d1d453ea698d) changed the soft-fp order for
    ARM selection when __SOFTFP__ is defined by the compiler.
    
    On 2.30 the sysdeps order is:
    
    2.30
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptl
    sysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/ieee754
    sysdeps/generic
    
    While on master is:
    
    sysdeps/unix/sysv/linux/arm/le
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptl
    sysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/le
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/ieee754
    sysdeps/generic
    
    It make the build select some routines (fadd, fdiv, fmul, fsub, and fma)
    on ieee754/flt-32 and ieee754/dbl-64 that requires fenv support to be
    correctly rounded which in turns lead to math failures since the
    __SOFTFP__ does not have fenv support.
    
    With this patch the order is now:
    
    sysdeps/unix/sysv/linux/arm/le
    sysdeps/unix/sysv/linux/arm
    sysdeps/arm/nptl
    sysdeps/unix/sysv/linux
    sysdeps/nptlsysdeps/pthread
    sysdeps/gnu
    sysdeps/unix/inet
    sysdeps/unix/sysv
    sysdeps/unix/arm
    sysdeps/unix
    sysdeps/posix
    sysdeps/arm/le/nofpu
    sysdeps/arm/nofpu
    sysdeps/ieee754/soft-fp
    sysdeps/arm/le
    sysdeps/arm
    sysdeps/wordsize-32
    sysdeps/ieee754/flt-32
    sysdeps/ieee754/dbl-64
    sysdeps/ieee754
    sysdeps/generic
    
    Checked on arm-linux-gnuaebi.
    
    (cherry picked from commit af09e5e5d9ec3ca20891e61a6922eac984fcbdc4)