Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Mar 2023 22:28:39 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: fd153a0a4cfc - stable/12 - rtld-elf: link libcompiler_rt on all architectures
Message-ID:  <202303222228.32MMSdiZ001843@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=fd153a0a4cfc180241a8a43e19fbe135cef4868c

commit fd153a0a4cfc180241a8a43e19fbe135cef4868c
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2020-12-28 08:44:25 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
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 <bsd.prog.mk>
 ${PROG_FULL}:	${VERSION_MAP}
 .include <bsd.symver.mk>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202303222228.32MMSdiZ001843>