Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Sep 2015 23:24:12 +0200
From:      Olavi Kumpulainen <olavi.m.kumpulainen@gmail.com>
To:        freebsd-arm@freebsd.org
Subject:   gcc-4.2.1 on armv6 and Tag_ABI_HardFP_use
Message-ID:  <64C9409F-7E9D-4CF2-90E1-3834908BC813@gmail.com>

next in thread | raw e-mail | index | archive | help
Hi everyone,

I have a question regarding armv6 gcc-4.2.1 and Tag_ABI_HardFP_use in =
the generated ELF objects.

I have a small c-program that looks as;

#include <stdio.h>

double fn(double x, double y)
{
    return x+y;
}

int main(int argc, char *argv[])
{
    printf("%f\n", fn(3.2, 9.7));
    return 0;
}


Compiling this with clang 3.4.1 produces the following results;

$ cc -v
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: armv6--freebsd10.2-gnueabi
Thread model: posix
Selected GCC installation:=20

$ cc -c t.c -march=3Darmv6 -mfloat-abi=3Dsoft
$ readelf -a t.o|grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x5000000, Version5 EABI
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP

$ cc -c t.c -march=3Darmv6 -mfloat-abi=3Dsoftfp
$ readelf -a t.o|grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x5000000, Version5 EABI
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP


Then, if I build a new world using the following src.conf:

$ cat /etc/src.conf
WITH_GCC=3Dyes
WITH_GNUCXX=3Dyes
WITH_GCC_BOOTSTRAP=3Dyes
WITHOUT_CLANG=3Dyes
WITHOUT_CLANG_IS_CC=3Dyes
WITHOUT_CLANG_BOOTSTRAP=3Dyes

And the usual;
make TARGET=3Darm TARGET_ARCH=3Darmv6 buildworld

and;
make TARGET=3Darm TARGET_ARCH=3Darmv6 buildenv


# cc -v
Using built-in specs.
Target: armv6-undermydesk-freebsd
Configured with: FreeBSD/armv6 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]

# cc -c t.c -march=3Darmv6 -mfloat-abi=3Dsoft
# readelf -A t.o |grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x4000000, Version4 EABI
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_optimization_goals: Aggressive Debug

A few more arc-specific tags, but none that strikes me as odd.

But what about -mfloat-abi=3Dsoftfp?

# cc -c t.c -march=3Darmv6 -mfloat-abi=3Dsoftfp
# readelf -a t.o |grep ABI
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Flags:                             0x4000000, Version4 EABI
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_align8_preserved: Yes, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_ABI_optimization_goals: Aggressive Debug

Are there any reasons for the appearance of the 'Tag_ABI_HardFP_use: SP =
and DP=E2=80=99 here?


/O





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64C9409F-7E9D-4CF2-90E1-3834908BC813>