Re: [PATCH v2 2/4] libgrust: Add libproc_macro and build system

2023-10-26 Thread Thomas Schwinge
Hi!

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), and in my hacky WIP
trees where C++ (standard library) is supported to some extent.  (This
should, roughly, match C++ functionality (not) provided by a number of
other GCC "embedded" targets.)


Then:

On 2023-10-25T13:06:46+0200, Arthur Cohen  wrote:
> 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=$(TARGET_LIB_PATH_librust)" \

Compared to libgomp (which I'm reasonably familiar with), I found missing
in 'libgrust' at 'configure'-level:

  --enable-multilib   build many library versions (default)

  --disable-werrordisable building with -Werror

  --enable-symvers=STYLE  enables symbol versioning of the shared library
  [default=yes]

  --enable-cetenable Intel CET in target libraries 
[default=auto]

  --with-gcc-major-version-only
  use only GCC major number in filesystem paths

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 
6a6d3817afa02bbcd2388c8e005da6faf88932f1 "Config,Darwin: Allow for configuring 
Darwin to use embedded runpath"'.


Grüße
 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 000..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_TAR

Re: [PATCH v2 3/4] build: Add libgrust as compilation modules

2023-10-26 Thread Arthur Cohen

Hi Thomas,

On 10/25/23 23:40, Thomas Schwinge wrote:

Hi!

On 2023-10-25T13:06:48+0200, Arthur Cohen  wrote:

From: Pierre-Emmanuel Patry 

Define the libgrust directory as a host compilation module as well as
for targets.


I don't see a response to Richard's comments:
.
Re "doesn't build libgrust if [Rust is not enabled]", I suppose (but have
not checked) this works for the *target* libgrust module via
'gcc/rust/config-lang.in:target_libs' requesting 'target-libgrust' only
if the Rust language is enabled?  I don't know what enables/disables the
*host* libgrust build?


My comments:

don't seem to have been addressed?


Sorry about that! The fixup commits you mentioned should have been 
integrated already to the commits I pushed. I seem to have messed 
something up in my branch, as your last comment should have been 
addressed too - I'll resend clean commits where all of this is checked.





Also, don't you first have to get in "build: Regenerate build files"
before the 'gcc/rust/config-lang.in:target_libs' change, to avoid
breaking bisection?

Maybe, after all, don't have a separate "build: Regenerate build files"
commit, but instead do the regeneration as part of the commits adding the
source files, in usual GCC style?


Alright, that sounds good.



And then, the 'contrib/gcc_update' change that's currently in
"libgrust: Add entry for maintainers and stub changelog file" should be
part of the commit that actually adds the files referenced therein.


Okay!

Thanks for the review. I'll address these shortly.




Grüße
  Thomas



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 15c068e4ac4..929a6f0a08e 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 692dc716343..b2a5511bab1 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"
--
2.42.0

-
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955


☠ Buildbot (Sourceware): gccrust - failed '! grep ...' (failure) (master)

2023-10-26 Thread builder
A failed build has been detected on builder gccrust-gentoo-sparc while building 
gccrust.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/241/builds/1071

Build state: failed '! grep ...' (failure)
Revision: 9a45588f39d9710f2d7b5dec2e75d00531e7436d
Worker: gentoo-sparc
Build Reason: (unknown)
Blamelist: A. Wilcox , Abdul Rafey 
, Alan Modra , Aldy Hernandez 
, Alex Coplan , Alexander Monakov 
, Alexandre Oliva , Alexandre Oliva 
, Allan McRae , Andre Simoes Dias Vieira 
, Andre Vehreschild , Andre 
Vieira , Andrea Corallo 
, Andreas Krebbel , Andreas 
Schwab , Andreas Schwab , Andrew 
Carlotti , Andrew Carlotti , 
Andrew Jenner , Andrew MacLeod , 
Andrew Pinski , Andrew Pinski , Andrew 
Stubbs , Anthony Green , Antoni 
Boucher , Ard Biesheuvel , Arjun Shankar , Arnaud Charlet 
, Arsen Arsenovic , Arsen Arsenović 
, ArshErgon , Artem Klimov 
, Arthur Cohen , Avinash 
Sonawane , Benno Evers , Benson 
Muite , Bernd Kuhls , 
Bernhard Reutner-Fischer , Bernhard Reutner-Fischer 
, Bill Schmidt , Bill Seurer 
, Björn Schäpers , Bob Duff 
, Boris Yakobowski , Bruce Korb 
, Bruno Haible , Cedric Landet 
, Cesar Philippidis , Charalampos 
Mitrodimas , Charles-François Natali 
, Chenghua Xu , Chenghua Xu , Christoph Müllner , Christophe 
Lyon , Christophe Lyon , 
Chung-Ju Wu , Chung-Lin Tang , 
Claire Dross , Claudiu Zissulescu , 
Claudiu Zissulescu , Clément Chigot , 
Clément Chigot , CohenArthur , 
Costas Argyris , Cui,Lili , 
Cupertino Miranda , Dan Li 
, Daniel Mercier , Dave 
, Dave Evans , David Edelsohn 
, David Faust , David Malcolm 
, David Seifert , Detlef Vollmann 
, Dimitar Dimitrov , Dimitrij Mijoski 
, Dimitrije Milosevic
  , Dimitrije Milošević 
, Dmitriy Anisimkov , 
Dongsheng Song , Doug Rupp , Ed 
Catmur , Ed Schonberg , Ed Smith-Rowland 
, Emanuele Micheletti 
, Eric Biggers , Eric 
Botcazou , Eric Botcazou , Eric 
Gallager , Etienne Servais , Eugene 
Rozenfeld , Faisal Abbas <90.abbasfai...@gmail.com>, 
Faisal Abbas , Fedor Rybin , Fei 
Gao , Flavio Cruz , Florian 
Weimer , Francois-Xavier Coudert , 
Francois-Xavier Coudert , François Dumont 
, Frederik Harwath , Fritz Reese , Frolov Daniil 
, GCC Administrator , Gaius 
Mulley , Gary Dismukes , 
Georg-Johann Lay , Gerald Pfeifer , Ghjuvan 
Lacambre , Giuliano Belinassi , 
Guillaume Gomez , Guillermo E. Martinez 
, H.J. Lu , Hafiz Abid 
Qadeer , Hans-Peter Nilsson , Haochen 
Gui , Haochen Jiang , Harald 
Anlauf , Hongyu Wang , Hu, Lin1 
, Iain Buclaw , Iain Sandoe 
, Ian Lance Taylor , Ilya Leoshkevich 
, Immad Mir , Immad Mir 
, Indu Bhagat , Iskan
 der Shakirzyanov , Jakob Hasse 
<0xja...@users.noreply.github.com>, Jakub Dupak , Jakub 
Jelinek , Jan Beulich , Jan Hubicka 
, Jan-Benedict Glaw , Jason Merrill 
, Javier Miranda , Jeff Chapman II 
, Jeff Law , Jeff Law 
, Jeff Law , Jerry DeLisle 
, Jia-Wei Chen , Jia-wei Chen 
, Jiakun Fan <120090...@link.cuhk.edu.cn>, Jiawei 
, Jin Ma , Jinyang He 
, Jiufu Guo , Joao Azevedo 
, Joel Brobecker , Joel Holdsworth 
, Joel Phillips , Joel 
Teichroeb , Joffrey Huguet , Johannes 
 Kanig , Johannes Kliemann , John 
David Anglin , Jonathan Grant , Jonathan 
Wakely , Jonathan Yong <10wa...@gmail.com>, Jonny Grant 
, Jose E. Marchesi , Joseph Myers 
, Josue Nava Bello , José Rui 
Faustino de Sousa , Ju-Zhe Zhong , 
Julia Lapenko , Julian Brown 
, Julien Bortolussi , Junxian 
Zhu , Justin Squirek , 
Juzhe-Zhong , Jørgen Kvalsvik 
, Keef Aragon , 
Kewen Lin , Kewen.Lin , Kim Kuparinen 
, Kito Cheng , Kong 
Lingling , Kwok Cheung Yeung , Kyrylo Tkachov , Kévin Le Gouguec 
, LIU Hao , Lewis Hyatt 
, Li Xu , Liaiss Merzougue 
, Liao Shihua , LiaoShihua 
, Lili Cui , Lin Sinan 
, Lin Sinan , Liwei Xu 
, Lorenzo Salvadore , Lulu 
Cheng , Lyra , M V V S Manoj Kumar 
, MAHAD , Maciej W. Rozycki 
, Maciej W. Rozycki , Mahmoud Mohamed 
, Marc Nieper-Wißkirchen , 
Marc Poulhiès , Marc Poulhiès , Marcel 
Vollweiler , Marco Falke , 
Marek Polacek , Mark Mentovai , Mark Wielaard , 
Martin Jambor , Martin Liska , Martin Liška 
, Martin Sebor , Martin Uecker 
, Matthew Jasper , Matthias Kretz 
, Max Filippov , Mayshao 
, Meghan Denny , Michael Collison 
, Michael Eager , Michael Meissner 
, Mikael Morin , Mikhail Ablakatov 
, Mohammed Rizan Farooqui , 
Monk Chiang , Muhammad Mahad , 
Murray Steele , Nathan Sidwell , 
Nathaniel Shead , Navid Rahimi 
, Nick Clifton , Nikos Alexandris 
, Nirmal Patel , Olivier Hainque , Owen Avery 
, Palmer Dabbelt , Pan Li 
, Parthib <94271200+parthib...@users.noreply.github.com>, 
Parthib , Pascal Obry , Pat Haugen 
, Patrick Bernardi , Patrick 
Palka , Paul A. Clarke , Paul Thomas 
, Paul-Antoine Arras , Pekka Seppänen 
, Peter Bergner , Peter Foley 
, Petter Tomner , Philip Herron 
, Philip Herron , 
Philipp Fent , Philipp Tomsich , 
Pierre-Emmanuel Patry , Pierre-Marie de 
Rodat , Piotr Trojanek , Prajwal S N 
, Prathamesh Kulkarni , Przemyslaw Wirkus 
, Qian Jianhua , Qian Jianhua 
, Qing Zhao , Quentin Ochem 
, Raiki Tamura , Rainer Orth 
, Rainer Ort

☺ Buildbot (Sourceware): gccrust - build successful (master)

2023-10-26 Thread builder
A passing build has been detected on builder gccrust-rawhide-x86_64 while 
building gccrust.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/132/builds/1498

Build state: build successful
Revision: 97a0d40594a9e5c6c6b18a6548ecbfa22f181e5f
Worker: bb2-1
Build Reason: (unknown)
Blamelist: Jakub Dupak 

Steps:

- 0: worker_preparation ( success )

- 1: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/1/logs/stdio

- 2: rm -rf gccrs-build ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/2/logs/stdio

- 3: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/3/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/3/logs/config_log

- 4: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/4/logs/stdio
- warnings (40): 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/4/logs/warnings__40_

- 5: make check ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/5/logs/stdio
- rust.sum: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/5/logs/rust_sum
- rust.log: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/5/logs/rust_log
- warnings (6): 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/5/logs/warnings__6_

- 6: grep FAIL or unexpected rust.sum ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/6/logs/stdio

- 7: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/7/logs/stdio

- 8: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/8/logs/stdio

- 9: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/9/logs/stdio

- 10: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/10/logs/stdio

- 11: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/11/logs/stdio

- 12: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/12/logs/stdio

- 13: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/13/logs/stdio

- 14: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/14/logs/stdio

- 15: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/15/logs/stdio

- 16: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/16/logs/stdio

- 17: rm -rf gccrs-build_1 ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/132/builds/1498/steps/17/logs/stdio