armv6hf target building libraries wrong...

Warner Losh imp at bsdimp.com
Tue Apr 21 00:59:32 UTC 2015


> On Apr 20, 2015, at 4:09 PM, Andrew Turner <andrew at fubar.geek.nz> wrote:
>> Sadly, there’s no real way to tell them apart at runtime that I’ve
>> found except to grovel in the symbol table for ‘soft float’. Still
>> looking and hoping...
> 
> There is an elf note containing the TARGET_ARCH. You can also use the
> Tag_ABI_VFP_args attribute [1].

Looking at the Linux armv6hl and armv7hl binaries, I think we’re building our
libraries wrong for the armv6hf target.

% readelf -h linux/libc-2.21.so
…
  Flags:                             0x5000402, has entry point, Version5 EABI, <unknown>
...
% readelf -h freebsd/libc.so.7
…
  Flags:                             0x5000002, has entry point, Version5 EABI
…
%

0x400 is, per the spec, VFP floating used (hard float). Linux has this marking
and ours doesn’t. There’s a number of other minor differences as well:

% readelf -A linux/libc-2.21.s
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-A"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Application
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-2
  Tag_VFP_arch: VFPv3
  Tag_NEON_arch: NEONv1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_rounding: Needed
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align8_needed: Yes
  Tag_ABI_enum_size: int
  Tag_ABI_HardFP_use: SP and DP
  Tag_ABI_VFP_args: VFP registers
  Tag_unknown_34: 1 (0x1)
% readelf -A freebsd/libc.so.7
Attribute Section: aeabi
File Attributes
%

I’d like to fix this in -current. Any objections?

Warner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20150420/da9e3ec1/attachment.sig>


More information about the freebsd-arm mailing list