From owner-freebsd-ppc@freebsd.org Fri May 5 07:45:38 2017 Return-Path: Delivered-To: freebsd-ppc@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 6FDE2D5EDEB for ; Fri, 5 May 2017 07:45:38 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-77.reflexion.net [208.70.210.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20CEB15C8 for ; Fri, 5 May 2017 07:45:37 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 22200 invoked from network); 5 May 2017 07:45:36 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 5 May 2017 07:45:36 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.0) with SMTP; Fri, 05 May 2017 03:45:36 -0400 (EDT) Received: (qmail 11305 invoked from network); 5 May 2017 07:45:36 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 5 May 2017 07:45:36 -0000 Received: from [192.168.1.106] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 7C729EC7ED9; Fri, 5 May 2017 00:45:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: llvm FreeBSD powerpc ABI target bug fix: Re: [Bug 26519] Clang 4.0.0's "Target: powerpc-unknown-freebsd11.0" code generation is violating the SVR4 ABI (SEGV can result) From: Mark Millard In-Reply-To: <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> Date: Fri, 5 May 2017 00:45:34 -0700 Cc: Dimitry Andric , FreeBSD Toolchain Content-Transfer-Encoding: quoted-printable Message-Id: <8F708AD1-055E-41BD-BD92-6A87C5FBAA60@dsl-only.net> References: <0103401A-CEEA-4992-A45E-E60EA151119B@dsl-only.net> <893ECA11-7C80-4D24-A496-92ADC7978A07@FreeBSD.org> To: FreeBSD PowerPC ML X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 May 2017 07:45:38 -0000 On 2017-May-4, at 2:41 PM, Dimitry Andric wrote: > On 4 May 2017, at 21:39, Mark Millard wrote: >>=20 >> I just got a report of a fix for the FreeBSD >> powerpc ABI's code generation in llvm. It should >> fix a stack handling related problem that >> currently makes clang (through 4) largely useless >> for TARGET_ARCH=3Dpowerpc . >>=20 >> On 2017-May-4, at 12:26 PM, bugzilla-daemon@llvm.org wrote: >>=20 >>> Comment # 19 on bug 26519 from Krzysztof Parzyszek >>> Committed a fix in r302183. >>>=20 >>> You are receiving this mail because: >>> =E2=80=A2 You reported the bug. >>=20 >> This would also apply to: >>=20 >> powerpc-unknown-freebsd12.0 >>=20 >> not just 11.0 >>=20 >> Hopefully it is an easy merge into >> clang 4. >=20 > Thanks for the notice. I have merged the upstream fix into head in > r317810, and I will MFC it after a few days. I now have an old PowerMac running: # uname -paKU FreeBSD FBSDG4S 12.0-CURRENT FreeBSD 12.0-CURRENT r317820M powerpc = powerpc 1200030 1200030 where buildworld was via clang 4 (an amd64->powerpc cross build). Even the classic tiny program that previously showed C++ exception handling was broken and would crash the program now works when re-compiled and re-linked. Commands that were previous broken now work. (But my testing is nearly minimal at this point.) The kernel is from gcc421. I did try booting a kernel built by system-clang 4 and it got to: exec /sbin/init: error 13 and a later alignment exception at sf_buf_alloc+0x260 (Hand transcribed screen information.) This is the same as the last time that I tried such. The exception involved: exec_map_first_page kern_execve sys_execve start_init fork_exit fork_trampoline For the gcc 4.2.1 based kernel boot I have had one odd fatal kernel trap (0x903a64a, "unknown") where the lr showed 0x907f . It reported being stopped at: ffs_truncate+0x1080 It appears that "call doadump" worked but I've not looked at what was put in /var/crash/ . =3D=3D=3D Mark Millard markmi at dsl-only.net