From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 7633F3857C43; Fri, 27 Oct 2023 14:20:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7633F3857C43 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7633F3857C43 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.129.153 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698416446; cv=none; b=w8EdRMlxg0W66hBQcxYylXpe4QZsxPVQ4airJQPkwkPiMUEiiwRhw40RTCAcszFhQCu9ENEQjXnMmAEofSd3zEUlj49UKS6IPlfIzfBXEnJfGyjVmZf2ssVg1NBzbBmClMCWg1AQjOURe+8LpMcPDS3JgS0WDwr2/a/DR41E0bM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698416446; c=relaxed/simple; bh=URQosF8YSYkk+rR7p6b7KofH5kMOGwA9EmxfkGNkEcw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=AZeayW0dJN+Af34xK+AH8jId8EW8R0iNmYXj978ouobbr2F5kAb6gFhXJLuMXXRHFYTJub7EuJF805kodQg2Ewt/XNuOsekCXDLIRUwjnrurUvE5O2hCFlIQqeeFk+l4f6hS0Ok3mAaBCTE9xHEOxAgheKh6alZRlnc6cInZ88s= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: UyWx1jxsRNuhohqk5FG8JA== X-CSE-MsgGUID: IVCT+pCaSnaHwj/lBxiSQg== X-IronPort-AV: E=Sophos;i="6.03,256,1694764800"; d="scan'208";a="23763673" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 27 Oct 2023 06:20:40 -0800 IronPort-SDR: xDq+tw98gwvU7LQTtHhCY3FhUvp/ReVttOd0AXAi4dAoYWz8ZuH4i4W8CWo3miugi0V5W9hUtO E6GsnA2NLpcfuNMqqXPc9oUiaDkCay0BtgR2ZTebc1oL82uAyrNzL1Bo1ZcI9XYiPrMADYhmAV 3oT4IaBE8QP6bxxvYuEEM4NzRqEoI3n+jVELWlhW3KCr8I37vdg1afDUio0gAAhZhC4l1HJnB1 ed5b/P8JpEw7lYQ5v/tae2Sn9s6rSMF2/N9fwiI1fg1k5CgHzkS2ur+0WbmAxs3zQKDDXgJA1+ D0c= From: Thomas Schwinge To: Iain Sandoe , Arthur Cohen , Pierre-Emmanuel Patry CC: , GCC Patches Subject: Re: [PATCH v2 2/4] libgrust: Add libproc_macro and build system In-Reply-To: <0B027199-B2BD-4CC0-9654-695A0316783A@sandoe.co.uk> References: <20231025110658.1232737-1-arthur.cohen@embecosm.com> <20231025110658.1232737-3-arthur.cohen@embecosm.com> <87edhhu741.fsf@euler.schwinge.homeip.net> <0B027199-B2BD-4CC0-9654-695A0316783A@sandoe.co.uk> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 27 Oct 2023 16:20:34 +0200 Message-ID: <875y2s170t.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_SHORT,SPF_HELO_PASS,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 List-Id: Hi! Short Friday afternoon status update: On 2023-10-27T08:51:12+0100, Iain Sandoe wrote: >> On 26 Oct 2023, at 09:21, Thomas Schwinge wrot= e: >> First, I've pushed into GCC upstream Git branch devel/rust/libgrust-v2 >> the "v2" libgrust changes as posted by Arthur, so that people can easily >> test this before it getting into Git master branch. >> >> I'll myself later try this for GCN and nvptx targets -- in their current >> form where they don't support C++ (standard library) Indeed, this currently fails to build: [...] make[3]: Entering directory `[...]/build-gcc/amdgcn-amdhsa/libgrust/lib= proc_macro' [...] libtool: compile: [...]/build-gcc/./gcc/xg++ -B[...]/build-gcc/./gcc/ = -nostdinc++ -funconfigured-libstdc++-v3 [...] -c [...]/source-gcc/libgrust/= libproc_macro/proc_macro.cc xg++: error: unrecognized command-line option =E2=80=98-funconfigured-l= ibstdc++-v3=E2=80=99 make[3]: *** [proc_macro.lo] Error 1 make[3]: Leaving directory `[...]/build-gcc/amdgcn-amdhsa/libgrust/libp= roc_macro' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `[...]/build-gcc/amdgcn-amdhsa/libgrust' make[1]: *** [all-target-libgrust] Error 2 make[1]: Leaving directory `[...]/build-gcc' make: *** [all] Error 2 ("error: unrecognized command-line option =E2=80=98-funconfigured-libstdc++= -v3=E2=80=99" indeed is the expected outcome if libstdc++ is not available, as I understand.) Same for nvptx-none target. We need two things: (a) make sure that target libgrust build depends on target libstdc++, and (b) disable target libgrust if target libstdc++ is not available (and, later, gracefully handle that situation in the Rust front end). As far as I remember, patches exist for (a), and Arthur is going to integrate/re-submit those. Arthur, before re-submission, feel free to first cherr-pick and push'these into the GCC upstream Git branch devel/rust/libgrust-v2, so that I can re-test. I'm not sure about (b), whether that fell out of the (a) changes, too? I can otherwise look into that later. >> and in my hacky WIP >> trees where C++ (standard library) is supported to some extent. This does built -- but the default multilib only, as Iain already reported: >> (This >> should, roughly, match C++ functionality (not) provided by a number of >> other GCC "embedded" targets.) > > on Darwin, it works for later systems without multilibs, but fails to bui= ld multilibs. I see that, too. > =E2=80=94=E2=80=94 so=E2=80=A6. > > With the patch below bootstrap suceeded on x86_64-darwin17 and produced a= correct > architecture multilib. Confirmed, thanks! > Of course, there is no way to test this at the moment - I=E2=80=99d sugge= st > that the next step might be something small in functionality that can all= ow at least one > test to be wired up. ACK. > ^^^ this is =E2=80=9Clightly tested=E2=80=9D of course, as I cycle throug= h other versions of the OS will see > how it pans out. > > Do you want me to make a PR with this change against upstream? Yes, please. (But no hurry.) Gr=C3=BC=C3=9Fe Thomas > From 027bc2c5255a6f1b75592e896dd99fac55bfb9b8 Mon Sep 17 00:00:00 2001 > From: Iain Sandoe > Date: Thu, 26 Oct 2023 23:19:36 +0100 > Subject: [PATCH] libgrust: enable multilib > > Most of this change is the regenerated files, the multilib config macro > was already present, but commented out. > > libgrust/ChangeLog: > > * Makefile.in: > * aclocal.m4: Regenerate. > * configure: Regenerate. > * configure.ac: Uncomment AM_ENABLE_MULTILIB. > * libproc_macro/Makefile.in: > > Signed-off-by: Iain Sandoe > --- > libgrust/Makefile.in | 2 + > libgrust/aclocal.m4 | 1 + > libgrust/configure | 68 ++++++++++++++++++++++++++++-- > libgrust/configure.ac | 2 +- > libgrust/libproc_macro/Makefile.in | 2 + > 5 files changed, 71 insertions(+), 4 deletions(-) > > diff --git a/libgrust/Makefile.in b/libgrust/Makefile.in > index bc9b6cc227a..2dc39adff24 100644 > --- a/libgrust/Makefile.in > +++ b/libgrust/Makefile.in > @@ -93,6 +93,7 @@ ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4 > am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ > $(top_srcdir)/../config/depstand.m4 \ > $(top_srcdir)/../config/lead-dot.m4 \ > + $(top_srcdir)/../config/multi.m4 \ > $(top_srcdir)/../config/no-executables.m4 \ > $(top_srcdir)/../config/override.m4 \ > $(top_srcdir)/../config/toolexeclibdir.m4 \ > @@ -275,6 +276,7 @@ localedir =3D @localedir@ > localstatedir =3D @localstatedir@ > mandir =3D @mandir@ > mkdir_p =3D @mkdir_p@ > +multi_basedir =3D @multi_basedir@ > oldincludedir =3D @oldincludedir@ > pdfdir =3D @pdfdir@ > prefix =3D @prefix@ > diff --git a/libgrust/aclocal.m4 b/libgrust/aclocal.m4 > index 1bd42c34d74..5d808f05afa 100644 > --- a/libgrust/aclocal.m4 > +++ b/libgrust/aclocal.m4 > @@ -1250,6 +1250,7 @@ AC_SUBST([am__untar]) > m4_include([../config/acx.m4]) > m4_include([../config/depstand.m4]) > m4_include([../config/lead-dot.m4]) > +m4_include([../config/multi.m4]) > m4_include([../config/no-executables.m4]) > m4_include([../config/override.m4]) > m4_include([../config/toolexeclibdir.m4]) > diff --git a/libgrust/configure b/libgrust/configure > index 2756bddd10b..282027873bd 100755 > --- a/libgrust/configure > +++ b/libgrust/configure > @@ -732,6 +732,7 @@ build_os > build_vendor > build_cpu > build > +multi_basedir > target_alias > host_alias > build_alias > @@ -773,6 +774,7 @@ SHELL' > ac_subst_files=3D'' > ac_user_opts=3D' > enable_option_checking > +enable_multilib > enable_maintainer_mode > enable_silent_rules > with_toolexeclibdir > @@ -1421,6 +1423,7 @@ Optional Features: > --disable-option-checking ignore unrecognized --enable/--with options > --disable-FEATURE do not include FEATURE (same as --enable-FEATU= RE=3Dno) > --enable-FEATURE[=3DARG] include FEATURE [ARG=3Dyes] > + --enable-multilib build many library versions (default) > --enable-maintainer-mode > enable make rules and dependencies not useful = (and > sometimes confusing) to the casual installer > @@ -2376,7 +2379,43 @@ ac_compiler_gnu=3D$ac_cv_c_compiler_gnu > ac_config_files=3D"$ac_config_files Makefile" > > > -# AM_ENABLE_MULTILIB(, ..) > +# Default to --enable-multilib > +# Check whether --enable-multilib was given. > +if test "${enable_multilib+set}" =3D set; then : > + enableval=3D$enable_multilib; case "$enableval" in > + yes) multilib=3Dyes ;; > + no) multilib=3Dno ;; > + *) as_fn_error $? "bad value $enableval for multilib option" "$LINEN= O" 5 ;; > + esac > +else > + multilib=3Dyes > +fi > + > + > +# We may get other options which we leave undocumented: > +# --with-target-subdir, --with-multisrctop, --with-multisubdir > +# See config-ml.in if you want the gory details. > + > +if test "$srcdir" =3D "."; then > + if test "$with_target_subdir" !=3D "."; then > + multi_basedir=3D"$srcdir/$with_multisrctop../.." > + else > + multi_basedir=3D"$srcdir/$with_multisrctop.." > + fi > +else > + multi_basedir=3D"$srcdir/.." > +fi > + > + > +# Even if the default multilib is not a cross compilation, > +# it may be that some of the other multilibs are. > +if test $cross_compiling =3D no && test $multilib =3D yes \ > + && test "x${with_multisubdir}" !=3D x ; then > + cross_compiling=3Dmaybe > +fi > + > +ac_config_commands=3D"$ac_config_commands default-1" > + > > # Do not delete or change the following two lines. For why, see > # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html > @@ -12512,7 +12551,7 @@ else > lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 > lt_status=3D$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 12515 "configure" > +#line 12554 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -12618,7 +12657,7 @@ else > lt_dlunknown=3D0; lt_dlno_uscore=3D1; lt_dlneed_uscore=3D2 > lt_status=3D$lt_dlunknown > cat > conftest.$ac_ext <<_LT_EOF > -#line 12621 "configure" > +#line 12660 "configure" > #include "confdefs.h" > > #if HAVE_DLFCN_H > @@ -16804,6 +16843,20 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail= =3D1 > # > # INIT-COMMANDS > # > + > +srcdir=3D"$srcdir" > +host=3D"$host" > +target=3D"$target" > +with_multisubdir=3D"$with_multisubdir" > +with_multisrctop=3D"$with_multisrctop" > +with_target_subdir=3D"$with_target_subdir" > +ac_configure_args=3D"${multilib_arg} ${ac_configure_args}" > +multi_basedir=3D"$multi_basedir" > +CONFIG_SHELL=3D${CONFIG_SHELL-/bin/sh} > +CC=3D"$CC" > +CXX=3D"$CXX" > +GFORTRAN=3D"$GFORTRAN" > +GDC=3D"$GDC" > AMDEP_TRUE=3D"$AMDEP_TRUE" ac_aux_dir=3D"$ac_aux_dir" > > > @@ -17175,6 +17228,7 @@ for ac_config_target in $ac_config_targets > do > case $ac_config_target in > "Makefile") CONFIG_FILES=3D"$CONFIG_FILES Makefile" ;; > + "default-1") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS default-1" ;; > "depfiles") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS depfiles" ;; > "libtool") CONFIG_COMMANDS=3D"$CONFIG_COMMANDS libtool" ;; > "libproc_macro/Makefile") CONFIG_FILES=3D"$CONFIG_FILES libproc_macr= o/Makefile" ;; > @@ -17607,6 +17661,14 @@ $as_echo "$as_me: executing $ac_file commands" >= &6;} > > > case $ac_file$ac_mode in > + "default-1":C) > +# Only add multilib support code if we just rebuilt the top-level > +# Makefile. > +case " $CONFIG_FILES " in > + *" Makefile "*) > + ac_file=3DMakefile . ${multi_basedir}/config-ml.in > + ;; > +esac ;; > "depfiles":C) test x"$AMDEP_TRUE" !=3D x"" || { > # Older Autoconf quotes --file arguments for eval, but not when files > # are listed without --file. Let's play safe and only enable the eval > diff --git a/libgrust/configure.ac b/libgrust/configure.ac > index 7aed489a643..d75aa632462 100644 > --- a/libgrust/configure.ac > +++ b/libgrust/configure.ac > @@ -2,7 +2,7 @@ AC_INIT([libgrust], version-unused,,librust) > AC_CONFIG_SRCDIR(Makefile.am) > AC_CONFIG_FILES([Makefile]) > > -# AM_ENABLE_MULTILIB(, ..) > +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 > diff --git a/libgrust/libproc_macro/Makefile.in b/libgrust/libproc_macro/= Makefile.in > index d3a39736679..46eb6484094 100644 > --- a/libgrust/libproc_macro/Makefile.in > +++ b/libgrust/libproc_macro/Makefile.in > @@ -95,6 +95,7 @@ ACLOCAL_M4 =3D $(top_srcdir)/aclocal.m4 > am__aclocal_m4_deps =3D $(top_srcdir)/../config/acx.m4 \ > $(top_srcdir)/../config/depstand.m4 \ > $(top_srcdir)/../config/lead-dot.m4 \ > + $(top_srcdir)/../config/multi.m4 \ > $(top_srcdir)/../config/no-executables.m4 \ > $(top_srcdir)/../config/override.m4 \ > $(top_srcdir)/../config/toolexeclibdir.m4 \ > @@ -316,6 +317,7 @@ localedir =3D @localedir@ > localstatedir =3D @localstatedir@ > mandir =3D @mandir@ > mkdir_p =3D @mkdir_p@ > +multi_basedir =3D @multi_basedir@ > oldincludedir =3D @oldincludedir@ > pdfdir =3D @pdfdir@ > prefix =3D @prefix@ > -- > 2.39.2 (Apple Git-143) > > >> >> >> Then: >> >> On 2023-10-25T13:06:46+0200, Arthur Cohen wr= ote: >>> From: Pierre-Emmanuel Patry >>> >>> Add some dummy files in libproc_macro along with its build system. >> >> I've not reviewed the build system in detail, just had a very quick look= . >> >> Three instances of 'librust'; should be 'libgrust': >> >> configure.ac:AC_INIT([libgrust], version-unused,,librust) >> >> configure.ac:AC_MSG_NOTICE([librust has been configured.]) >> >> Makefile.am: "TARGET_LIB_PATH_librust=3D$(TARGET_LIB_PATH_libr= ust)" \ >> >> Compared to libgomp (which I'm reasonably familiar with), I found missin= g >> in 'libgrust' at 'configure'-level: >> >> --enable-multilib build many library versions (default) >> >> --disable-werror disable building with -Werror >> >> --enable-symvers=3DSTYLE enables symbol versioning of the shared l= ibrary >> [default=3Dyes] >> >> --enable-cet enable Intel CET in target libraries [defau= lt=3Dauto] >> >> --with-gcc-major-version-only >> use only GCC major number in filesystem pat= hs >> >> I can't tell off-hand whether all these are important, however. >> >> Additionally, the new one that's being discussed in >> >> 'Update libgrust for upstream GCC commit 6a6d3817afa02bbcd2388c8e005da6f= af88932f1 "Config,Darwin: Allow for configuring Darwin to use embedded runp= ath"'. >> >> >> Gr=C3=BC=C3=9Fe >> Thomas >> >> >>> libgrust/Changelog: >>> >>> * Makefile.am: New file. >>> * configure.ac: New file. >>> * libproc_macro/Makefile.am: New file. >>> * libproc_macro/proc_macro.cc: New file. >>> * 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 =3D 1.8 foreign >>> + >>> +SUFFIXES =3D .c .rs .def .o .lo .a >>> + >>> +ACLOCAL_AMFLAGS =3D -I . -I .. -I ../config >>> + >>> +AM_CFLAGS =3D -I $(srcdir)/../libgcc -I $(MULTIBUILDTOP)../../gcc/incl= ude >>> + >>> +TOP_GCCDIR :=3D $(shell cd $(top_srcdir) && cd .. && pwd) >>> + >>> +GCC_DIR =3D $(TOP_GCCDIR)/gcc >>> +RUST_SRC =3D $(GCC_DIR)/rust >>> + >>> +toolexeclibdir=3D@toolexeclibdir@ >>> +toolexecdir=3D@toolexecdir@ >>> + >>> +SUBDIRS =3D libproc_macro >>> + >>> +RUST_BUILDDIR :=3D $(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 =3D \ >>> + "GCC_DIR=3D$(GCC_DIR)" \ >>> + "RUST_SRC=3D$(RUST_SRC)" \ >>> + "AR_FLAGS=3D$(AR_FLAGS)" \ >>> + "CC_FOR_BUILD=3D$(CC_FOR_BUILD)" \ >>> + "CC_FOR_TARGET=3D$(CC_FOR_TARGET)" \ >>> + "RUST_FOR_TARGET=3D$(RUST_FOR_TARGET)" \ >>> + "CFLAGS=3D$(CFLAGS)" \ >>> + "CXXFLAGS=3D$(CXXFLAGS)" \ >>> + "CFLAGS_FOR_BUILD=3D$(CFLAGS_FOR_BUILD)" \ >>> + "CFLAGS_FOR_TARGET=3D$(CFLAGS_FOR_TARGET)" \ >>> + "INSTALL=3D$(INSTALL)" \ >>> + "INSTALL_DATA=3D$(INSTALL_DATA)" \ >>> + "INSTALL_PROGRAM=3D$(INSTALL_PROGRAM)" \ >>> + "INSTALL_SCRIPT=3D$(INSTALL_SCRIPT)" \ >>> + "LDFLAGS=3D$(LDFLAGS)" \ >>> + "LIBCFLAGS=3D$(LIBCFLAGS)" \ >>> + "LIBCFLAGS_FOR_TARGET=3D$(LIBCFLAGS_FOR_TARGET)" \ >>> + "MAKE=3D$(MAKE)" \ >>> + "MAKEINFO=3D$(MAKEINFO) $(MAKEINFOFLAGS)" \ >>> + "PICFLAG=3D$(PICFLAG)" \ >>> + "PICFLAG_FOR_TARGET=3D$(PICFLAG_FOR_TARGET)" \ >>> + "SHELL=3D$(SHELL)" \ >>> + "RUNTESTFLAGS=3D$(RUNTESTFLAGS)" \ >>> + "exec_prefix=3D$(exec_prefix)" \ >>> + "infodir=3D$(infodir)" \ >>> + "libdir=3D$(libdir)" \ >>> + "includedir=3D$(includedir)" \ >>> + "prefix=3D$(prefix)" \ >>> + "tooldir=3D$(tooldir)" \ >>> + "gxx_include_dir=3D$(gxx_include_dir)" \ >>> + "AR=3D$(AR)" \ >>> + "AS=3D$(AS)" \ >>> + "LD=3D$(LD)" \ >>> + "RANLIB=3D$(RANLIB)" \ >>> + "NM=3D$(NM)" \ >>> + "NM_FOR_BUILD=3D$(NM_FOR_BUILD)" \ >>> + "NM_FOR_TARGET=3D$(NM_FOR_TARGET)" \ >>> + "DESTDIR=3D$(DESTDIR)" \ >>> + "WERROR=3D$(WERROR)" \ >>> + "TARGET_LIB_PATH=3D$(TARGET_LIB_PATH)" \ >>> + "TARGET_LIB_PATH_librust=3D$(TARGET_LIB_PATH_librust)" \ >>> + "LIBTOOL=3D$(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=3D${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 libr= aries should be installed in a compiler-specific directory ], >>> +[case "$enableval" in >>> + yes) version_specific_libs=3Dyes ;; >>> + no) version_specific_libs=3Dno ;; >>> + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specifi= c libs]);; >>> + esac], >>> +[version_specific_libs=3Dno]) >>> +AC_MSG_RESULT($version_specific_libs) >>> + >>> +toolexecdir=3Dno >>> +toolexeclibdir=3Dno >>> + >>> +# 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 optio= n >>> + # is selected. >>> + toolexecdir=3D'$(libdir)/gcc/$(target_noncanonical)' >>> + toolexeclibdir=3D'$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' >>> + ;; >>> + no) >>> + if test -n "$with_cross_host" && >>> + test x"$with_cross_host" !=3D x"no"; then >>> + # Install a library built with a cross compiler in tooldir, not = libdir. >>> + toolexecdir=3D'$(exec_prefix)/$(target_noncanonical)' >>> + toolexeclibdir=3D'$(toolexecdir)/lib' >>> + else >>> + toolexecdir=3D'$(libdir)/gcc-lib/$(target_noncanonical)' >>> + toolexeclibdir=3D'$(libdir)' >>> + fi >>> + multi_os_directory=3D`$CC -print-multi-os-directory` >>> + case $multi_os_directory in >>> + .) ;; # Avoid trailing /. >>> + *) toolexeclibdir=3D$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 =3D' >> $ac_file >>> + ml_norecursion=3Dyes >>> + AS_UNSET([ml_norecursion]) >>> +]) >>> + >>> + >>> +AC_MSG_NOTICE([librust has been configured.]) >>> + >>> +AC_OUTPUT >>> diff --git a/libgrust/libproc_macro/Makefile.am b/libgrust/libproc_macr= o/Makefile.am >>> new file mode 100644 >>> index 00000000000..1e61d12e506 >>> --- /dev/null >>> +++ b/libgrust/libproc_macro/Makefile.am >>> @@ -0,0 +1,58 @@ >>> +SUFFIXES =3D .cc .o .a .lo .la >>> + >>> +ACLOCAL_AMFLAGS =3D -I .. -I ../../config >>> + >>> +toolexeclibdir=3D@toolexeclibdir@ >>> +toolexecdir=3D@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 =3D \ >>> + "AR_FLAGS=3D$(AR_FLAGS)" \ >>> + "CC_FOR_BUILD=3D$(CC_FOR_BUILD)" \ >>> + "CC_FOR_TARGET=3D$(CC_FOR_TARGET)" \ >>> + "CFLAGS=3D$(CFLAGS)" \ >>> + "CXXFLAGS=3D$(CXXFLAGS)" \ >>> + "CFLAGS_FOR_BUILD=3D$(CFLAGS_FOR_BUILD)" \ >>> + "CFLAGS_FOR_TARGET=3D$(CFLAGS_FOR_TARGET)" \ >>> + "INSTALL=3D$(INSTALL)" \ >>> + "INSTALL_DATA=3D$(INSTALL_DATA)" \ >>> + "INSTALL_PROGRAM=3D$(INSTALL_PROGRAM)" \ >>> + "INSTALL_SCRIPT=3D$(INSTALL_SCRIPT)" \ >>> + "LDFLAGS=3D$(LDFLAGS)" \ >>> + "LIBCFLAGS=3D$(LIBCFLAGS)" \ >>> + "LIBCFLAGS_FOR_TARGET=3D$(LIBCFLAGS_FOR_TARGET)" \ >>> + "MAKE=3D$(MAKE)" \ >>> + "MAKEINFO=3D$(MAKEINFO) $(MAKEINFOFLAGS)" \ >>> + "PICFLAG=3D$(PICFLAG)" \ >>> + "PICFLAG_FOR_TARGET=3D$(PICFLAG_FOR_TARGET)" \ >>> + "SHELL=3D$(SHELL)" \ >>> + "RUNTESTFLAGS=3D$(RUNTESTFLAGS)" \ >>> + "exec_prefix=3D$(exec_prefix)" \ >>> + "infodir=3D$(infodir)" \ >>> + "libdir=3D$(libdir)" \ >>> + "includedir=3D$(includedir)" \ >>> + "prefix=3D$(prefix)" \ >>> + "tooldir=3D$(tooldir)" \ >>> + "gxx_include_dir=3D$(gxx_include_dir)" \ >>> + "AR=3D$(AR)" \ >>> + "AS=3D$(AS)" \ >>> + "LD=3D$(LD)" \ >>> + "RANLIB=3D$(RANLIB)" \ >>> + "NM=3D$(NM)" \ >>> + "NM_FOR_BUILD=3D$(NM_FOR_BUILD)" \ >>> + "NM_FOR_TARGET=3D$(NM_FOR_TARGET)" \ >>> + "DESTDIR=3D$(DESTDIR)" \ >>> + "WERROR=3D$(WERROR)" \ >>> + "TARGET_LIB_PATH=3D$(TARGET_LIB_PATH)" \ >>> + "TARGET_LIB_PATH_libgm2=3D$(TARGET_LIB_PATH_libgm2)" >>> + >>> +toolexeclib_LTLIBRARIES =3D libproc_macro.la >>> + >>> +libproc_macro_la_SOURCES =3D \ >>> + proc_macro.cc >>> + >>> +include_HEADERS =3D \ >>> + proc_macro.h >>> + >>> diff --git a/libgrust/libproc_macro/proc_macro.cc b/libgrust/libproc_ma= cro/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_mac= ro/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 */ >>> -- >>> 2.42.0 >> ----------------- >> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe = 201, 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch= =C3=A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellsc= haft: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra=C3=9Fe 201= , 80634 M=C3=BCnchen; Gesellschaft mit beschr=C3=A4nkter Haftung; Gesch=C3= =A4ftsf=C3=BChrer: Thomas Heurung, Frank Th=C3=BCrauf; Sitz der Gesellschaf= t: M=C3=BCnchen; Registergericht M=C3=BCnchen, HRB 106955