From owner-freebsd-arm@FreeBSD.ORG Sun Jan 11 01:03:37 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32A1D28E for ; Sun, 11 Jan 2015 01:03:37 +0000 (UTC) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9027DC31 for ; Sun, 11 Jan 2015 01:03:35 +0000 (UTC) Received: from [208.184.220.60] (helo=macbook-air-3.dolby.net) by id.bluezbox.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1YA6wC-000AsU-Uk for freebsd-arm@freebsd.org; Sat, 10 Jan 2015 17:03:30 -0800 From: Oleksandr Tymoshenko Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: xdev-links names and clang Message-Id: <2CBEDF87-5932-417B-99DB-19B476B0A032@bluezbox.com> Date: Sat, 10 Jan 2015 17:02:56 -0800 To: "freebsd-arm@freebsd.org List" Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) X-Mailer: Apple Mail (2.1993) Sender: gonzo@id.bluezbox.com X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Hello, I got bit by weird problem when tried to run application built with CC set to armv6-freebsd-cc. It crashed in qsort's compare function and when I tried to debug it it started crashing in all weird places. [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 2.7 DNS_FROM_AHBL_RHSBL RBL: Envelope sender listed in dnsbl.ahbl.org 0.0 URIBL_BLOCKED ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [URIs: pastebin.com] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 01:03:37 -0000 Hello, I got bit by weird problem when tried to run application built with CC set to armv6-freebsd-cc. It crashed in qsort's compare function and when I tried to debug it it started crashing in all weird places. The same app built with CC set to "cc" in buldenv worked fine. Turned out that clang determines it's target triplet based on the name of executable file. And armv6-freebsd-cc generated by xdev-links does not match the default one. ln -s /usr/armv6-freebsd/usr/bin/cc cc ln -s /usr/armv6-freebsd/usr/bin/cc armv6-frebsd-cc ln -s /usr/armv6-freebsd/usr/bin/cc armv6-gnueabi-freebsd11.0-cc default target for these three links would be different % ./cc -v FreeBSD clang version 3.5.0 (tags/RELEASE_350/final 216957) 20141124 Target: armv6--freebsd11.0-gnueabi Thread model: posix % ./armv6-freebsd-cc -v FreeBSD clang version 3.5.0 (tags/RELEASE_350/final 216957) 20141124 Target: armv6--freebsd Thread model: posix % ./armv6-gnueabi-freebsd11.0-cc -v FreeBSD clang version 3.5.0 (tags/RELEASE_350/final 216957) 20141124 Target: armv6--freebsd11.0-gnueabi Thread model: posix I generated default #defines for them using "$CC -dM -E - < /dev/null" and they look different enough to mess things up Full diff between second and first: http://pastebin.com/GLtsQfuv Default includes for armv6-freebsd-cc have __FreeBSD__ set to 8, __ARM_EABI__ is undefined and wchar_t defines are different too. Should we update xdev-links logic to match clang's target triplets? -- gonzo