gccrs: libproc_macro: Build statically

We do not need dynamic linking, all use case of this library cover can
be done statically hence the change.

gcc/rust/ChangeLog:

	* Make-lang.in: Link against the static libproc_macro.

libgrust/ChangeLog:

	* Makefile.am: Remove libtool forwarding.
	* Makefile.in: Regenerate.
	* libproc_macro/Makefile.am: Creates an archive instead
	of using libtool.
	* libproc_macro/Makefile.in: Regenerate.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
Pierre-Emmanuel Patry 2023-04-26 10:31:35 +02:00 committed by Arthur Cohen
parent b1a8cb2fbf
commit 71180a9eed
5 changed files with 13 additions and 17 deletions

View File

@ -182,11 +182,14 @@ RUST_ALL_OBJS = $(GRS_OBJS) $(RUST_TARGET_OBJS)
rust_OBJS = $(RUST_ALL_OBJS) rust/rustspec.o
RUST_LDFLAGS = $(LDFLAGS) -L./../libgrust/libproc_macro
RUST_LIBDEPS = $(LIBDEPS) ../libgrust/libproc_macro/libproc_macro.a
# The compiler itself is called crab1
crab1$(exeext): $(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBDEPS) $(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) $(BACKENDLIBS)
+$(LLINKER) $(ALL_LINKERFLAGS) $(RUST_LDFLAGS) -o $@ \
$(RUST_ALL_OBJS) attribs.o $(BACKEND) $(LIBS) ../libgrust/libproc_macro/libproc_macro.a $(BACKENDLIBS)
@$(call LINK_PROGRESS,$(INDEX.rust),end)
# Build hooks.
@ -355,7 +358,8 @@ RUST_INCLUDES = -I $(srcdir)/rust \
-I $(srcdir)/rust/checks/errors \
-I $(srcdir)/rust/checks/errors/privacy \
-I $(srcdir)/rust/util \
-I $(srcdir)/rust/metadata
-I $(srcdir)/rust/metadata \
-I $(srcdir)/../libgrust
# add files that require cross-folder includes - currently rust-lang.o, rust-lex.o
CFLAGS-rust/rust-lang.o += $(RUST_INCLUDES)

View File

@ -11,9 +11,6 @@ TOP_GCCDIR := $(shell cd $(top_srcdir) && cd .. && pwd)
GCC_DIR = $(TOP_GCCDIR)/gcc
RUST_SRC = $(GCC_DIR)/rust
toolexeclibdir=@toolexeclibdir@
toolexecdir=@toolexecdir@
SUBDIRS = libproc_macro
RUST_BUILDDIR := $(shell pwd)
@ -62,7 +59,6 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)" \
"TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \
"TARGET_LIB_PATH_libgrust=$(TARGET_LIB_PATH_libgrust)" \
"LIBTOOL=$(RUST_BUILDDIR)/libtool"
"TARGET_LIB_PATH_librust=$(TARGET_LIB_PATH_librust)"
include $(top_srcdir)/../multilib.am

View File

@ -355,8 +355,7 @@ AM_MAKEFLAGS = \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)" \
"TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \
"TARGET_LIB_PATH_libgrust=$(TARGET_LIB_PATH_libgrust)" \
"LIBTOOL=$(RUST_BUILDDIR)/libtool"
"TARGET_LIB_PATH_librust=$(TARGET_LIB_PATH_librust)"
MULTISRCTOP =
MULTIBUILDTOP =

View File

@ -2,7 +2,7 @@ SUFFIXES = .cc .o .a .lo .la
ACLOCAL_AMFLAGS = -I .. -I ../../config
AR=@AR@
AR = @AR@
AR_FLAGS = rc
# Work around what appears to be a GNU make bug handling MAKEFLAGS
@ -48,13 +48,11 @@ AM_MAKEFLAGS = \
"TARGET_LIB_PATH=$(TARGET_LIB_PATH)"
TARGETLIB = ./libproc_macro.a
LIBOBJS = @LIBOBJS@
objext = @OBJEXT@
REQUIRED_OFILES = \
./proc_macro.$(objext)
./proc_macro.$(objext) ./literal.$(objext) ./group.$(objext) ./ident.$(objext) ./punct.$(objext) ./tokenstream.$(objext) ./tokentree.$(objext)
all: $(TARGETLIB)
@ -62,4 +60,3 @@ $(TARGETLIB): $(REQUIRED_OFILES) $(LIBOBJS)
-rm -f $(TARGETLIB)
$(AR) $(AR_FLAGS) $(TARGETLIB) \
$(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)

View File

@ -311,7 +311,7 @@ AM_MAKEFLAGS = \
TARGETLIB = ./libproc_macro.a
objext = @OBJEXT@
REQUIRED_OFILES = \
./proc_macro.$(objext)
./proc_macro.$(objext) ./literal.$(objext) ./group.$(objext) ./ident.$(objext) ./punct.$(objext) ./tokenstream.$(objext) ./tokentree.$(objext)
all: all-am