From owner-svn-src-head@freebsd.org Mon Dec 21 17:31:09 2020 Return-Path: Delivered-To: svn-src-head@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 19A944C0426; Mon, 21 Dec 2020 17:31:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D062P03nrz3rq6; Mon, 21 Dec 2020 17:31:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:bcde:28e8:6746:f87e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 43ECF227B; Mon, 21 Dec 2020 17:31:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r368789 - head/libexec/rtld-elf/rtld-libc To: Ryan Libby Cc: src-committers , svn-src-all , svn-src-head , Konstantin Belousov , Alex Richardson References: <202012190838.0BJ8cVJ3064816@repo.freebsd.org> <47e9db0f-14b4-0a0d-45c4-7e466e69711f@FreeBSD.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+la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gIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 21 Dec 2020 09:31:06 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Dec 2020 17:31:09 -0000 On 12/19/20 8:27 PM, Ryan Libby wrote: > On Sat, Dec 19, 2020 at 7:23 PM John Baldwin wrote: >> >> On 12/19/20 12:38 AM, Ryan Libby wrote: >>> Author: rlibby >>> Date: Sat Dec 19 08:38:31 2020 >>> New Revision: 368789 >>> URL: https://svnweb.freebsd.org/changeset/base/368789 >>> >>> Log: >>> rtld-elf: link udivmoddi4 from compiler_rt >>> >>> This fixes the gcc9 build of rtld-elf32 on amd64, which needed an >>> implementation of udivmoddi4. >>> >>> rtld-elf uses certain functions normally found in libc, and so it >>> includes certain files from libc in its own build. It has two >>> mechanisms to include files from libc: one that rebuilds source files in >>> the rtld-elf environment, and one that extracts object files from a >>> purpose-built no-SSP PIC archive. >>> >>> In addition to libc functions, rtld-elf may need to link functions >>> normally found in libcompiler_rt (formerly libgcc). Now, add an ability >>> to rebuild libcompiler_rt source files in the rtld-elf environment. We >>> don't yet have a need for an object file extraction mechanism. >>> >>> libcompiler_rt could also supply udivdi3 and umoddi3, but leave them >>> alone for now. >>> >>> Reviewed by: arichardson, kib >>> Sponsored by: Dell EMC Isilon >>> Differential Revision: https://reviews.freebsd.org/D27665 >> >> Hmm, I had just linked against libcompiler_rt directly as we do on arm: >> >> https://reviews.freebsd.org/D26199 >> >> It was stuck waiting for review feedback. >> >> Given libcompiler_rt is a static archive, we could probably safely link >> against it directly unlike libc where we have to pick specific object >> files. >> >> -- >> John Baldwin > > Sorry, I wasn't aware of your review. Do you want this backed out? No. I do have other patches you can see in that review stack that might be relevant for GCC 9. Some of them I should push as they've been reviewed, but not all of them are ok'd I think. > I did see the arm path. I think it is not quite right, because > libcompiler_rt is compiled with -fstack-protector-strong, which is not > compatible with rtld. However, it will work in practice if stack > protection doesn't actually get used on any linked function. Hmm, ok. I think it's fine to use the current approach then, and perhaps fix arm to match it and keep SSP out of rtld. -- John Baldwin