Skip to content
  • Michal Hrusecky's avatar
    51cc8f7c
    turris1x: Fix gcc floating points · 51cc8f7c
    Michal Hrusecky authored
    There are wrong flags passed to gcc during compilation for Turris 1.X.
    Problem description bellow:
    
    $ cat test.c
    int main(int argc, char *argv[]) { printf("Hello World %lg\n",
    atof(argv[1]) + atof(argv[2])); return 0; }
    
    $ usr/bin/gcc test.c
    /usr/bin/ld: Warning: /tmp/usr/bin/../lib/gcc/powerpc-openwrt-linux-muslspe/8.4.0/libgcc.a(adddf3.o)
    uses double-precision hard float, a.out uses single-precision hard
    float
    
    $ usr/bin/gcc --help=target -Q | grep -E
    '(-mcpu=|-mdouble-float|-mfloat-gprs=|-mtune=)'
    -mcpu= 8540
    -mdouble-float [disabled]
    -mfloat-gprs= single
    -mtune= 8540
    
    The take out of this is that -mcpu and-mtune má byť 8548, and
    -mdouble-float should be enabled and -mfloat-gprs should be double.
    
    This should be fixed by passing `--with-cpu=8548 --enable-e500-double`
    to configure script.
    51cc8f7c
    turris1x: Fix gcc floating points
    Michal Hrusecky authored
    There are wrong flags passed to gcc during compilation for Turris 1.X.
    Problem description bellow:
    
    $ cat test.c
    int main(int argc, char *argv[]) { printf("Hello World %lg\n",
    atof(argv[1]) + atof(argv[2])); return 0; }
    
    $ usr/bin/gcc test.c
    /usr/bin/ld: Warning: /tmp/usr/bin/../lib/gcc/powerpc-openwrt-linux-muslspe/8.4.0/libgcc.a(adddf3.o)
    uses double-precision hard float, a.out uses single-precision hard
    float
    
    $ usr/bin/gcc --help=target -Q | grep -E
    '(-mcpu=|-mdouble-float|-mfloat-gprs=|-mtune=)'
    -mcpu= 8540
    -mdouble-float [disabled]
    -mfloat-gprs= single
    -mtune= 8540
    
    The take out of this is that -mcpu and-mtune má byť 8548, and
    -mdouble-float should be enabled and -mfloat-gprs should be double.
    
    This should be fixed by passing `--with-cpu=8548 --enable-e500-double`
    to configure script.
Loading