]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Don't override 'LIBS' if '--enable-languages=rust'; use 'CRAB1_LIBS'
authorThomas Schwinge <tschwinge@baylibre.com>
Mon, 5 Aug 2024 08:06:05 +0000 (10:06 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Mon, 5 Aug 2024 08:14:18 +0000 (10:14 +0200)
Recent commit 6fef4d6ffcab0fec8518adcb05458cba5dbeac25
"gccrs: libgrust: Add format_parser library", added a general override of
'LIBS += -ldl -lpthread' if '--enable-languages=rust'.  This is wrong
conceptually, and will make the build fail on systems not providing such
libraries.  Instead, 'CRAB1_LIBS', added a while ago in
commit 75299e4fe50aa8d9b3ff529e48db4ed246083e64
"rust: Do not link with libdl and libpthread unconditionally", should be used,
and not generally, but for 'crab1' only.

gcc/rust/
* Make-lang.in (LIBS): Don't override.
(crab1$(exeext):): Use 'CRAB1_LIBS'.

gcc/rust/Make-lang.in

index 24229c02770dfdd2a5c4cc88e0a0b214f47905fd..c3be5f9d81b5ac28a1615898f0e5ce5c65fceda5 100644 (file)
@@ -54,8 +54,6 @@ GCCRS_D_OBJS = \
    rust/rustspec.o \
    $(END)
 
-LIBS += -ldl -lpthread
-
 gccrs$(exeext): $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
        +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
          $(GCCRS_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
@@ -237,7 +235,7 @@ RUST_LIBDEPS = $(LIBDEPS) $(LIBPROC_MACRO_INTERNAL)
 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) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
+             $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) $(CRAB1_LIBS) $(LIBPROC_MACRO_INTERNAL) $(LIBFORMAT_PARSER) $(BACKENDLIBS)
        @$(call LINK_PROGRESS,$(INDEX.rust),end)
 
 # Build hooks.