From owner-freebsd-arm@freebsd.org Thu Sep 24 21:24:17 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3005A0861F for ; Thu, 24 Sep 2015 21:24:17 +0000 (UTC) (envelope-from olavi.m.kumpulainen@gmail.com) Received: from mail-la0-x22a.google.com (mail-la0-x22a.google.com [IPv6:2a00:1450:4010:c03::22a]) (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 4C1F01BC6 for ; Thu, 24 Sep 2015 21:24:17 +0000 (UTC) (envelope-from olavi.m.kumpulainen@gmail.com) Received: by lacdq2 with SMTP id dq2so23155858lac.1 for ; Thu, 24 Sep 2015 14:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version; bh=jvsGG0nTP2hhllfjC9YJP5CBj2OEJvSWfo5/DDBcxEY=; b=XMFlA8C9DhnvBwClQ0T9Evo539ftyOfLqzMpgW9+I8XvZ584327YczXrNvlkPV1KcX /P2H8q5pkQXDidqAqzDWqLCm1fn7Hf5Ilh+NcZQQAn2Z001tp4+bj0GfF0AQaNvcBYOT 4XbVxAiqEp0KXwBnH9LECwm5mmc/FZcbOm+Aq9WXVvMKUXIOwZmArSbdGbngS3LKZef0 w1o0cpK6qbvR80CEvQERhLsPzjKj9XsCjUZUKGYvy/m3zzsUM9i44jw2XKD4Quf2/gvs IUyLlvpYXvjw6yKUKtv/yvtOxbJFdcPMeNLMvXAxjofbTPqar/7bbcjfFKngZpp0U9+m 8b/g== X-Received: by 10.112.204.67 with SMTP id kw3mr536890lbc.60.1443129855115; Thu, 24 Sep 2015 14:24:15 -0700 (PDT) Received: from [192.168.1.106] (c83-251-251-174.bredband.comhem.se. [83.251.251.174]) by smtp.gmail.com with ESMTPSA id e142sm24905lfe.27.2015.09.24.14.24.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Sep 2015 14:24:14 -0700 (PDT) From: Olavi Kumpulainen Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: gcc-4.2.1 on armv6 and Tag_ABI_HardFP_use Message-Id: <64C9409F-7E9D-4CF2-90E1-3834908BC813@gmail.com> Date: Thu, 24 Sep 2015 23:24:12 +0200 To: freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) 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: Thu, 24 Sep 2015 21:24:18 -0000 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 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