From 75299e4fe50aa8d9b3ff529e48db4ed246083e64 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Fri, 12 Apr 2024 13:52:18 +0200 Subject: rust: Do not link with libdl and libpthread unconditionally ChangeLog: * Makefile.tpl: Add CRAB1_LIBS variable. * Makefile.in: Regenerate. * configure: Regenerate. * configure.ac: Check if -ldl and -lpthread are needed, and if so, add them to CRAB1_LIBS. gcc/rust/ChangeLog: * Make-lang.in: Remove overazealous LIBS = -ldl -lpthread line, link crab1 against CRAB1_LIBS. --- gcc/rust/Make-lang.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gcc/rust') diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 8db0416..e437c32 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -210,8 +210,11 @@ rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o LIBPROC_MACRO_INTERNAL = ../libgrust/libproc_macro_internal/libproc_macro_internal.a + +RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) + # The compiler itself is called crab1 -crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL) $(rust.prev) +crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(RUST_LIBDEPS) $(rust.prev) @$(call LINK_PROGRESS,$(INDEX.rust),start) +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(LIBPROC_MACRO_INTERNAL) $(BACKENDLIBS) -- cgit v1.1