From nobody Wed Mar 22 22:28:39 2023 X-Original-To: dev-commits-src-all@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 4Phjml6qS8z41P6n; Wed, 22 Mar 2023 22:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Phjml5z7Yz3j2q; Wed, 22 Mar 2023 22:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gHvJSt6Mzx+LaYzlg77YLzBDzk4RkCUUZNojo+csyE=; b=GXdBUcAaIzm5HtHlrJWt/QPUxFlxe1tmHx4Pbgl2j4xxoqvwiulQpkJBZF+OYBWXN4IYW9 N+8jKrYrFBlKZMv1ZVxiZKTPOSv3R05Fe1FIxgHHTdG5vWvk52fcTR8q7vKSgCt2V/XX6l KHgXaSI6I4YUlOXH4ptP6wWUrNa7phzseASclINQ/jvq34xIlh+VbzIq10S1Hfnc3O2Ujr lLBvuPodVaDc4BLpLyOGB2B7EphEQc8e0FcEjXZBpl9yOiuRjuhUvV8gHQ3hMKZqHdMNTB 5I8qW5kSjIXx2RvYzZTJa0R67WrZo+HF2ILRVi5dNGFJMTBj4e/6iMjyFBsbzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679524119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7gHvJSt6Mzx+LaYzlg77YLzBDzk4RkCUUZNojo+csyE=; b=yPRZ9w9eC8DS6VeisW1sbXdg+zDyS5+/1dLITzMRcQZmASJlF0Pg+fyaveG2jQKplprAgh vjWdpDx4MU2LoyY+VBiWPZAT5xofSomlsbNG83FB4+8afhddrxmJdRwNp/+yQLPqquNLHR eCg+LbGdSe+l28FyWxUtaziJ21zQ9669Tdzmk22pdVmtrseV1nONHfOFkZYNTGvK7HevDL 6wjODq3YPCXxxpS97mhpRJFEHaZr3s8Yw9hbmDyE1gwGtDJPHeBTjSGC3uH9aR2MenIxqZ bnBByZIOaExUOgmZ1mrz9zthDoCF/25vYhTptAEHgWwzRTnPlPt5Y2JRRE+XNg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679524119; a=rsa-sha256; cv=none; b=nFo4iXHjQjjpjiCdUbfCEYrpVrsAFTge9Szd0S7M7T4GJ5YUFbQ1oZUHYlC7j/euMz5laK UlGiE0Jot1Do49mxrF0RSYs+FRJjyWto2xhjy38DMrTM86Qr90n4sIhR/StqdFHPtB7FoD 2+AYxvFhsqGkfEOcluouiq8u7CaJVla/GAI6+6YXqV/vY3I49tzy9xVcgR8TlDSaxYX+3i FQ+adHgbVgSk7dbscqHTAtVc2uQhLIYRhOFWBqmbigSWkr6s4Ealgzy/12gCtSpxPM0kBP tNz8lQtjVPfsU0EIcf6BLA9tJVgMaNd86RtJp2RHkU4aYo1fQUGBGquOvhhSCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Phjml50rlz1BPF; Wed, 22 Mar 2023 22:28:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32MMSdNe001844; Wed, 22 Mar 2023 22:28:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32MMSdiZ001843; Wed, 22 Mar 2023 22:28:39 GMT (envelope-from git) Date: Wed, 22 Mar 2023 22:28:39 GMT Message-Id: <202303222228.32MMSdiZ001843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: fd153a0a4cfc - stable/12 - rtld-elf: link libcompiler_rt on all architectures List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fd153a0a4cfc180241a8a43e19fbe135cef4868c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fd153a0a4cfc180241a8a43e19fbe135cef4868c commit fd153a0a4cfc180241a8a43e19fbe135cef4868c Author: Ryan Libby AuthorDate: 2020-12-28 08:44:25 +0000 Commit: John Baldwin CommitDate: 2023-03-22 19:22:25 +0000 rtld-elf: link libcompiler_rt on all architectures Statically link rtld-elf with libcompiler_rt on all architectures so that we don't need to try to pick and choose the bits we need from it for each architecture (we now leave that to the linker). Compilers may emit calls to support functions in this library, but because of the use of the linker flag -nostdlib for rtld's special needs, the library is not linked as normal. Previously we had two different solutions. On some architectures, we were able to extract reimplementations of the necessary builtin functions from our special build of libc. On ARM, we just linked libcompiler_rt. This is motivated by the same issue as D26199 and D27665, but should be a simpler solution that will apply to all architectures. Reviewed by: arichardson, kib Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27736 (cherry picked from commit 63f93c7e11e33149429ddc2831cd1683b2e7f3e1) --- libexec/rtld-elf/Makefile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile index a51acf68068a..dfa6d4e6b85e 100644 --- a/libexec/rtld-elf/Makefile +++ b/libexec/rtld-elf/Makefile @@ -68,14 +68,6 @@ LIBADD= c_nossp_pic LDFLAGS+= -L${LIBCDIR} .endif -.if ${MACHINE_CPUARCH} == "arm" -# Some of the required math functions (div & mod) are implemented in -# libcompiler_rt on ARM. The library also needs to be placed first to be -# correctly linked. As some of the functions are used before we have -# shared libraries. -LIBADD+= compiler_rt -.endif - .if ${MK_SYMVER} == "yes" @@ -103,6 +95,10 @@ beforeinstall: HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +# Some of the required math functions (div & mod) are implemented in +# libcompiler_rt on some architectures. +LIBADD+= compiler_rt + .include ${PROG_FULL}: ${VERSION_MAP} .include