public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Fangrui Song <maskray@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/google/grte/v5-2.27/master] Use crt*.o files from llvm compiler-rt when building with clang Date: Sat, 28 Aug 2021 00:37:33 +0000 (GMT) [thread overview] Message-ID: <20210828003733.129963858423@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e62db8fce49a3437dbda71e4b7058954595939f5 commit e62db8fce49a3437dbda71e4b7058954595939f5 Author: Stan Shebs <stanshebs@google.com> Date: Tue Jun 9 10:09:34 2020 -0700 Use crt*.o files from llvm compiler-rt when building with clang Diff: --- Makeconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makeconfig b/Makeconfig index ff744a8f0d..f5cd92014f 100644 --- a/Makeconfig +++ b/Makeconfig @@ -661,20 +661,40 @@ libc.so-gnulib := -lgcc endif +preinit = $(addprefix $(csu-objpfx),crti.o) +postinit = $(addprefix $(csu-objpfx),crtn.o) +ifeq ($(with-clang),yes) +# With clang, use the crt*.o files from llvm's compiler-rt package. +# The files normally have an architecture name appended, in case of +# variants (32/64, le/be etc) installed in the same directory. ++prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=clang_rt.crtbegin-$(config-machine).o` ++postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=clang_rt.crtend-$(config-machine).o` +else +prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o` +postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o` +endif # Variants of the two previous definitions for linking PIE programs. +ifeq ($(with-clang),yes) +# compiler-rt crt*.o also works for PIE. ++prectorS = $(+prector) ++postctorS = $(+postctor) +else +prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o` +postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o` +endif # Variants of the two previous definitions for statically linking programs. ifeq (yes,$(enable-static-pie)) # Static PIE must use PIE variants. +prectorT = $(+prectorS) +postctorT = $(+postctorS) else +ifeq ($(with-clang),yes) +# compiler-rt crt*.o also works for static PIE. ++prectorT = $(+prector) ++postctorT = $(+postctor) +else +prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o` +postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o` endif +endif csu-objpfx = $(common-objpfx)csu/ elf-objpfx = $(common-objpfx)elf/
next reply other threads:[~2021-08-28 0:37 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-28 0:37 Fangrui Song [this message] -- strict thread matches above, loose matches on Subject: below -- 2020-06-09 17:10 Stan Shebs
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210828003733.129963858423@sourceware.org \ --to=maskray@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).