This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Fix the shell used to execute mloop.in


Hi Guys,

  This may be the cause of some derision but I use tcsh as my shell.
  
  The reason that I bring this up is that I recently encountered a
  problem building the FRV simulator.  It took a while but I tracked
  the problem down to the fact that the genloop.sh script in
  sim/common was invoking the target specific mloop.in script using
  the SHELL from my environment (ie tcsh) rather than the SHELL from
  the makefile that invoked it (ie bash).  Since sim/frv/mloop.in is
  written for sh-style shells using tcsh naturally did not work.  The
  genmloop.sh script does not check for a failed execution of its
  target input file (maybe it should) and the end result was an
  mloop.c file in my sim/frv build directory that was mostly empty.

  So anyway I am proposing the patch below as a solution.  It adds a
  new optional parameter to the genmloop.sh script which specifies the
  shell to use when invoking the target input file.  The I have
  modified the Makefile.in files that use genmloop.sh to pass this
  parameter specifying the shell that they use.

  I tested the patch by rebuilding all of the simulators and
  confirming that I now have a working FRV simulator which can run the
  gcc testsuite.

  There was one other problem that was specific to the FRV.  Its
  mloop.in file was missing a start-of-line-comment character near the
  beginning.  Fixing this one counts as obvious I believe.
  
  Please may I apply this patch ?

Cheers
  Nick

sim/ChangeLog
2008-07-23  Nick Clifton  <nickc@redhat.com>

	* common/genmloop.sh: Add new parameter: -shell to specify the
	command interpreter to use to run the input file.  This is
	necessary because otherwise SHELL is taken from the user's
	environment, and not from the makefile that invoked this script
	and the user might not be running an sh-like shell.
	* cris/Makefile.in: Pass -shell parameter to genmloop.sh.
	* fr30/Makefile.in: Likewise.
	* frv/Makefile.in: Likewise.
	* i960/Makefile.in: Likewise.
	* iq2000/Makefile.in: Likewise.
	* m32r/Makefile.in: Likewise.

	* frv/mloop.in: Add missing start of line comment marker.

Index: sim/common/genmloop.sh
===================================================================
RCS file: /cvs/src/src/sim/common/genmloop.sh,v
retrieving revision 1.5
diff -c -3 -p -r1.5 genmloop.sh
*** sim/common/genmloop.sh	1 Jan 2008 22:53:23 -0000	1.5
--- sim/common/genmloop.sh	24 Jul 2008 07:33:07 -0000
***************
*** 118,123 ****
--- 118,127 ----
  #
  #	Specify the suffix to append to output files.
  #
+ # -shell <shell>
+ #
+ #	Specify the shell to use to execute <input-file>
+ #
  # Only one of -scache/-pbb may be selected.
  # -simple is the default.
  #
*************** do
*** 160,165 ****
--- 164,170 ----
  	-switch) shift ; switch=$1 ;;
  	-cpu) shift ; cpu=$1 ;;
  	-infile) shift ; infile=$1 ;;
+ 	-shell) shift ; SHELL=$1 ;;
  	*) echo "unknown option: $1" >&2 ; exit 1 ;;
  	esac
  	shift
Index: sim/cris/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/cris/Makefile.in,v
retrieving revision 1.8
diff -c -3 -p -r1.8 Makefile.in
*** sim/cris/Makefile.in	1 Jan 2008 22:53:23 -0000	1.8
--- sim/cris/Makefile.in	24 Jul 2008 07:33:07 -0000
*************** crisv10f.o: crisv10f.c cris-tmpl.c $(CRI
*** 95,101 ****
  # than the apparent; some "mono" feature is work in progress)?
  mloopv10f.c engv10.h: stamp-v10fmloop
  stamp-v10fmloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -no-fast -pbb -switch semcrisv10f-switch.c \
  		-cpu crisv10f -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin engv10.h
--- 95,101 ----
  # than the apparent; some "mono" feature is work in progress)?
  mloopv10f.c engv10.h: stamp-v10fmloop
  stamp-v10fmloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -no-fast -pbb -switch semcrisv10f-switch.c \
  		-cpu crisv10f -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin engv10.h
*************** mloopv32f.c engv32.h: stamp-v32fmloop
*** 121,127 ****
  # We depend on stamp-v10fmloop to get serialization to avoid
  # racing with it for the same temporary file-names when "make -j".
  stamp-v32fmloop: stamp-v10fmloop $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -no-fast -pbb -switch semcrisv32f-switch.c \
  		-cpu crisv32f -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin engv32.h
--- 121,127 ----
  # We depend on stamp-v10fmloop to get serialization to avoid
  # racing with it for the same temporary file-names when "make -j".
  stamp-v32fmloop: stamp-v10fmloop $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -no-fast -pbb -switch semcrisv32f-switch.c \
  		-cpu crisv32f -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin engv32.h
Index: sim/frv/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/frv/Makefile.in,v
retrieving revision 1.7
diff -c -3 -p -r1.7 Makefile.in
*** sim/frv/Makefile.in	1 Jan 2008 22:53:24 -0000	1.7
--- sim/frv/Makefile.in	24 Jul 2008 07:33:07 -0000
*************** sim-if.o: sim-if.c $(FRVBF_INCLUDE_DEPS)
*** 89,95 ****
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -scache -parallel-generic-write -parallel-only \
  		-cpu frvbf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
--- 89,95 ----
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -scache -parallel-generic-write -parallel-only \
  		-cpu frvbf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
Index: sim/frv/mloop.in
===================================================================
RCS file: /cvs/src/src/sim/frv/mloop.in,v
retrieving revision 1.7
diff -c -3 -p -r1.7 mloop.in
*** sim/frv/mloop.in	1 Jan 2008 22:53:24 -0000	1.7
--- sim/frv/mloop.in	24 Jul 2008 07:33:08 -0000
***************
*** 1,6 ****
  # Simulator main loop for frv. -*- C -*-
  # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2007, 2008
!   Free Software Foundation, Inc.
  # Contributed by Red Hat.
  #
  # This file is part of the GNU Simulators.
--- 1,6 ----
  # Simulator main loop for frv. -*- C -*-
  # Copyright (C) 1998, 1999, 2000, 2001, 2003, 2007, 2008
! #  Free Software Foundation, Inc.
  # Contributed by Red Hat.
  #
  # This file is part of the GNU Simulators.
Index: sim/iq2000/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/iq2000/Makefile.in,v
retrieving revision 1.4
diff -c -3 -p -r1.4 Makefile.in
*** sim/iq2000/Makefile.in	1 Jan 2008 22:53:24 -0000	1.4
--- sim/iq2000/Makefile.in	24 Jul 2008 07:33:08 -0000
*************** iq2000.o: $(srcdir)/iq2000.c $(IQ2000BF_
*** 69,75 ****
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -fast -pbb -switch sem-switch.c \
  		-cpu iq2000bf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
--- 69,75 ----
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -fast -pbb -switch sem-switch.c \
  		-cpu iq2000bf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
Index: sim/m32r/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/m32r/Makefile.in,v
retrieving revision 1.14
diff -c -3 -p -r1.14 Makefile.in
*** sim/m32r/Makefile.in	1 Jan 2008 22:53:25 -0000	1.14
--- sim/m32r/Makefile.in	24 Jul 2008 07:33:08 -0000
*************** m32r.o: m32r.c $(M32RBF_INCLUDE_DEPS)
*** 81,87 ****
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -fast -pbb -switch sem-switch.c \
  		-cpu m32rbf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
--- 81,87 ----
  # FIXME: Use of `mono' is wip.
  mloop.c eng.h: stamp-mloop
  stamp-mloop: $(srcdir)/../common/genmloop.sh mloop.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -fast -pbb -switch sem-switch.c \
  		-cpu m32rbf -infile $(srcdir)/mloop.in
  	$(SHELL) $(srcroot)/move-if-change eng.hin eng.h
*************** m32rx.o: m32rx.c $(M32RXF_INCLUDE_DEPS)
*** 105,111 ****
  # FIXME: Use of `mono' is wip.
  mloopx.c engx.h: stamp-xmloop
  stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -no-fast -pbb -parallel-write -switch semx-switch.c \
  		-cpu m32rxf -infile $(srcdir)/mloopx.in \
  		-outfile-suffix x
--- 105,111 ----
  # FIXME: Use of `mono' is wip.
  mloopx.c engx.h: stamp-xmloop
  stamp-xmloop: $(srcdir)/../common/genmloop.sh mloopx.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -no-fast -pbb -parallel-write -switch semx-switch.c \
  		-cpu m32rxf -infile $(srcdir)/mloopx.in \
  		-outfile-suffix x
*************** m32r2.o: m32r2.c $(M32R2F_INCLUDE_DEPS)
*** 130,136 ****
  # FIXME: Use of `mono' is wip.
  mloop2.c eng2.h: stamp-2mloop
  stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh \
  		-mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
  		-cpu m32r2f -infile $(srcdir)/mloop2.in \
  		-outfile-suffix 2
--- 130,136 ----
  # FIXME: Use of `mono' is wip.
  mloop2.c eng2.h: stamp-2mloop
  stamp-2mloop: $(srcdir)/../common/genmloop.sh mloop2.in Makefile
! 	$(SHELL) $(srccom)/genmloop.sh -shell $(SHELL) \
  		-mono -no-fast -pbb -parallel-write -switch sem2-switch.c \
  		-cpu m32r2f -infile $(srcdir)/mloop2.in \
  		-outfile-suffix 2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]