From owner-freebsd-ppc@freebsd.org Mon Jan 21 20:54:30 2019 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5822714B8141 for ; Mon, 21 Jan 2019 20:54:30 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic307-11.consmr.mail.ne1.yahoo.com (sonic307-11.consmr.mail.ne1.yahoo.com [66.163.190.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FDBF81B1E for ; Mon, 21 Jan 2019 20:54:29 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: WFyNAJkVM1mug0uRjB0T7uaXBZhPYMuNoqzpZLLpWtrcDrKzt_C36d3xvpDaiiW NdVMppvfQQ1XJ3ADcBJWvJdjbC3Y0Y2tf9_2eRJMXTcSiU54l9xy0h25b6kEGpu1ws88snz85KHL oVTKDIk8BPjBcmHF5IQ8.enIr8Sk8A9czB3bW18qRH7vwoX.uGw6c7p6O36_veHce5Mf_nQQ_EKH 4HWVsHhV.f.2no7ggDgOQ9n1SSkarY_KT.fU8YCBtEIvss7gh2PloZCxxwEDtmLdJtDszYI3u83R 5pQ8lfiHoMy3oH6X9URgdYjQKIFYmbuE6xCdHyCyojECiBqjN41Xh52WCYpkK_AG7MCGJMAReShk VnlZU2JVBRWzUsNONe9hqXWcCTWX8.YXjbSDUpZzQy378NPCx1EB9pqJuexxi3O0uHQSGmhn9ROp PqxytsTkBs6ZaajI7KsLnrXDvQezu0VijFamait2HjNcVQn84qzYmg2RQA2VqrITI6WrOoE5MtGV yrjN4Teg019tBBcNDgWxH1gOABLF9WN4Ph5RZ4jpw3aJyVBKxcqD7d_6m7rrSFbsk4hysktknqYn 9ro6pRm1WU06zs9aoDmwqldK9tKylLrgpSt_wdmjPur46TGWX0oTZRMn_FFvmQTusr8LDHVkvAVU ZNwX8W6Faj0zJFVtAs4.E7sIfP9pik.9L8NyD1wwva7h7fCLQjU1qEJz5ouUsmegsyDmqXPCvmBn 2Hv60a6UJqFYcnJBwR.rA6QYJMKwi2HEi0AVp_tEmjhKzaILXnu4orxKffRa4o20MDKJ37fQks0i Sdg7CWiixWmaPzTA.U7Sw9hFN6E1B8.9ha.f_GOF0D.8z36qEbGB1mplz8E452Ti7Z3d.keQHSDZ BxLHEKlE1.dP09PAIAs5BRCxK6t9hjEmojYMwmMy9TwyEtmKhX0Bnq40bz1QdNhBDDlF58edEw_y l8A7Rlt3C8d1Y6xxjabfju4_AQdIBRpDHNbdVl.wtk0dFJTN6IoWwKUXiAA3Fm90ND9vK92O4eMX LjFP1TOgmBdLyWvAPtxRwd5YkKfnPBpaJT.5_Nj3K.FmsDw4bS2WUiSxB_OF0HbZrEnVs Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Mon, 21 Jan 2019 20:54:22 +0000 Received: from c-67-170-167-181.hsd1.or.comcast.net (EHLO [192.168.1.102]) ([67.170.167.181]) by smtp407.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID d0a96b023c1d293d68d12b26b235d4fa; Mon, 21 Jan 2019 20:54:17 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: clang support From: Mark Millard In-Reply-To: Date: Mon, 21 Jan 2019 12:54:16 -0800 Cc: FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: <5CDCA7AB-395D-4AF0-9C2B-836F90DCDD17@yahoo.com> References: To: Michael Tuexen X-Mailer: Apple Mail (2.3445.102.3) X-Rspamd-Queue-Id: 1FDBF81B1E X-Spamd-Bar: + X-Spamd-Result: default: False [1.98 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MV_CASE(0.50)[]; FREEMAIL_FROM(0.00)[yahoo.com]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; MX_GOOD(-0.01)[cached: mta6.am0.yahoodns.net]; DKIM_TRACE(0.00)[yahoo.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.54)[0.543,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(1.19)[ip: (4.03), ipnet: 66.163.184.0/21(1.10), asn: 36646(0.88), country: US(-0.08)]; NEURAL_SPAM_MEDIUM(0.67)[0.670,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.09)[0.088,0]; RCVD_IN_DNSWL_NONE(0.00)[34.190.163.66.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 20:54:30 -0000 On 2019-Jan-21, at 11:55, Michael Tuexen wrote: > Dear all, >=20 > what is the reason FreeBSD is not using clang on PPC, but still used = gcc. > Are there any plans to change it? lld? clang/clang++ mixed with the binutils ld? libunwind vs. libgcc_s unwindd facilities? The official FreeBSD clang7 or clang6 vintage vs. later in-developement materials? I sometimes experiment with what FreeBSD has in-tree for buildworld buildkernel and testing. Also with devel/powerpc64-xtoolchain-gcc related tooling. The overall answer for clang is that various things still do not work. I'll mostly ignore here freebsd bugs in libgcc_s handling of DW_CFA_remember_state and DW_CFA_restore_state that also apply to builds via gcc's after gcc 4.2.1 . (I run with a near- minimalist-text-change patch for this. =46rom other points of view it is suboptimal but I do nor care.) gcc 4.2.1 seems to mostly avoid those two for powerpc64 and powerpc and so seems to operate. I'll caution that the following are all "last I knew" as I've not repeated my experiments in a few months. Someone may know more recent status and there are folks working on versions after here FreeBSD is currently based. (I've not experimented with their materials.) clang does not correctly compile the libgcc_s unwind code, making thrown exceptions not work at all: the generated code crashes. __builtin_eh_return is parsed silently but ignored and so there is missing material in clang's output. (There could be more to it.) libunwind in FreeeBSD did not support targeting powerpc64 or powerpc for FreeBSD, even getting syntax errors in the assembler notation. So switching over is not yet an option. The kernel linkage handling and some of the clang-based kernel build's linkage generation were not matched, leading to dynamically loading kernel modules built by clang crashing. (I will not claim to know which side should change: I've never found a good reference for such areas for ABI requirements both are to meet.) I dealt with this by building-in what I wanted access to in order to do other experiments. lld just does not work yet for powerpc64 or powerpc. (I do not remember much detail here.) I do not try this as often, instead focusing on compiler output being correct for now.) It is possibly that I'll remember more later. I've had more success with devel/powerpc64-xtoolchain-gcc related tooling, although there is: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D232387 "head -r339076: system crash in vnet_epair_init during kern_jail_set in = a kyua test on powerpc64" so I've only been able to complete a: # kyua test -k /usr/tests/Kyuafile with a gcc 4.2.1 based kernel mixed with the more modern gcc based buildworld. (Something like my libgcc_s patch for DW_CFA_remember_state and DW_CFA_restore_state is required because kyua uses thrown C++ exceptions extensively to operate.) Bugzilla 232387 may be another linkage mismatch between what the kernel handles and what the compiler/linker generates, although I do not remember the details at the moment. I have also experimented with base/gcc and base/binutils but mostly devel/powerpc64-xtoolchain-gcc related tooling. So I do not otherwise comment on base/gcc and base/binutils here. =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)