From patchwork Wed Sep 20 11:59:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 142375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4082200vqi; Wed, 20 Sep 2023 05:04:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGcbnlAgIE5f0+qlnwVOurEB2jOazQA+YDYw7MvjdhFsQKA+IENotv+sTM1t8GHiTrYTFOn X-Received: by 2002:a17:907:7885:b0:99c:55ac:3a61 with SMTP id ku5-20020a170907788500b0099c55ac3a61mr1926430ejc.56.1695211447342; Wed, 20 Sep 2023 05:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695211447; cv=none; d=google.com; s=arc-20160816; b=Jq5nMPoRavOXi2EOhm7PDUoWD4T3utbdFznGL3p3AAggoGF/T3+4YXeFMIOtFvLK9s +hT2bd+k62eV1Z1pgjrQLaP7a08A18jFW7JRZkT50ZnohPzey1W0i8z7uW+nlE3mQDTM 2d7+UzPt1HGQ8z/t4bU9n/43fppbJNVtyC7YF6XS2xt9Tcz4JO3Xx95Dl6xxv6TCyJH7 NOiDquSMUQDvjGEVLOcyLV5XWZ7itleKDnXSXrEu7qc6bKe1oNfBnvgS8EUZBtfE8uMC 7K3Tn7m86PPG5gKh+UxKh8sqJ5Vxqwa6hBOufgyNWG8XBwa1fbwaHgyRq13IhZbhOkaF 8XRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :dmarc-filter:delivered-to; bh=0IrGLzGi1C3xCFPvhguXJdXBknbPu+QMPO2VRXRcWOw=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=qwap9mIXw30B1LfoaeARRz+KXkcPlNRW9tD5YNtccCo0LN+zOLAZKztEp8SOkE8ZMb 3X8bGyklu4GAcG9i2Z4vFchfcr18g8Jd0HuodlMj05wab6wXnKoWgbeoopK7kIFCmH8x K19Yq+eRqNZZ18Wdjosw37FYPboUCCR35CKLrXE2CaMiW7C0fCvbkSwLCZjJPkph3bmm QIFfw/rkhuYpLXRgmCF5lz3+phZ6eLkSJmCs+QCKSQThsPs9XnuyLX5BFkKRtlds7+Xg d2U35OXqsOx4N7ZiBhfgQwv2gUpCNHRlaDKyM+5vnOCOs6RDDPM7faMj4mSDF5Q4VugT zGcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=Fqqo7sx6; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id pk10-20020a170906d7aa00b00992d2630d08si11549972ejb.788.2023.09.20.05.04.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:04:07 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=Fqqo7sx6; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 489CA3861822 for ; Wed, 20 Sep 2023 12:03:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 364543858407 for ; Wed, 20 Sep 2023 12:02:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 364543858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-405082a8c77so35776475e9.0 for ; Wed, 20 Sep 2023 05:02:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1695211377; x=1695816177; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=0IrGLzGi1C3xCFPvhguXJdXBknbPu+QMPO2VRXRcWOw=; b=Fqqo7sx6IiBTsrrz/WZV00IIsDurwMdXMy8/B/SnD1BnEjp20f/iUQGvXUvtXTToLB ufz93oZN4pn7XgpgkG+j4DBcoaPY8Ah3FX0Z2CukSD9/VSmKY29Y3GNtdZ9H4k0ERC4y DEduV3O/SfkBgp5W1WbJMuOMqxlIbx8wnYAzU7cDUmhSiMfhhMTAalsuvr3KE0rwSu/D MHW+tIJ7gu6Lh8RVW2nj/TpyRc5+YirKQ2nKp6SjxxTL7fte5wk5f+x5I7SAR2VjbVfZ mGGbRrtI3vv+l8YrfMhnlLXxwTNmfYd09+EE/JXk5DhTvrjfge8iYf64kjFIW8vA2Xsz 2r+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695211377; x=1695816177; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0IrGLzGi1C3xCFPvhguXJdXBknbPu+QMPO2VRXRcWOw=; b=Fir0i90JZyZK/MC2Yv4skCg66nxwTfvkTZV2IdEVXdamPiwOsN98nvkG6fFyKj2ODt /aEAIruoLKIl19JfWsjb0NslZjz5lFrEQO6MTNFeeT0ncuJHMFfo9NlposRUzPlS35xz ogcjeWNaqUPFgwxiPWk3jN0fa9nbgcHabQbhjDKx87AnLjniiYRnl94Sabd9IP6DG7o8 v9CFdgl5tQ/mIOQ5juMQ3cv5YwNECca/1Yj5DznKRJtR7ssmDymEwudsHT7PmNR/exLe E+vvnRovs61c7cdCykj0JfNlUgnX0yJ2hVPNpM6aJ4H0A01vMfgW3vp3xHzJEGd6Ollx 6POg== X-Gm-Message-State: AOJu0YwaKRx6YLjs3P11Jx5k64/f+aR5u5OozVJc/Rhk8Af4yFcqrgEz AmMQf4f7PPydYqYN1+v6It5ukMwRphIrxW1HhHTa X-Received: by 2002:a7b:cd9a:0:b0:3fe:5053:1a0b with SMTP id y26-20020a7bcd9a000000b003fe50531a0bmr2100916wmj.11.1695211376241; Wed, 20 Sep 2023 05:02:56 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c6-20020a7bc846000000b003fe29dc0ff2sm1782020wml.21.2023.09.20.05.02.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:02:55 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 1/3] librust: Add libproc_macro and build system Date: Wed, 20 Sep 2023 13:59:51 +0200 Message-ID: <20230920120311.14892-1-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777558038776637536 X-GMAIL-MSGID: 1777558038776637536 From: Pierre-Emmanuel Patry This patch series adds the build system changes to allow the Rust frontend to develop and distribute its own libraries. The first library we have been working on is the `proc_macro` library, comprised of a C++ library as well as a user-facing Rust library. Follow up commits containing the actual library code will be committed. Should I submit patches to the MAINTAINERS file to allow Philip and I to commit to this folder without first approval? This first commit adds a simple `libgrust` folder with on top of which the full library will be built. All the best, Arthur ----- Add some dummy files in libproc_macro along with it's build system. ChangeLog: * libgrust/Makefile.am: New file. * libgrust/configure.ac: New file. * libgrust/libproc_macro/Makefile.am: New file. * libgrust/libproc_macro/proc_macro.cc: New file. * libgrust/libproc_macro/proc_macro.h: New file. Signed-off-by: Pierre-Emmanuel Patry --- libgrust/Makefile.am | 68 ++++++++++++++++ libgrust/configure.ac | 113 +++++++++++++++++++++++++++ libgrust/libproc_macro/Makefile.am | 58 ++++++++++++++ libgrust/libproc_macro/proc_macro.cc | 7 ++ libgrust/libproc_macro/proc_macro.h | 7 ++ 5 files changed, 253 insertions(+) create mode 100644 libgrust/Makefile.am create mode 100644 libgrust/configure.ac create mode 100644 libgrust/libproc_macro/Makefile.am create mode 100644 libgrust/libproc_macro/proc_macro.cc create mode 100644 libgrust/libproc_macro/proc_macro.h diff --git a/libgrust/Makefile.am b/libgrust/Makefile.am new file mode 100644 index 00000000000..8e5274922c5 --- /dev/null +++ b/libgrust/Makefile.am @@ -0,0 +1,68 @@ +AUTOMAKE_OPTIONS = 1.8 foreign + +SUFFIXES = .c .rs .def .o .lo .a + +ACLOCAL_AMFLAGS = -I . -I .. -I ../config + +AM_CFLAGS = -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/include + +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) + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "GCC_DIR=$(GCC_DIR)" \ + "RUST_SRC=$(RUST_SRC)" \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "RUST_FOR_TARGET=$(RUST_FOR_TARGET)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "includedir=$(includedir)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" \ + "gxx_include_dir=$(gxx_include_dir)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "LD=$(LD)" \ + "RANLIB=$(RANLIB)" \ + "NM=$(NM)" \ + "NM_FOR_BUILD=$(NM_FOR_BUILD)" \ + "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ + "DESTDIR=$(DESTDIR)" \ + "WERROR=$(WERROR)" \ + "TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \ + "TARGET_LIB_PATH_librust=$(TARGET_LIB_PATH_librust)" \ + "LIBTOOL=$(RUST_BUILDDIR)/libtool" + +include $(top_srcdir)/../multilib.am diff --git a/libgrust/configure.ac b/libgrust/configure.ac new file mode 100644 index 00000000000..7aed489a643 --- /dev/null +++ b/libgrust/configure.ac @@ -0,0 +1,113 @@ +AC_INIT([libgrust], version-unused,,librust) +AC_CONFIG_SRCDIR(Makefile.am) +AC_CONFIG_FILES([Makefile]) + +# AM_ENABLE_MULTILIB(, ..) + +# Do not delete or change the following two lines. For why, see +# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html +AC_CANONICAL_SYSTEM +target_alias=${target_alias-$host_alias} +AC_SUBST(target_alias) + +# Automake should never attempt to rebuild configure +AM_MAINTAINER_MODE + +AM_INIT_AUTOMAKE([1.15.1 foreign no-dist -Wall]) + +# Make sure we don't test executables when making cross-tools. +GCC_NO_EXECUTABLES + + +# Add the ability to change LIBTOOL directory +GCC_WITH_TOOLEXECLIBDIR + +# Use system specific extensions +AC_USE_SYSTEM_EXTENSIONS + + +# Checks for header files. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h \ + time.h sys/stat.h wchar.h) + +# Check for tools +AM_PROG_AR +AC_PROG_CC +AC_PROG_CXX +AM_PROG_AS +AC_PROG_MAKE_SET +AC_PROG_INSTALL + +# Enable libtool +LT_INIT + +# target_noncanonical variables... +AC_CANONICAL_HOST +ACX_NONCANONICAL_HOST +ACX_NONCANONICAL_TARGET +GCC_TOPLEV_SUBDIRS + +AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) +AC_ARG_ENABLE(version-specific-runtime-libs, +[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], +[case "$enableval" in + yes) version_specific_libs=yes ;; + no) version_specific_libs=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[version_specific_libs=no]) +AC_MSG_RESULT($version_specific_libs) + +toolexecdir=no +toolexeclibdir=no + +# Calculate toolexeclibdir +# Also toolexecdir, though it's only used in toolexeclibdir +case ${version_specific_libs} in + yes) + # Need the gcc compiler version to know where to install libraries + # and header files if --enable-version-specific-runtime-libs option + # is selected. + toolexecdir='$(libdir)/gcc/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + ;; + no) + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + # Install a library built with a cross compiler in tooldir, not libdir. + toolexecdir='$(exec_prefix)/$(target_noncanonical)' + toolexeclibdir='$(toolexecdir)/lib' + else + toolexecdir='$(libdir)/gcc-lib/$(target_noncanonical)' + toolexeclibdir='$(libdir)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; + esac + ;; +esac + +AC_SUBST(toolexecdir) +AC_SUBST(toolexeclibdir) + + +AC_CONFIG_FILES(AC_FOREACH([DIR], [libproc_macro], [DIR/Makefile ]), + [ cat > vpsed$$ << \_EOF +s!`test -f '$<' || echo '$(srcdir)/'`!! +_EOF + sed -f vpsed$$ $ac_file > tmp$$ + mv tmp$$ $ac_file + rm vpsed$$ + echo 'MULTISUBDIR =' >> $ac_file + ml_norecursion=yes + AS_UNSET([ml_norecursion]) +]) + + +AC_MSG_NOTICE([librust has been configured.]) + +AC_OUTPUT diff --git a/libgrust/libproc_macro/Makefile.am b/libgrust/libproc_macro/Makefile.am new file mode 100644 index 00000000000..1e61d12e506 --- /dev/null +++ b/libgrust/libproc_macro/Makefile.am @@ -0,0 +1,58 @@ +SUFFIXES = .cc .o .a .lo .la + +ACLOCAL_AMFLAGS = -I .. -I ../../config + +toolexeclibdir=@toolexeclibdir@ +toolexecdir=@toolexecdir@ + +# Work around what appears to be a GNU make bug handling MAKEFLAGS +# values defined in terms of make variables, as is the case for CC and +# friends when we are called from the top level Makefile. +AM_MAKEFLAGS = \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "MAKE=$(MAKE)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ + "PICFLAG=$(PICFLAG)" \ + "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \ + "SHELL=$(SHELL)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "exec_prefix=$(exec_prefix)" \ + "infodir=$(infodir)" \ + "libdir=$(libdir)" \ + "includedir=$(includedir)" \ + "prefix=$(prefix)" \ + "tooldir=$(tooldir)" \ + "gxx_include_dir=$(gxx_include_dir)" \ + "AR=$(AR)" \ + "AS=$(AS)" \ + "LD=$(LD)" \ + "RANLIB=$(RANLIB)" \ + "NM=$(NM)" \ + "NM_FOR_BUILD=$(NM_FOR_BUILD)" \ + "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ + "DESTDIR=$(DESTDIR)" \ + "WERROR=$(WERROR)" \ + "TARGET_LIB_PATH=$(TARGET_LIB_PATH)" \ + "TARGET_LIB_PATH_libgm2=$(TARGET_LIB_PATH_libgm2)" + +toolexeclib_LTLIBRARIES = libproc_macro.la + +libproc_macro_la_SOURCES = \ + proc_macro.cc + +include_HEADERS = \ + proc_macro.h + diff --git a/libgrust/libproc_macro/proc_macro.cc b/libgrust/libproc_macro/proc_macro.cc new file mode 100644 index 00000000000..d13276294aa --- /dev/null +++ b/libgrust/libproc_macro/proc_macro.cc @@ -0,0 +1,7 @@ +#include "proc_macro.h" + +int +test () +{ + return 0; +} diff --git a/libgrust/libproc_macro/proc_macro.h b/libgrust/libproc_macro/proc_macro.h new file mode 100644 index 00000000000..2c96b3de685 --- /dev/null +++ b/libgrust/libproc_macro/proc_macro.h @@ -0,0 +1,7 @@ +#ifndef PROC_MACRO_H +#define PROC_MACRO_H + +int +test (); + +#endif /* ! PROC_MACRO_H */ From patchwork Wed Sep 20 11:59:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 142376 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4082260vqi; Wed, 20 Sep 2023 05:04:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUFrmXEqpW1/9X8GkN9pyp2D1yQ++4arXLPy7XcxNy/MesJpXebg1c2nS+jRlwyjddSL78 X-Received: by 2002:a17:906:314b:b0:994:555a:e49f with SMTP id e11-20020a170906314b00b00994555ae49fmr2214019eje.31.1695211452033; Wed, 20 Sep 2023 05:04:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695211452; cv=none; d=google.com; s=arc-20160816; b=KgAXmGiqRfVx7SVTpts8myCSs2QIh+h0AzSpqox8IhPw2PRUXYTDf8217LQx8Vj2X8 elYtmq6RT1dtQRrOol+Guoltnr2pdeVQqIIHxozx+Jv88jtAkxQIecPt0Sbdg93jFUos zKnuhbZo3ejdcR74PrMQiFgctRXhc4OPUhFKVI2GL0JABBDYx/j5kinfRo8icDpMNDCW CI/c6swIzpeQ66w6FBoBFYPGsfqwfGPTqobzXrAtS0pUeqUyQkj9pnHMqsmvUkHvXEGK 85D5E5UAztPsdR+JDKmtsKZRqfH4rIq7wc2KLPbfPjyXa/O9ww8lUngjYKXTlasYoxom U/hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=eP5PyHzsyHSKt1v9BCO2buhNn/+ksBjKp6ZZ3PKBdhE=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=K+I4Xi82LZEEhibXuRT8QMl4J0P7PzuoXaafn/R4NlcqQd8OBM7LpGnQNQhUMKiF22 9uSnpYhfivEiDQgv8RB1yL7bWToJaQ+VCaXWg2yoohMEOxPHr3BgLAIF26mq34ycbjtl cExG1eTp3WcOEhcn0NmtPZIqpOb+zdQ5ku0s+/CUk3sz73IMC+u0Z9D4USKGqIwduwAK x2nwrTRaJDHo03Mu46MeVIM5q999qHbW8tvSG6ZRemTrasPFt+E09p9O3Fhu/aJWBDS7 1vc0zlYrepQinj4CcSN+lRVTUqZTTXEdbCpYYfPsn+zrAbkxCLjScHHSVgVj0agPdEAQ Nsrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=Ro3f8DVh; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id dk24-20020a170906f0d800b009930f844671si11801748ejb.963.2023.09.20.05.04.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:04:12 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=Ro3f8DVh; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC3D3386183C for ; Wed, 20 Sep 2023 12:03:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id B38DF3858410 for ; Wed, 20 Sep 2023 12:03:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B38DF3858410 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-401b393ddd2so75314635e9.0 for ; Wed, 20 Sep 2023 05:03:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1695211387; x=1695816187; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eP5PyHzsyHSKt1v9BCO2buhNn/+ksBjKp6ZZ3PKBdhE=; b=Ro3f8DVhgRhPA5zMN5AmQ9u1M+4DV9TgmuPyTwv6cAATz76lpD38oepjF2Tdt8UbBP ApJr2KhiRpGbZ9s66Gk4drEx5UNioipp0BbY23/r9Pof5J+/u9wV9Cxj41W7HuqeVHRJ 9uMXD9Lxlo2KJzQ02PB+CEsSCKMA5agB5NG7H1XXkus6yxuZRqm+kYUJyu4I0ULeo0a6 kN74SjIfKCPCjej+c0wpEOuucTghsLTQVpNDU1/8s2oZzY71eSPR55rMj4Wp11e2JCsT xMLJohAEyr+0kS4+Hh/PbPqUvOjvut1OHETAmkIphtXelAg2aemqJamFI4k8nxEb8LKu vjsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695211387; x=1695816187; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eP5PyHzsyHSKt1v9BCO2buhNn/+ksBjKp6ZZ3PKBdhE=; b=gFWYHBClCK9AqL8dm7Jf5ppR0idj9UCRwu4DWBIhD6wJScElW/3FqlS0OjuU/bZ0fA D/vaohcVth7LoF3k8IWPgzA9JquuVKv7VAebqtQQKZ1ZxXrOJ9SgjnoiUQj4HnuPLYkW 5nj2/czFVV0W7iesSqXiXiTcX/vyZaunfKFafg4NYGA1J7BTgXkUZdhv6V91R3N3RQpB tcVMZtzcc+VW8U9L+tAgUAoASgvcsHi0yNItUBdzkzD3m7opNGVl1akZdd0opAHFYtAS Rk0391Jgqm5kB+HCpPDclo9gUABZNW5uzsjl3ydU0bSPyETnCd4OXe0HC4FDmKh8VKIp EF5g== X-Gm-Message-State: AOJu0Yw6lqlRHLsQ2M80Gt9WN7im2OMShIpQz5HruudcnMwbf06OEmWS xwz4HUXmv+ZutxMq+pOVtFdk7GZ5IIhaY9nG+2iz X-Received: by 2002:a05:600c:241:b0:401:c52c:5ed9 with SMTP id 1-20020a05600c024100b00401c52c5ed9mr2139820wmj.32.1695211386126; Wed, 20 Sep 2023 05:03:06 -0700 (PDT) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c6-20020a7bc846000000b003fe29dc0ff2sm1782020wml.21.2023.09.20.05.03.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 05:03:05 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 2/3] build: Add libgrust as compilation modules Date: Wed, 20 Sep 2023 13:59:53 +0200 Message-ID: <20230920120311.14892-3-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920120311.14892-1-arthur.cohen@embecosm.com> References: <20230920120311.14892-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777558043585707003 X-GMAIL-MSGID: 1777558043585707003 From: Pierre-Emmanuel Patry Define the libgrust directory as a host compilation module as well as for targets. ChangeLog: * Makefile.def: Add libgrust as host & target module. * configure.ac: Add libgrust to host tools list. gcc/rust/ChangeLog: * config-lang.in: Add libgrust as a target module for the rust language. Signed-off-by: Pierre-Emmanuel Patry --- Makefile.def | 2 ++ configure.ac | 3 ++- gcc/rust/config-lang.in | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.def b/Makefile.def index 870150183b9..3df3fc18d14 100644 --- a/Makefile.def +++ b/Makefile.def @@ -149,6 +149,7 @@ host_modules= { module= libcc1; extra_configure_flags=--enable-shared; }; host_modules= { module= gotools; }; host_modules= { module= libctf; bootstrap=true; }; host_modules= { module= libsframe; bootstrap=true; }; +host_modules= { module= libgrust; }; target_modules = { module= libstdc++-v3; bootstrap=true; @@ -192,6 +193,7 @@ target_modules = { module= libgm2; lib_path=.libs; }; target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; }; target_modules = { module= libitm; lib_path=.libs; }; target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; }; +target_modules = { module= libgrust; }; // These are (some of) the make targets to be done in each subdirectory. // Not all; these are the ones which don't have special options. diff --git a/configure.ac b/configure.ac index 1d16530140a..036e5945905 100644 --- a/configure.ac +++ b/configure.ac @@ -133,7 +133,7 @@ build_tools="build-texinfo build-flex build-bison build-m4 build-fixincludes" # these libraries are used by various programs built for the host environment #f -host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe" +host_libs="intl libiberty opcodes bfd readline tcl tk itcl libgui zlib libbacktrace libcpp libcody libdecnumber gmp mpfr mpc isl libiconv libctf libsframe libgrust " # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to @@ -164,6 +164,7 @@ target_libraries="target-libgcc \ target-libada \ target-libgm2 \ target-libgo \ + target-libgrust \ target-libphobos \ target-zlib" diff --git a/gcc/rust/config-lang.in b/gcc/rust/config-lang.in index aac66c9b962..8f071dcb0bf 100644 --- a/gcc/rust/config-lang.in +++ b/gcc/rust/config-lang.in @@ -29,4 +29,6 @@ compilers="rust1\$(exeext)" build_by_default="no" +target_libs="target-libffi target-libbacktrace target-libgrust" + gtfiles="\$(srcdir)/rust/rust-lang.cc"