[PATCH 0/2] Allow use of out-of-tree CGEN source

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/2] Allow use of out-of-tree CGEN source

Andrew Burgess
This is a reposting of a patch that I originally sent only to the
binutils mailing list here:

   https://sourceware.org/ml/binutils/2018-10/msg00172.html

As has been pointed out to me the correct place for simulator patches
is the gdb mailing list.

There's a second patch in this series now, this fixes the cris
simulator build when using out of tree cgen.

The binutils part of the patch is unchanged from the original
submission so I'm considering that pre-approved.

Thanks,
Andrew


--

Andrew Burgess (2):
  sim/opcodes: Allow use of out of tree cgen source directory
  sim/cris: Fix references to cgen cpu directory

 opcodes/ChangeLog       |  6 ++++++
 opcodes/configure       | 18 ++++++++++++++----
 opcodes/configure.ac    | 18 ++++++++++++++----
 sim/ChangeLog           | 12 ++++++++++++
 sim/common/acinclude.m4 | 20 +++++++++++++++-----
 sim/cris/ChangeLog      |  5 +++++
 sim/cris/Makefile.in    | 18 ++++++++----------
 sim/cris/configure      | 20 +++++++++++++++-----
 sim/frv/configure       | 20 +++++++++++++++-----
 sim/iq2000/configure    | 20 +++++++++++++++-----
 sim/lm32/configure      | 20 +++++++++++++++-----
 sim/m32r/configure      | 20 +++++++++++++++-----
 sim/or1k/configure      | 20 +++++++++++++++-----
 sim/sh64/configure      | 20 +++++++++++++++-----
 14 files changed, 179 insertions(+), 58 deletions(-)

--
2.14.5

Reply | Threaded
Open this post in threaded view
|

[PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Andrew Burgess
When configuring with '--enbale-cgen-maint' the default for both the
opcodes/ and sim/ directories is to assume that the cgen source is
within the binutils-gdb source tree as binutils-gdb/cgen/.

In the old cvs days, this worked well, as cgen was just another
sub-module of the single cvs repository and could easily be checked
out within the binutils-gdb directory, and managed by cvs in the
normal way.

Now that binutils-gdb is in git, while cgen is still in cvs, placing
the cgen respository within the binutils-gdb tree is more troublesome,
and it would be nice if the two tools could be kept separate.

Luckily there is already some initial code in the configure.ac files
for both opcodes/ and sim/ to support having cgen be located outside
of the binutils-gdb tree, however, this was speculative code written
imagining a future where cgen would be built and installed to some
location.

Right now there is no install support for cgen, and so the configure
code in opcodes/ and sim/ doesn't really do anything useful.  In this
commit I improve on this code slightly to allow binutils-gdb to be
configured so that it can make use of a cgen source directory that is
outside of the binutils-gdb tree.

With this commit applied it is now possible to configure and build
binutils-gdb like this:

    /path/to/binutils-gdb/src/configure --enable-cgen-maint=/path/to/cgen/src/cgen/
    make all-opcodes
    make -C opcodes run-cgen-all

Just in case anyone is still using cgen inside the binutils-gdb tree,
I have left the default behaviour of '--enable-cgen-maint' (with no
parameter) unchanged, that is it looks for the cgen directory as
'binutils-gdb/cgen/'.

opcodes/ChangeLog:

        * configure.ac (enable-cgen-maint): Support passing path to cgen
        source tree.
        * configure: Regenerate.

sim/ChangeLog:

        * common/acinclude.m4 (enable-cgen-maint): Support passing path to
        cgen source tree.
        * cris/configure: Regenerate.
        * frv/configure: Regenerate.
        * iq2000/configure: Regenerate.
        * lm32/configure: Regenerate.
        * m32r/configure: Regenerate.
        * or1k/configure: Regenerate.
        * sh64/configure: Regenerate.
---
 opcodes/ChangeLog       |  6 ++++++
 opcodes/configure       | 18 ++++++++++++++----
 opcodes/configure.ac    | 18 ++++++++++++++----
 sim/ChangeLog           | 12 ++++++++++++
 sim/common/acinclude.m4 | 20 +++++++++++++++-----
 sim/cris/configure      | 20 +++++++++++++++-----
 sim/frv/configure       | 20 +++++++++++++++-----
 sim/iq2000/configure    | 20 +++++++++++++++-----
 sim/lm32/configure      | 20 +++++++++++++++-----
 sim/m32r/configure      | 20 +++++++++++++++-----
 sim/or1k/configure      | 20 +++++++++++++++-----
 sim/sh64/configure      | 20 +++++++++++++++-----
 12 files changed, 166 insertions(+), 48 deletions(-)

diff --git a/opcodes/configure b/opcodes/configure
index 389e5513cf..28da5a6824 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12574,11 +12574,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
  cgen_maint=yes
- cgendir=${cgen_maint}/lib/cgen
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index 4c3698356b..9e48fedf9a 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -109,11 +109,21 @@ AC_ARG_ENABLE(cgen-maint,
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
  cgen_maint=yes
- cgendir=${cgen_maint}/lib/cgen
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac])dnl
 AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} = xyes)
diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index abc15a93ac..aa68e52d0d 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -851,11 +851,21 @@ AC_ARG_ENABLE(cgen-maint,
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac])dnl
 dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
diff --git a/sim/cris/configure b/sim/cris/configure
index 8ef9155d82..3894a9586f 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -13912,11 +13912,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/frv/configure b/sim/frv/configure
index 934afd06ca..a20a460abd 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -13681,11 +13681,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index 9486ef4a3d..f610141f72 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -13678,11 +13678,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 9624db3d83..f400a956f5 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -13678,11 +13678,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 43c25a621f..e17b3c2f62 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -13680,11 +13680,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/or1k/configure b/sim/or1k/configure
index 93aeb8f50d..335ae8a542 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -13788,11 +13788,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
diff --git a/sim/sh64/configure b/sim/sh64/configure
index 17a483329f..89612913f6 100755
--- a/sim/sh64/configure
+++ b/sim/sh64/configure
@@ -13678,11 +13678,21 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+          # This code would handle a cgen install.  For now we assume
+          # 'lib', but this is really just a place holder.  Maybe
+          # having a `share' directory might be more appropriate for
+          # the .scm, .cpu, etc. files.
+  cgendir=${enableval}/lib/cgen
+        fi
  ;;
 esac
 fi
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

[PATCH 2/2] sim/cris: Fix references to cgen cpu directory

Andrew Burgess
In reply to this post by Andrew Burgess
Don't assume that cgen is located within the binutils-gdb tree.  We
already have CGEN_CPU_DIR and CPU_DIR defined, these are the cpu/
directory within cgen, and the cpu/ directory within binutils-cpu.

The cris target tries to find CPU_DIR relative to the cgen source
tree, which can be wrong when building with an out of tree cgen.

sim/cris/ChangeLog:

        * Makefile.in: Replace uses of CGEN_CPU_DIR with CPU_DIR, and
        remove the definition of CGEN_CPU_DIR.
---
 sim/cris/ChangeLog   |  5 +++++
 sim/cris/Makefile.in | 18 ++++++++----------
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
index 2c901fdcab..f5880eaf29 100644
--- a/sim/cris/Makefile.in
+++ b/sim/cris/Makefile.in
@@ -45,8 +45,6 @@ NL_TARGET = -DNL_TARGET_cris
 
 ## COMMON_POST_CONFIG_FRAG
 
-CGEN_CPU_DIR = $(CGENDIR)/../cpu
-
 arch = cris
 
 sim-if.o: sim-if.c $(SIM_MAIN_DEPS) $(sim-core_h) $(sim-options_h)
@@ -140,17 +138,17 @@ CGEN_MAINT = ; @true
 # Useful when making CGEN-generated files manually, without --enable-cgen-maint.
 stamps: stamp-v10fmloop stamp-v32fmloop stamp-arch stamp-v10fcpu stamp-v32fcpu stamp-desc
 
-stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CGEN_CPU_DIR)/cris.cpu Makefile
+stamp-arch: $(CGEN_READ_SCM) $(CGEN_ARCH_SCM) $(CPU_DIR)/cris.cpu Makefile
  $(MAKE) cgen-arch $(CGEN_FLAGS_TO_PASS) mach=crisv10,crisv32 \
-  archfile=$(CGEN_CPU_DIR)/cris.cpu \
+  archfile=$(CPU_DIR)/cris.cpu \
   FLAGS="with-scache with-profile=fn"
  touch stamp-arch
 arch.h arch.c cpuall.h: $(CGEN_MAINT) stamp-arch
 
 # The sed-hack is supposed to be temporary, until we get CGEN to emit it.
-stamp-v10fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/cris.cpu Makefile
+stamp-v10fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/cris.cpu Makefile
  $(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
-  archfile=$(CGEN_CPU_DIR)/cris.cpu \
+  archfile=$(CPU_DIR)/cris.cpu \
   cpu=crisv10f mach=crisv10 SUFFIX=v10 FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEMSW)"
  $(SHELL) $(srcroot)/move-if-change $(srcdir)/semv10-switch.c $(srcdir)/semcrisv10f-switch.c
  sed -ne 'p; s/^\(#include "sim-assert.h"\)$$/#include "cgen-ops.h"/p' < $(srcdir)/decodev10.c > decodev10.c.tmp
@@ -158,9 +156,9 @@ stamp-v10fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DI
  touch stamp-v10fcpu
 cpuv10.h cpuv10.c semcrisv10f-switch.c modelv10.c decodev10.c decodev10.h: $(CGEN_MAINT) stamp-v10fcpu
 
-stamp-v32fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DIR)/cris.cpu Makefile
+stamp-v32fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CPU_DIR)/cris.cpu Makefile
  $(MAKE) cgen-cpu-decode $(CGEN_FLAGS_TO_PASS) \
-  archfile=$(CGEN_CPU_DIR)/cris.cpu \
+  archfile=$(CPU_DIR)/cris.cpu \
   cpu=crisv32f mach=crisv32 SUFFIX=v32 FLAGS="with-scache with-profile=fn" EXTRAFILES="$(CGEN_CPU_SEMSW)"
  $(SHELL) $(srcroot)/move-if-change $(srcdir)/semv32-switch.c $(srcdir)/semcrisv32f-switch.c
  sed -ne 'p; s/^\(#include "sim-assert.h"\)$$/#include "cgen-ops.h"/p' < $(srcdir)/decodev32.c > decodev32.c.tmp
@@ -168,9 +166,9 @@ stamp-v32fcpu: $(CGEN_READ_SCM) $(CGEN_CPU_SCM) $(CGEN_DECODE_SCM) $(CGEN_CPU_DI
  touch stamp-v32fcpu
 cpuv32.h cpuv32.c semcrisv32f-switch.c modelv32.c decodev32.c decodev32.h: $(CGEN_MAINT) stamp-v32fcpu
 
-stamp-desc: $(CGEN_READ_SCM) $(CGEN_DESC_SCM) $(CGEN_CPU_DIR)/cris.cpu Makefile
+stamp-desc: $(CGEN_READ_SCM) $(CGEN_DESC_SCM) $(CPU_DIR)/cris.cpu Makefile
  $(MAKE) cgen-desc $(CGEN_FLAGS_TO_PASS) \
- archfile=$(CGEN_CPU_DIR)/cris.cpu \
+ archfile=$(CPU_DIR)/cris.cpu \
  cpu=cris mach=all
  touch stamp-desc
 cris-desc.c cris-desc.h cris-opc.h: $(CGEN_MAINT) stamp-desc
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/2] Allow use of out-of-tree CGEN source

Andrew Burgess
In reply to this post by Andrew Burgess
Ping!

Thanks,
Andrew

* Andrew Burgess <[hidden email]> [2018-11-06 17:35:16 +0000]:

> This is a reposting of a patch that I originally sent only to the
> binutils mailing list here:
>
>    https://sourceware.org/ml/binutils/2018-10/msg00172.html
>
> As has been pointed out to me the correct place for simulator patches
> is the gdb mailing list.
>
> There's a second patch in this series now, this fixes the cris
> simulator build when using out of tree cgen.
>
> The binutils part of the patch is unchanged from the original
> submission so I'm considering that pre-approved.
>
> Thanks,
> Andrew
>
>
> --
>
> Andrew Burgess (2):
>   sim/opcodes: Allow use of out of tree cgen source directory
>   sim/cris: Fix references to cgen cpu directory
>
>  opcodes/ChangeLog       |  6 ++++++
>  opcodes/configure       | 18 ++++++++++++++----
>  opcodes/configure.ac    | 18 ++++++++++++++----
>  sim/ChangeLog           | 12 ++++++++++++
>  sim/common/acinclude.m4 | 20 +++++++++++++++-----
>  sim/cris/ChangeLog      |  5 +++++
>  sim/cris/Makefile.in    | 18 ++++++++----------
>  sim/cris/configure      | 20 +++++++++++++++-----
>  sim/frv/configure       | 20 +++++++++++++++-----
>  sim/iq2000/configure    | 20 +++++++++++++++-----
>  sim/lm32/configure      | 20 +++++++++++++++-----
>  sim/m32r/configure      | 20 +++++++++++++++-----
>  sim/or1k/configure      | 20 +++++++++++++++-----
>  sim/sh64/configure      | 20 +++++++++++++++-----
>  14 files changed, 179 insertions(+), 58 deletions(-)
>
> --
> 2.14.5
>
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Simon Marchi
In reply to this post by Andrew Burgess
On 2018-11-06 12:35, Andrew Burgess wrote:

> diff --git a/opcodes/configure.ac b/opcodes/configure.ac
> index 4c3698356b..9e48fedf9a 100644
> --- a/opcodes/configure.ac
> +++ b/opcodes/configure.ac
> @@ -109,11 +109,21 @@ AC_ARG_ENABLE(cgen-maint,
>    yes) cgen_maint=yes ;;
>    no) cgen_maint=no ;;
>    *)
> - # argument is cgen install directory (not implemented yet).
> - # Having a `share' directory might be more appropriate for the .scm,
> - # .cpu, etc. files.
> + # Argument is a directory where cgen can be found.  In some
> + # future world cgen could be installable, but right now this
> + # is not the case.  Instead we assume the directory is a path
> + # to the cgen source tree.
>   cgen_maint=yes
> - cgendir=${cgen_maint}/lib/cgen
> +        if test -r ${enableval}/iformat.scm; then
> +          # This looks like a cgen source tree.
> +  cgendir=${enableval}
> +        else
> +          # This code would handle a cgen install.  For now we assume
> +          # 'lib', but this is really just a place holder.  Maybe
> +          # having a `share' directory might be more appropriate for
> +          # the .scm, .cpu, etc. files.
> +  cgendir=${enableval}/lib/cgen
> +        fi
>   ;;
>  esac])dnl
>  AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} = xyes)

Just wondering, does the "else" part have any real-world use?  Before
today, was there any reason to pass a path to --enable-cgen-maint ?

Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Andrew Burgess
* Simon Marchi <[hidden email]> [2018-11-26 16:07:35 -0500]:

> On 2018-11-06 12:35, Andrew Burgess wrote:
> > diff --git a/opcodes/configure.ac b/opcodes/configure.ac
> > index 4c3698356b..9e48fedf9a 100644
> > --- a/opcodes/configure.ac
> > +++ b/opcodes/configure.ac
> > @@ -109,11 +109,21 @@ AC_ARG_ENABLE(cgen-maint,
> >    yes) cgen_maint=yes ;;
> >    no) cgen_maint=no ;;
> >    *)
> > - # argument is cgen install directory (not implemented yet).
> > - # Having a `share' directory might be more appropriate for the .scm,
> > - # .cpu, etc. files.
> > + # Argument is a directory where cgen can be found.  In some
> > + # future world cgen could be installable, but right now this
> > + # is not the case.  Instead we assume the directory is a path
> > + # to the cgen source tree.
> >   cgen_maint=yes
> > - cgendir=${cgen_maint}/lib/cgen
> > +        if test -r ${enableval}/iformat.scm; then
> > +          # This looks like a cgen source tree.
> > +  cgendir=${enableval}
> > +        else
> > +          # This code would handle a cgen install.  For now we assume
> > +          # 'lib', but this is really just a place holder.  Maybe
> > +          # having a `share' directory might be more appropriate for
> > +          # the .scm, .cpu, etc. files.
> > +  cgendir=${enableval}/lib/cgen
> > +        fi
> >   ;;
> >  esac])dnl
> >  AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} = xyes)
>
> Just wondering, does the "else" part have any real-world use?  Before today,
> was there any reason to pass a path to --enable-cgen-maint ?

Thanks for taking a look at this patch :)

Not as far as I can tell.  I left it in just in case, but as far as I
can tell there's no way to "install" CGEN.  I'd be happy to drop the
../lib/cgen references (the else block) completely, and then validate
that we have a CGEN source tree or error.... But the above seemed like
the least invasive change.

Andrew
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Simon Marchi
On 2018-11-27 06:21, Andrew Burgess wrote:
> Not as far as I can tell.  I left it in just in case, but as far as I
> can tell there's no way to "install" CGEN.  I'd be happy to drop the
> ../lib/cgen references (the else block) completely, and then validate
> that we have a CGEN source tree or error.... But the above seemed like
> the least invasive change.

 From what I understand from you description, there's no way it could
have been useful... but again, it's not hard to leave it there just to
be safe.  It's not my decision anyway :).

By the way, maybe this should still be sent to binutils for the opcodes
part?

Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

John Baldwin
On 11/27/18 11:47 AM, Simon Marchi wrote:

> On 2018-11-27 06:21, Andrew Burgess wrote:
>> Not as far as I can tell.  I left it in just in case, but as far as I
>> can tell there's no way to "install" CGEN.  I'd be happy to drop the
>> ../lib/cgen references (the else block) completely, and then validate
>> that we have a CGEN source tree or error.... But the above seemed like
>> the least invasive change.
>
>  From what I understand from you description, there's no way it could
> have been useful... but again, it's not hard to leave it there just to
> be safe.  It's not my decision anyway :).
>
> By the way, maybe this should still be sent to binutils for the opcodes
> part?

My vote would actually be to remove it if it isn't really useful.  If
someone really needs it in the future they can always dig it out of the
history.

--
John Baldwin

                                                                            
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Andrew Burgess
In reply to this post by Simon Marchi
* Simon Marchi <[hidden email]> [2018-11-27 14:47:31 -0500]:

> On 2018-11-27 06:21, Andrew Burgess wrote:
> > Not as far as I can tell.  I left it in just in case, but as far as I
> > can tell there's no way to "install" CGEN.  I'd be happy to drop the
> > ../lib/cgen references (the else block) completely, and then validate
> > that we have a CGEN source tree or error.... But the above seemed like
> > the least invasive change.
>
> From what I understand from you description, there's no way it could have
> been useful... but again, it's not hard to leave it there just to be safe.
> It's not my decision anyway :).

Right now I more worried that the only SIM maintained hasn't been seen
on either the GDB list or the binutils list in months, and despite
being included on the to/cc list, hasn't followed up on this mail.

Still, it's not been a month yet, so I'm sure it will all work itself
out :)

> By the way, maybe this should still be sent to binutils for the opcodes
> part?

I originally posted to the binutils list, and had the opcodes part
approved.  They pointed out that the sim/ part needed to be posted
here.

Thanks,
Andrew
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Simon Marchi
On 2018-11-27 15:27, Andrew Burgess wrote:

> * Simon Marchi <[hidden email]> [2018-11-27 14:47:31 -0500]:
>
>> On 2018-11-27 06:21, Andrew Burgess wrote:
>> > Not as far as I can tell.  I left it in just in case, but as far as I
>> > can tell there's no way to "install" CGEN.  I'd be happy to drop the
>> > ../lib/cgen references (the else block) completely, and then validate
>> > that we have a CGEN source tree or error.... But the above seemed like
>> > the least invasive change.
>>
>> From what I understand from you description, there's no way it could
>> have
>> been useful... but again, it's not hard to leave it there just to be
>> safe.
>> It's not my decision anyway :).
>
> Right now I more worried that the only SIM maintained hasn't been seen
> on either the GDB list or the binutils list in months, and despite
> being included on the to/cc list, hasn't followed up on this mail.
>
> Still, it's not been a month yet, so I'm sure it will all work itself
> out :)
>
>> By the way, maybe this should still be sent to binutils for the
>> opcodes
>> part?
>
> I originally posted to the binutils list, and had the opcodes part
> approved.  They pointed out that the sim/ part needed to be posted
> here.

Ah sorry, I didn't catch it was already approved, good!

Simon
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Tom Tromey-2
In reply to this post by John Baldwin
>>>>> "John" == John Baldwin <[hidden email]> writes:

John> My vote would actually be to remove it if it isn't really useful.  If
John> someone really needs it in the future they can always dig it out of the
John> history.

Me too, especially considering that this is written for a feature that
doesn't exist, and that nobody appears to be working on.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Andrew Burgess
In reply to this post by Andrew Burgess
Thanks to John and Tom for their feedback.

This revised version of the patch removes the old "installed cgen"
support.

Thanks,
Andrew

---

sim/opcodes: Allow use of out of tree cgen source directory

When configuring with '--enbale-cgen-maint' the default for both the
opcodes/ and sim/ directories is to assume that the cgen source is
within the binutils-gdb source tree as binutils-gdb/cgen/.

In the old cvs days, this worked well, as cgen was just another
sub-module of the single cvs repository and could easily be checked
out within the binutils-gdb directory, and managed by cvs in the
normal way.

Now that binutils-gdb is in git, while cgen is still in cvs, placing
the cgen respository within the binutils-gdb tree is more troublesome,
and it would be nice if the two tools could be kept separate.

Luckily there is already some initial code in the configure.ac files
for both opcodes/ and sim/ to support having cgen be located outside
of the binutils-gdb tree, however, this was speculative code written
imagining a future where cgen would be built and installed to some
location.

Right now there is no install support for cgen, and so the configure
code in opcodes/ and sim/ doesn't really do anything useful.  In this
commit I repurpose this code to allow binutils-gdb to be configured so
that it can make use of a cgen source directory that is outside of the
binutils-gdb tree.

With this commit applied it is now possible to configure and build
binutils-gdb like this:

    /path/to/binutils-gdb/src/configure --enable-cgen-maint=/path/to/cgen/src/cgen/
    make all-opcodes
    make -C opcodes run-cgen-all

Just in case anyone is still using cgen inside the binutils-gdb tree,
I have left the default behaviour of '--enable-cgen-maint' (with no
parameter) unchanged, that is it looks for the cgen directory as
'binutils-gdb/cgen/'.

opcodes/ChangeLog:

        * configure.ac (enable-cgen-maint): Support passing path to cgen
        source tree.
        * configure: Regenerate.

sim/ChangeLog:

        * common/acinclude.m4 (enable-cgen-maint): Support passing path to
        cgen source tree.
        * cris/configure: Regenerate.
        * frv/configure: Regenerate.
        * iq2000/configure: Regenerate.
        * lm32/configure: Regenerate.
        * m32r/configure: Regenerate.
        * or1k/configure: Regenerate.
        * sh64/configure: Regenerate.
---
 opcodes/ChangeLog       |  6 ++++++
 opcodes/configure       | 14 ++++++++++----
 opcodes/configure.ac    | 14 ++++++++++----
 sim/ChangeLog           | 12 ++++++++++++
 sim/common/acinclude.m4 | 16 +++++++++++-----
 sim/cris/configure      | 16 +++++++++++-----
 sim/frv/configure       | 16 +++++++++++-----
 sim/iq2000/configure    | 16 +++++++++++-----
 sim/lm32/configure      | 16 +++++++++++-----
 sim/m32r/configure      | 16 +++++++++++-----
 sim/or1k/configure      | 16 +++++++++++-----
 sim/sh64/configure      | 16 +++++++++++-----
 12 files changed, 126 insertions(+), 48 deletions(-)

diff --git a/opcodes/configure b/opcodes/configure
index 389e5513cf..eb74324ca8 100755
--- a/opcodes/configure
+++ b/opcodes/configure
@@ -12574,11 +12574,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
  cgen_maint=yes
- cgendir=${cgen_maint}/lib/cgen
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index 4c3698356b..7384684bc0 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -109,11 +109,17 @@ AC_ARG_ENABLE(cgen-maint,
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
  cgen_maint=yes
- cgendir=${cgen_maint}/lib/cgen
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree)
+        fi
  ;;
 esac])dnl
 AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} = xyes)
diff --git a/sim/common/acinclude.m4 b/sim/common/acinclude.m4
index abc15a93ac..71a8841ab0 100644
--- a/sim/common/acinclude.m4
+++ b/sim/common/acinclude.m4
@@ -851,11 +851,17 @@ AC_ARG_ENABLE(cgen-maint,
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  AC_MSG_ERROR(${enableval} doesn't look like a cgen source tree)
+        fi
  ;;
 esac])dnl
 dnl AM_CONDITIONAL(CGEN_MAINT, test x${cgen_maint} != xno)
diff --git a/sim/cris/configure b/sim/cris/configure
index 8ef9155d82..76f3c284e0 100755
--- a/sim/cris/configure
+++ b/sim/cris/configure
@@ -13912,11 +13912,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/frv/configure b/sim/frv/configure
index 934afd06ca..eeffc95c75 100755
--- a/sim/frv/configure
+++ b/sim/frv/configure
@@ -13681,11 +13681,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/iq2000/configure b/sim/iq2000/configure
index 9486ef4a3d..92ed9c8b39 100755
--- a/sim/iq2000/configure
+++ b/sim/iq2000/configure
@@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/lm32/configure b/sim/lm32/configure
index 9624db3d83..748266d2e0 100755
--- a/sim/lm32/configure
+++ b/sim/lm32/configure
@@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/m32r/configure b/sim/m32r/configure
index 43c25a621f..8ce674c0e1 100755
--- a/sim/m32r/configure
+++ b/sim/m32r/configure
@@ -13680,11 +13680,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/or1k/configure b/sim/or1k/configure
index 93aeb8f50d..1386585654 100755
--- a/sim/or1k/configure
+++ b/sim/or1k/configure
@@ -13788,11 +13788,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
diff --git a/sim/sh64/configure b/sim/sh64/configure
index 17a483329f..b02f835518 100755
--- a/sim/sh64/configure
+++ b/sim/sh64/configure
@@ -13678,11 +13678,17 @@ if test "${enable_cgen_maint+set}" = set; then :
   yes) cgen_maint=yes ;;
   no) cgen_maint=no ;;
   *)
- # argument is cgen install directory (not implemented yet).
- # Having a `share' directory might be more appropriate for the .scm,
- # .cpu, etc. files.
- cgendir=${cgen_maint}/lib/cgen
- cgen=guile
+ # Argument is a directory where cgen can be found.  In some
+ # future world cgen could be installable, but right now this
+ # is not the case.  Instead we assume the directory is a path
+ # to the cgen source tree.
+ cgen_maint=yes
+        if test -r ${enableval}/iformat.scm; then
+          # This looks like a cgen source tree.
+  cgendir=${enableval}
+        else
+  as_fn_error $? "${enableval} doesn't look like a cgen source tree" "$LINENO" 5
+        fi
  ;;
 esac
 fi
--
2.14.5

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 1/2] sim/opcodes: Allow use of out of tree cgen source directory

Tom Tromey-2
>>>>> "Andrew" == Andrew Burgess <[hidden email]> writes:

Andrew> sim/ChangeLog:

Andrew> * common/acinclude.m4 (enable-cgen-maint): Support passing path to
Andrew> cgen source tree.
Andrew> * cris/configure: Regenerate.
Andrew> * frv/configure: Regenerate.
Andrew> * iq2000/configure: Regenerate.
Andrew> * lm32/configure: Regenerate.
Andrew> * m32r/configure: Regenerate.
Andrew> * or1k/configure: Regenerate.
Andrew> * sh64/configure: Regenerate.

Thank you for doing this.  This is ok.

Tom
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 2/2] sim/cris: Fix references to cgen cpu directory

Tom Tromey-2
In reply to this post by Andrew Burgess
>>>>> "Andrew" == Andrew Burgess <[hidden email]> writes:

Andrew> sim/cris/ChangeLog:

Andrew> * Makefile.in: Replace uses of CGEN_CPU_DIR with CPU_DIR, and
Andrew> remove the definition of CGEN_CPU_DIR.

I think this is ok.  Thanks.

Tom