From owner-freebsd-current@freebsd.org Mon Jul 24 03:14:14 2017 Return-Path: Delivered-To: freebsd-current@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 9ED76DB51DE for ; Mon, 24 Jul 2017 03:14:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-38.reflexion.net [208.70.210.38]) (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 65F257D7C5 for ; Mon, 24 Jul 2017 03:14:13 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 23863 invoked from network); 24 Jul 2017 03:14:12 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 24 Jul 2017 03:14:12 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.1) with SMTP; Sun, 23 Jul 2017 23:14:12 -0400 (EDT) Received: (qmail 18101 invoked from network); 24 Jul 2017 03:14:12 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 24 Jul 2017 03:14:12 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id C57E7EC8715; Sun, 23 Jul 2017 20:14:11 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: HEADS-UP: Merged llvm/clang 5.0.0 into -CURRENT (as of r321369) From: Mark Millard In-Reply-To: <20170724024430.eqj5xfk274fkxjfh@mutt-hbsd> Date: Sun, 23 Jul 2017 20:14:10 -0700 Cc: FreeBSD Current , Dimitry Andric Content-Transfer-Encoding: quoted-printable Message-Id: <637C6671-B321-4958-8C95-F1C8D1A576F2@dsl-only.net> References: <20170723233447.3qqb7sbonlhirwt5@mutt-hbsd> <20170724011613.radyrjpsaqwjfc6t@mutt-hbsd> <20170724024430.eqj5xfk274fkxjfh@mutt-hbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2017 03:14:14 -0000 On 2017-Jul-23, at 7:44 PM, Shawn Webb = wrote: > On Sun, Jul 23, 2017 at 09:16:26PM -0400, Shawn Webb wrote: >> On Sun, Jul 23, 2017 at 07:34:47PM -0400, Shawn Webb wrote: >>> On Sun, Jul 23, 2017 at 04:13:18PM -0700, Mark Millard wrote: >>>> Shawn Webb shawn.webb at hardenedbsd.org wrote on >>>> Sat Jul 22 15:33:14 UTC 2017 : >>>>=20 >>>>> I haven't nailed down whether it's SafeStack, CFI, or using lld as = the >>>>> default linker, but it looks like we in HardenedBSD are getting an >>>>> undefined symbol during buildworld. >>>>=20 >>>> In an amd64 -> TARGET_ARCH=3Dpowerpc64 cross build context=20 >>>> for FreeBSD -r321371 I got a similar report for the: >>>>=20 >>>> /usr/obj/usr/src/tmp/usr/bin/ld: error: undefined symbol: = lldb_private::AppleObjCRuntime::GetFoundationVersion() >>>>>>> referenced by = /usr/src/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/Cocoa.cpp >>>>>>> = Cocoa.o:(lldb_private::formatters::NSNumberSummaryProvider(lldb_private::V= alueObject&, lldb_private::Stream&, lldb_private::TypeSummaryOptions = const&)) in archive /usr/obj/usr/src/lib/clang/liblldb/liblldb.a >>>>=20 >>>> part of your report (logfile). The context used >>>> devel/powerpc64-binutils : >>>>=20 >>>> # /usr/local/powerpc64-freebsd/bin/ld --version >>>> GNU ld (GNU Binutils) 2.28 >>>> Copyright (C) 2017 Free Software Foundation, Inc. >>>> This program is free software; you may redistribute it under the = terms of >>>> the GNU General Public License version 3 or (at your option) a = later version. >>>> This program has absolutely no warranty. >>>>=20 >>>> (lld is not yet working option for powerpc64 as >>>> far as I know.) >>>>=20 >>>> For this part of your report I doubt that anything >>>> that you listed is required for the problem to happen. >>>>=20 >>>> In my context the error text was: >>>>=20 >>>> --- lldb.full --- >>>> = /usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/lib/cla= ng/liblldb/liblldb.a(Cocoa.o): In function = `lldb_private::formatters::NSNumberSummaryProvider(lldb_private::ValueObje= ct&, lldb_private::Stream&, lldb_private::TypeSummaryOptions const&)': >>>> = /usr/src/contrib/llvm/tools/lldb/source/Plugins/Language/ObjC/Cocoa.cpp:(.= text._ZN12lldb_private10formatters23NSNumberSummaryProviderERNS_11ValueObj= ectERNS_6StreamERKNS_18TypeSummaryOptionsE+0x398): undefined reference = to `lldb_private::AppleObjCRuntime::GetFoundationVersion()' >>>=20 >>> Hey Mark, >>>=20 >>> I wasn't doing a cross-build, but rather a native build for amd64. = I'm >>> getting errors again. In fact, I'm getting the same error you just >>> posted above. I have no clue why the error's happening. That you're >>> also getting the error shows that the issue isn't specific to >>> HardenedBSD at the very least. >>=20 >> I've figured out how to fully reproduce. The following assumes world >> still is at clang/llvm 4.0. The following also assumes the source = tree >> is at /usr/src and is latest FreeBSD HEAD. And MAKEOBJDIRPREFIX is = unset >> or left as default. Native build on amd64. >>=20 >> 1. Set ld.lld as the linker: >> a. rm /usr/bin/ld >> b. ln -s ld.lld /usr/bin/ld >> c. Verify: `ld -version` should show: >> LLD 4.0.0 (FreeBSD 297347) (compatible with GNU linkers) >> 2. Ensure the object tree is clean: >> a. rm -rf /usr/obj/usr/src >> 3. Build world: >> a. make -sj$(sysctl -n hw.ncpu) buildworld >> 4. Relax, grab a drink, eat some Skittles >> 5. Come back to buildworld failing to link lldb.full in >> usr.bin/clang/lldb >=20 > Found the regression: It looks like lldb 5.0.0 doesn't support being > compiled with SafeStack. I'll report this upstream to llvm. [These notes only apply to the undefined symbol for lldb_private::AppleObjCRuntime::GetFoundationVersion() .] Such a regerssion may be true as far as it goes but likely can not be all there is too it since (using the powerpc64 example): I did nothing that I know of to involve anything called SafeStack in my FreeBSD context (not HardenedBSD). So far as I know the gcc based devel/powerpc64-binutils variant of ld does not support -fsanitize=3Dsafe-stack but all the binutils were from the devel/powerpc64-binutils port. This makes it unlikely that -fsanitize=3Dsafe-stack would be supplied to any compile or link command in my context. For my context sanitize=3Dsafe-stack is not found by: grep sanitize=3Dsafe-stack /usr/src/Makefile* /usr/src/share/mk/* Nor does it occur in the typescript for my failing build or any other build. It was not in the cc+ command that ran the linker instance that produced the message that I got. =3D=3D=3D Mark Millard markmi at dsl-only.net