From nobody Wed May 18 19:17:58 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id ACE5118169F8; Wed, 18 May 2022 19:18:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L3N734J85z3p2j; Wed, 18 May 2022 19:18:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652901487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fU0KFQrL3S3Oxexdq0RPJvegUci+wCC5CTs8e8PqE3w=; b=kJ9gEXRxWqDsgf0tEkV9/4RMl77XRt0yo4K8L/FS2euC0om8kC8ChJiBQrzXPWPL7f4/RU YJ/FCuMYiW5t76TgjOzQOLRX/UpMgR6y65ZMnkCG3rvArkhDrQh6/O2Ip/m7uiAfp23JjR zDVo2aJeB3ioYThjOAe94zQ840botIA3quehBcAjMXhcOKysEeBlIrHirUGLMCd/36XeAb 0z8qUfqflRMYoPFqWc/E+/9D1ky66nBhbficCFPkRr4/fE+U/97jMTC4NzlUGl6bGviYW4 AKrBM8SeA4Oj3ZInPTdpzJPHq4TLm+D2B9b9F7jD4rC4JzR6iApd4+U4p0vcJg== Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 57F7825104; Wed, 18 May 2022 19:18:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 08A1442437; Wed, 18 May 2022 21:18:06 +0200 (CEST) Content-Type: multipart/signed; boundary="Apple-Mail=_31681BFC-1E9A-4C06-B96E-BEC8BD87CBD8"; protocol="application/pgp-signature"; micalg=pgp-sha1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.100.31\)) Subject: Re: git: 349cc55c9796 - main - Merge llvm-project main llvmorg-14-init-10186-gff7f2cfa959b From: Dimitry Andric In-Reply-To: Date: Wed, 18 May 2022 21:17:58 +0200 Cc: John Baldwin , Charlie Li , Brooks Davis , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <698AE22D-5E95-405E-A8BE-AE67A3A7BE36@FreeBSD.org> References: <202205141148.24EBmkZd015765@gitrepo.freebsd.org> <4b61bdc6-fdc7-57df-e9b7-52543fd083be@freebsd.org> <20220516154825.GF15201@spindle.one-eyed-alien.net> <5e5281b2-a9d1-3751-b09a-c88d210f4f55@FreeBSD.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3696.100.31) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652901487; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fU0KFQrL3S3Oxexdq0RPJvegUci+wCC5CTs8e8PqE3w=; b=su6opQuEHtq7w3okzkTogSoCxV46i3GaLiW8mm89lJUvPamQrNpy9rtlqqqLqTjtydA+my 1NxWnvBCtUKPxvDLX00Hvp8W95Al2bITThNU/J9KkEF0SI3Y8vTdkgv17nv+XB7h2cFFe3 9gGFQTXo0312D1kqtzMV0SK6ldpEeA7RXVetwUvX2QdZL8oeMBl3Yi3RRtmPDnlfFSINPi /7jES9LrMVTd+BW/WcKXX9PUVzGNBV+y97PzAzvfN/ZYsFDaLkL/FQRUEnG4oPTZr6T1DR IZG4HUI/r8VKIPems/CLmYaYIGsl4Da/VRbDIXGnQUF70mMHNoQdSGc3T12qJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652901487; a=rsa-sha256; cv=none; b=Wyj0m0ORal/pFlT+33W0G4F14BaZ/lzRx59EkxSbndogsZtFDgyY2IvWuA9H8llLLyXnSJ XDGgmcfU3IR4zY7ASGOWNac3G7iDea8fQt95lJYbVWxRjIkR0SYRo55JPT+q4ciwtG/x41 6y7tMkNIGTTMb1GXlhpqc9I5hAEEZKqvFxMTo8JtnH3dxleZR533W4QlHn72k8NTc4bkuV W5/sm9xsut9AnW1Yjfq8huwWZpgTmDaivGLZDKVOg8q9pF5Yhjf0MRcnKyHLwNpXdDZv5O ofAwdrsGvWFiTHB4dguvrQHonuG3vXvSjncZstQjlxlAg+d0lcG7pxiruzEmtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail=_31681BFC-1E9A-4C06-B96E-BEC8BD87CBD8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 18 May 2022, at 02:33, Konstantin Belousov = wrote: >=20 > On Tue, May 17, 2022 at 10:56:14AM -0700, John Baldwin wrote: >> On 5/16/22 8:09 PM, Charlie Li wrote: >>> Brooks Davis wrote: >>>> On Mon, May 16, 2022 at 10:47:49AM -0400, Charlie Li wrote: >>>>> Dimitry Andric wrote: >>>>>> This was also reported by another user, and it turned out they = were >>>>>> using WITHOUT_CROSS_COMPILER=3D in src.conf. If you also have = that, try >>>>>> removing it and rebuilding. >>>>>>=20 >>>>> Yeah I eventually figured that part out. Worked around (first = attempt) >>>>> by building with devel/llvm14 CROSS_TOOLCHAIN, but resulted in = certain >>>>> kernel modules (zfs and a few more) with malformed relocations. >>>>> Subsequent rebuild with the new world's toolchain corrected that. >>>>=20 >>>> Does that mean we're missing patches in the port? Hopefully = anything >>>> this critical can be merged into LLVM 14.0.3. >>>>=20 >>> Probably: >>>=20 >>> May 15 22:34:08 current-builder kernel: ---<>--- >>> May 15 22:34:08 current-builder kernel: Copyright (c) 1992-2022 The >>> FreeBSD Project. >>> May 15 22:34:08 current-builder kernel: Copyright (c) 1979, 1980, = 1983, >>> 1986, 1988, 1989, 1991, 1992, 1993, 1994 >>> May 15 22:34:08 current-builder kernel: The Regents of the >>> University of California. All rights reserved. >>> May 15 22:34:08 current-builder kernel: FreeBSD is a registered >>> trademark of The FreeBSD Foundation. >>> May 15 22:34:08 current-builder kernel: FreeBSD 14.0-CURRENT #121 >>> main-n255657-48a1a6be196: Sun May 15 21:59:12 EDT 2022 >>> May 15 22:34:08 current-builder kernel: >>> = root@current-builder:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG = amd64 >>> May 15 22:34:08 current-builder kernel: clang version 14.0.2 >>> [...] >>> May 15 22:34:08 current-builder kernel: kldload: unexpected = relocation >>> type 42, symbol index 8321 >>=20 >> These are all type 42: >>=20 >> #define R_X86_64_REX_GOTPCRELX 42 >>=20 >> It's not a LLVM bug so much as it is probably missing support in the = kernel and/or >> loader for this type of relocation. kldxref might also need updating. >>=20 >> I suspect due to a mismatch of old lld with new clang or some such = that the old >> lld failed to resolve these relocations to some other type or = something weird like >> that? >=20 > I do think this is a toolchain bug, or at least new and undesired = behavior. >=20 > For practical purposes, R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX = are > same as R_X86_64_GOTPCREL64, I believe, but we do not expect GOT = relocations > in the .o object modules on amd64. I don't see this with clang 14.0.3 from base on 14-CURRENT. None of my kernel modules has any of these relocations, and I also get no warnings from kldxref. Btw, I know that clang from ports will use /usr/local/bin/ld if it is available, so this might be GNU ld specific behavior? Charlie, do you have the binutils port installed? That said, the lld release notes = say you can now use --no-relax for this: > =E2=80=A2 For x86-64, --no-relax now suppresses R_X86_64_GOTPCRELX and > R_X86_64_REX_GOTPCRELX GOT optimization (D113615) So maybe we can use this in sys/conf/kern.mk, or in kmod.mk? -Dimitry --Apple-Mail=_31681BFC-1E9A-4C06-B96E-BEC8BD87CBD8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYoVGZgAKCRCwXqMKLiCW o0lzAJ0ch1OSniN8u5/iWXQ0KlrK9RQRGQCdE9pnFW/AZRvq7DtSLMm1Pimtsmw= =KayD -----END PGP SIGNATURE----- --Apple-Mail=_31681BFC-1E9A-4C06-B96E-BEC8BD87CBD8--