From owner-freebsd-ppc@freebsd.org Tue Aug 4 02:56:18 2020 Return-Path: Delivered-To: freebsd-ppc@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B09233AEF4D for ; Tue, 4 Aug 2020 02:56:18 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) (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 4BLKC42VCgz3TbL for ; Tue, 4 Aug 2020 02:56:16 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: S3QU5sYVM1lpzJWX9QMPDnOCIwb6h6lPKUOVR0SBR56GnMxdXxTolFTAOAE3mqW fyBjN30TKEWbi_5J7jyZc7XD81wtBYlFp6MqNzGwH903RiWhU._Zh4wo3ByEgxNZo4V8y9DvPd3N hdicZw8vhWGSOnW03dt5oSL.hFPuHknEG7jdOrNauxyMhboHoo64sSeSaFDo30QKFb5njRcplxod .Zf5UZxa9GUpigP9rnkJOpJzd94yveCyNTv3YlT2e9YE7pidDmHgtlVbPSZ5e8IoWUekCkIOQNrS ctlh11s_mOZgJqwpUY_rVtgxQ62gXcRfRZOfsaTRVa..Pv.3etxBZ9_0oa3YwzAEDHmNiz2bALXc FRptH3wxg.Rr3WNewolHzi1ZAjoU8xE9_RFgI_6b821aB20Rne4s8jfc4aOK4aCo1IZcz_vHtsT5 OwWSx_coND1G_V9C38VA1rR9AwD114uhjX9c9rp9.4TROeSatBjF0VlT8HoIvxXcbbxIXEgl4u6q 59s8h4GEQ3LN15XqvnWQNbpN7vYgbyRxto4f930Ann5Sk4qq_SNCvLwwpeZNsFnQVA77Er77ws.V A6Ym1wRgE_V2j04mActJfSxqtKeEe_Ir_7rN9hxp1u4I97hsCr8pzPyCtGa1kn.FbMrnOu4qiS4_ jojDaTdS_6IOsMXjcWhsNEvk9bIBxXhmDfGBqQ3ZAJUuAeFISCdhXbIVe2MQjYB5u4dIEnkcW1tl 26VU7wNFp_ZnwsXOotPzR5HvZHqdt9vq0GvD.l1YGItaGxt5ilF4S_5mqDiYs9PEiw4YiAIfo..A vJgpLuPe4a9gFIf3Jd8o.E_Nu05yAyAvsmNiGD8qNoQg7PTaUo8rR44Be7A6bZc7XlnG9yrf_z_. 05jylu__dtzO3S2vu6Y0KfjAQ8Nbwnqx.6mGPyOVoHPPtKyejfQ0LEMlIC1AT3ZAgQ0XzkIattC4 q9qViItyR667RSLpIcdAOCyprfH6S4MO22AWacw2Z_9umf5ypo.IK4DqpBLahVfFnAU4azZv3wbw Eae0sOkt8DdsJWvaREHUIbeYtjxy68Z7IUeq.kPrUoQBpndRXPYkgvRqp9BwJzYLflQEsVeTbZRm _HOi1wYdpekEHW9lxERucvlEMbA1ZEuNDRVUlTyIiKjF.6JH81MWDn6PDC672VWcoME4YoKlvp_Q Heiw67SdrtMLfmVqs0xHGKOAJ7GbEIzT5uDJyGH5dUjommc5FQrV1_sz3X6oSe0wc0PW8GIxDLBH h2sftBjKP21bh.btOsgFlpjAWACZhXTAdK.097Gf4KsBy32YXmflWQ0PwNY.kXvzhir98aIA8dHu jfNOXCo6b1u.xfNFceH2Xxr72lnSWTj0h3o9E_L0VRTKE3PHabNZUFRxT43s- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 4 Aug 2020 02:56:14 +0000 Received: by smtp423.mail.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID af87e93122c0f99c3f2089eb0a0470ed; Tue, 04 Aug 2020 02:56:12 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: Introduce WITH(OUT)_LTO? (was: Re: svn commit: r362987 - in head: contrib/bc usr.bin/gh-bc) (LLVMgold.so and gnu's ld.gold) From: Mark Millard In-Reply-To: <8B43A4F4-E44D-40C0-8984-FD0FD43198FE@yahoo.com> Date: Mon, 3 Aug 2020 19:56:11 -0700 Cc: svn-src-head@freebsd.org, FreeBSD Toolchain , freebsd-ppc Content-Transfer-Encoding: quoted-printable Message-Id: <72B5174F-124F-4259-BDF2-32E4E850A1F8@yahoo.com> References: <64523602-7EFC-4A97-90EA-C776BF2A0AF7.ref@yahoo.com> <64523602-7EFC-4A97-90EA-C776BF2A0AF7@yahoo.com> <8B43A4F4-E44D-40C0-8984-FD0FD43198FE@yahoo.com> To: =?utf-8?Q?Stefan_E=C3=9Fer?= X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BLKC42VCgz3TbL X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.61 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-1.08)[-1.084]; 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:36647, ipnet:98.137.64.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; SUBJECT_HAS_QUESTION(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.03)[-1.028]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.68.206:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.68.206:from]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:56:18 -0000 On 2020-Jul-25, at 13:59, Mark Millard wrote: > On 2020-Jul-8, at 01:28, Stefan E=C3=9Fer wrote: >=20 >> Am 08.07.20 um 09:01 schrieb Mark Millard: >>> The following is more informational than anything as far >>> as I'm concerned. But there may be implications that I'm >>> unaware of. (I sometimes experiment with toolchain use >>> to see what the current status is for such use.) >>>=20 >>> I attempted to build a system for 32-bit powerpc using clang >>> and binutils, building head -r363000 ( from -r363000 ). (This >>> was a cross build, amd64 -> powerpc.) It got a new type of >>> failure, compared to my past experience: >>=20 >> Hi Mark, >>=20 >> thank you for the report. I have tested with "make universe" (with >> default settings) that this version builds on all architectures, >> but Ed Maste has already disabled -flto for powerpc64, due to run >> time issues (floating point exception, IIRC). >>=20 >> I know that you are actively working on PowerPC and I'd appreciate, >> if you could provide me with information on which parameters cause >> breakage and which work for you. The combination of CLANG with LTO >> and GNU binutils cannot work - CLANG and GCC use incompatible file >> formats to represent the intermediate object files. >=20 > Hmm. It looks a little more complicated than that . . . >=20 > Looks like the devel/llvm80 devel/llvm90 and devel/llvm10 > options for powerpc64 include one for: >=20 > GOLD=3Don: Build the LLVM Gold plugin for LTO >=20 > That produces a plugin (LLVMgold.so) for use with gnu's > ld.gold ( from devel/binutils ). >=20 > . . . Ignore those notes. It looks like I greatly misinterpreted. For example doing some personal software builds with -flto in use resulted in (using devel/llvm11 as an example context): (powerpc64 context used) "/usr/local/llvm11/bin/ld" . . . -plugin = /usr/local/llvm11/bin/../lib/LLVMgold.so -plugin-opt=3Dmcpu=3Dppc64 = -plugin-opt=3DO3 . . . LLVMgold.so is for the llvm linker to use. I had built llvm10 with the gold option selected and there is: # ls -ldT /usr/local/llvm11/bin/../lib/LLVMgold.so -rwxr-xr-x 1 root wheel 94160 Jul 29 14:50:07 2020 = /usr/local/llvm11/bin/../lib/LLVMgold.so But, for the system clang 10 with -flto involved: "/usr/bin/ld" . . . -plugin /usr/bin/../lib/LLVMgold.so = -plugin-opt=3Dmcpu=3Dppc64 -plugin-opt=3DO3 . . . (yet there is no /usr/bin/../lib/LLVMgold.so present). And for even the likes of just: static volatile char big_area[67001] =3D "This is a test"; int main () { big_area[67000] =3D '9'; } commands like ( system clang and devel/llvm10 ): cc -flto main.c clang10 -flto main.c for powerpc64 produce invalid a.out files that do not even contain a main function when looked at with the likes of objdump -d --prefix-addresses and produce an a.out that does: # ./a.out Segmentation fault (core dumped) Or when run inside gdb such builds produce things like: Starting program: /root/c_tests/a.out=20 Program received signal SIGSEGV, Segmentation fault. (gdb) bt #0 0x00000000100412e8 in main () #1 0x0000000010010718 in _start (argc=3D, = argv=3D0xfffffbfffebb8, env=3D, obj=3D, = cleanup=3D, ps_strings=3D) at /usr/src/lib/csu/powerpc64/crt1_c.c:127 (gdb) disass Dump of assembler code for function main: =3D> 0x00000000100412e8 <+0>: .long 0x0 0x00000000100412ec <+4>: mullhwu r0,r1,r1 0x00000000100412f0 <+8>: .long 0x0 0x00000000100412f4 <+12>: vmsumshm v0,v2,v17,v19 0x00000000100412f8 <+16>: .long 0x0 0x00000000100412fc <+20>: .long 0x0 0x0000000010041300 <+0>: .long 0xfffff 0x0000000010041304 <+4>: stmw r31,-4128(r31) 0x0000000010041308 <+0>: .long 0xfffff 0x000000001004130c <+4>: stmw r31,-5176(r31) 0x0000000010041310 <+0>: .long 0x0 End of assembler dump. For reference: # uname -apKU FreeBSD FBSDG5L2 13.0-CURRENT FreeBSD 13.0-CURRENT #13 r363590M: Sun Jul = 26 20:14:08 PDT 2020 = root@FBSDFHUGE:/usr/obj/powerpc64vtsc_clang/powerpc.powerpc64/usr/src/powe= rpc.powerpc64/sys/GENERIC64vtsc-NODBG powerpc powerpc64 1300102 1300102 # svnlite info /usr/ports/ Path: /usr/ports Working Copy Root Path: /usr/ports URL: svn://svn.freebsd.org/ports/head Relative URL: ^/head Repository Root: svn://svn.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 543890 Node Kind: directory Schedule: normal Last Changed Author: gerald Last Changed Rev: 543890 Last Changed Date: 2020-07-31 22:52:17 -0700 (Fri, 31 Jul 2020) =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)