diff options
author | rlibby <rlibby@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-12-19 08:38:31 +0000 |
---|---|---|
committer | rlibby <rlibby@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f> | 2020-12-19 08:38:31 +0000 |
commit | 373066b74a4ed7f536babcb3e363c832e95c9261 (patch) | |
tree | b34255baa7c5ff56e8958e409240292df9d779c7 | |
parent | 76df4d9a40fd96eb41e1a4ab7721ebb6423728cf (diff) | |
download | freebsd-373066b74a4ed7f536babcb3e363c832e95c9261.tar.gz freebsd-373066b74a4ed7f536babcb3e363c832e95c9261.tar.bz2 |
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
git-svn-id: http://svn.freebsd.org/base/head@368789 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
-rw-r--r-- | libexec/rtld-elf/rtld-libc/Makefile.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld-libc/Makefile.inc b/libexec/rtld-elf/rtld-libc/Makefile.inc index 88f13c8db8c..e0d05d19440 100644 --- a/libexec/rtld-elf/rtld-libc/Makefile.inc +++ b/libexec/rtld-elf/rtld-libc/Makefile.inc @@ -51,8 +51,12 @@ _libc_other_objects= sigsetjmp lstat stat fstat fstatat fstatfs syscall \ getdirentries _getdirentries _close _fcntl _open _openat _read \ _sigprocmask _write readlink __realpathat _setjmp setjmp setjmperr +# Allow building files from libcompiler_rt. Beware, there are some name +# collisions between libcompiler_rt files and libc files. +CRTSRC= ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins +.PATH: ${CRTSRC} -# Finally add additional architecture-dependent libc dependencies +# Finally add additional architecture-dependent dependencies .if ${LIBC_ARCH} == "arm" # ARM needs aeabi_unwind_cpp for _setjmp _libc_other_objects+=aeabi_unwind_cpp @@ -60,6 +64,7 @@ _libc_other_objects+=aeabi_unwind_cpp # __udivdi3 is needed by kvprintf() in rtld_printf.c # i386 also needs i386_set_gsbase for allocate_initial_tls() _libc_other_objects+=umoddi3 udivdi3 qdivrem i386_set_gsbase +SRCS+= udivmoddi4.c .elif ${LIBC_ARCH} == "powerpc" || ${LIBC_ARCH} == "powerpcspe" # ppc needs __syncicache for reloc.c and __umoddi3+__udivdi3 for rtld_printf.c _libc_other_objects+=syncicache umoddi3 udivdi3 qdivrem |