From owner-freebsd-arm@FreeBSD.ORG Tue Apr 21 00:59:32 2015 Return-Path: Delivered-To: freeBSD-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D014EA5C for ; Tue, 21 Apr 2015 00:59:32 +0000 (UTC) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3420E9B for ; Tue, 21 Apr 2015 00:59:32 +0000 (UTC) Received: by pdbqd1 with SMTP id qd1so224857928pdb.2 for ; Mon, 20 Apr 2015 17:59:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:message-id:references:to; bh=5XNdUBpqNXPZq2rrR6b0mF5lLpPCC0jInxP/ii5bu1Q=; b=Lbg+2z2j9LewOXhfYc8oLOaohXYdE9PiL4m4lRAdREqZamaQ3tNhlSPfB+MGQlogVO YDrSsZOEyi6UFS63kBhrL5peIoqGYmpKcj0azzCr8On9T8g+DXYNsjOZ7yn2BTtRTrLp WABenXVFLEzraOqE7qFUF5w9qU3xSSpe/XmhHMLMxu7t80bmQqh+wUYHRcUtVJbqKVTf QHTyZ5voNAFyrs6cyQBz1DV4ARABmvOGZfPBBH0x92Aiil0UaGAxd9YEtVMNrgUWY4ea gk+AUEAJPfhXhx3OjZ8iNSAXTw+TDKGFaMDALMLFFjHzKuk7yEd/q1wqvIXKqo3S4/oD AkbQ== X-Gm-Message-State: ALoCoQnqR109gANUmdKInldGOB1/pC/e90XAXamhWNfkQ9Ygpe7XzOWIekho7E7Hsb2l6CKAPaFq X-Received: by 10.68.221.164 with SMTP id qf4mr32917411pbc.1.1429577640727; Mon, 20 Apr 2015 17:54:00 -0700 (PDT) Received: from [10.64.27.48] ([69.53.236.236]) by mx.google.com with ESMTPSA id fk4sm154070pbb.80.2015.04.20.17.53.58 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 20 Apr 2015 17:53:59 -0700 (PDT) Sender: Warner Losh Subject: armv6hf target building libraries wrong... Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_7E11C2A5-863F-41E0-8E89-82ECC6CC3441"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Warner Losh In-Reply-To: <20150420230901.666fe888@bender.Home> Date: Mon, 20 Apr 2015 18:53:56 -0600 Cc: freeBSD-arm@freebsd.org Message-Id: <7C137019-9108-4F56-A03E-CBD6B055EBD9@bsdimp.com> References: <55316705.9020506@ignoranthack.me> <63DBA00A-509B-4B20-BA3E-07AC5F7C8885@gromit.dlib.vt.edu> <55356425.1030503@ignoranthack.me> <012688E4-7FB6-4807-A049-014C30BE80D4@bsdimp.com> <20150420230901.666fe888@bender.Home> To: Andrew Turner X-Mailer: Apple Mail (2.2098) X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2015 00:59:32 -0000 --Apple-Mail=_7E11C2A5-863F-41E0-8E89-82ECC6CC3441 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 20, 2015, at 4:09 PM, Andrew Turner = wrote: >> Sadly, there=E2=80=99s no real way to tell them apart at runtime that = I=E2=80=99ve >> found except to grovel in the symbol table for =E2=80=98soft = float=E2=80=99. Still >> looking and hoping... >=20 > 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=E2=80=99re = building our libraries wrong for the armv6hf target. % readelf -h linux/libc-2.21.so =E2=80=A6 Flags: 0x5000402, has entry point, = Version5 EABI, ... % readelf -h freebsd/libc.so.7 =E2=80=A6 Flags: 0x5000002, has entry point, = Version5 EABI =E2=80=A6 % 0x400 is, per the spec, VFP floating used (hard float). Linux has this = marking and ours doesn=E2=80=99t. There=E2=80=99s 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=E2=80=99d like to fix this in -current. Any objections? Warner --Apple-Mail=_7E11C2A5-863F-41E0-8E89-82ECC6CC3441 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVNZ+lAAoJEGwc0Sh9sBEAS6oP/2WC4CMjWJQ6lifSnVvonv3w aaaXgM5cHe9WqJ/+HfEKzLT4uF/C1ML8mM+ZjApkgT2r+Mls4qfReqQ1WhNl4b4o 1qDQHXE/vCO+1Q/D8blBpElZaQIPaRGNeHlhdMKMQtF0rg8DEjz/TlS8RyAsniaI cYWUPkO0wlWsBCDe61BvMRwgavqllDo2ko7Y47gkk6J8BwkbBygizOnzMcSmUP7m vfsF3z11FFCwH0gJ5vGZjPK7mRGWHOMGPTONCB7ymnhL1rw/fjPpr/rHEmZFo5Ky 3JugyM9L5aSnTIzPUBTmvhho+sgxsGk0cUT7YjKV065/JtA2XS0aP91JM/RyLkw5 WFmIfW1rwTgBI76mjdGBdRkXEx+xVc0cD7H1EFIIrSo/hGY27UzcVyNmqgC9jdgP HyHSgt6vcY7cq5Pf3JRznjchhafHqx4Mem0ZL3AOCmNHRc91tX9It1LoGX7obHmz hQUBZirZ14eh+PzqoxSOia3pMUFeJWfqOO9RTa/UNAwO0Lr0c21sX3cauYPyMM8d hNpZ0uK1CNYiT2XkprM8WAGHQ4TWNw5gPWr1Qd1vecr/Q2H/LqlGb1M9qB32D4DH Qym3vEzbU3dyZK3ozCcUAY3kWRjpOeReuFzKkVu44iWXhfn7Nh0UGrQ+Ww7XRzQU JjZRI2892uv7mK5WxV6v =l/go -----END PGP SIGNATURE----- --Apple-Mail=_7E11C2A5-863F-41E0-8E89-82ECC6CC3441--