Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Patch: lib/libgloss.exp prunes MULTILIB_EXTRA_OPTS as a character set, but is a string
@ 2001-09-05 17:07 Hans-Peter Nilsson
  2001-09-05 18:14 ` Rob Savoye
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Peter Nilsson @ 2001-09-05 17:07 UTC (permalink / raw)
  To: gdb-patches, rob, dejagnu-bugs

Testing the CRIS gcc port, I found that DejaGnu didn't like some
of my multilibs.  Or more precisely, it mutilizes what comes
from the gcc target makefile fragment variable
MULTILIB_EXTRA_OPTS.  Looking at libgloss.exp, where multilibs
are processed, it appears to be processed as a character set
rather than a string; "string trimright" works on a character
set, (cf.
<URL: http://dev.scriptics.com/man/tcl8.4/TclCmd/string.htm#M48 >),
but MULTILIB_EXTRA_OPTS is a string.  On the other hand, I don't
understand why there was '"'-trimming, so I might be missing
something.  Though it looks like a spurious but harmless '"'.  I
kept it, though.

For example, for the failure I saw, there was one multilib line
from gcc -print-multi-lib (here quoted):
"aout;@maout@mbest-lib-options", and the bug caused the final
"t" to disappear, because it's in the set "-beilmnopst".  Also,
the ";" wasn't stripped off when carving out MULTILIB_EXTRA_OPTS
from the default multilib.  I added ';' to the trimleft
character set, not worrying about pruning ".;" only as a string.

Now, it appears you'll only see this bug if you specify board
multilibs/variants in this format:
 set target_list "cris-xsim{elinux,linux,aout,arch=v10,}"
rather than:
 set target_list "cris-xsim{-melinux,-mlinux,-maout,-march=v10,}"
and even then, you'll find that "aout" (among others) is not
translated into "-maout", but through magic means into... bah,
read libgloss.exp yourself for the spells.  The manual doesn't
say much about testing multilib/variants AFAICT.  The point is
that the former format is the one used in examples in the manual
(cf. <URL: http://dejagnu.sourceforge.net/manual/global.html >:
'set target_list "mips-lsi-sim{,soft-float,el}"').

Please consider the following patch.  It's against the
sources.redhat.com repository.  AFAIK, sourceforge hosts the
official repository, but "cvs -d
:pserver:anonymous@cvs.dejagnu.sourceforge.net:/cvsroot/dejagnu
co dejagnu" doesn't work.  It seems the sourceforge dejagnu CVS
setup it at fault: the cvsweb interface at
<URL: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dejagnu/ >
lists only CVSROOT.

dejagnu:
2001-09-05  Hans-Peter Nilsson  <hp@axis.com>

	* lib/libgloss.exp (get_multilibs): Don't assume options from
	MULTILIB_EXTRA_OPTS is a set of characters when pruning from
	multilib options.  Trim all ".;" left of default options.

Index: libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.2
diff -c -p -r1.2 libgloss.exp
*** libgloss.exp	2000/06/09 13:14:35	1.2
--- libgloss.exp	2001/09/05 19:13:47
***************
*** 1,4 ****
! # Copyright (C) 92, 93, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
--- 1,4 ----
! # Copyright (C) 92, 93, 94, 95, 96, 97, 98, 1999, 2001 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
  # it under the terms of the GNU General Public License as published by
*************** proc get_multilibs { args } {
*** 421,432 ****
      # set output [exec $objdump_name --file-headers objfmtst.o ]
      set default_multilib [exec $compiler --print-multi-lib]
      set default_multilib [lindex $default_multilib 0];
!     set extra [string trimleft $default_multilib "."]
  
      # extract the options and their directory names as know by gcc
      foreach i "[exec $compiler --print-multi-lib]" {
      	if {$extra != ""} {
! 	  set i [string trimright $i $extra"]
  	}
  	set opts ""
  	set dir ""
--- 421,434 ----
      # set output [exec $objdump_name --file-headers objfmtst.o ]
      set default_multilib [exec $compiler --print-multi-lib]
      set default_multilib [lindex $default_multilib 0];
!     set extra [string trimleft $default_multilib ".;"]
  
      # extract the options and their directory names as know by gcc
      foreach i "[exec $compiler --print-multi-lib]" {
      	if {$extra != ""} {
! 	    set i [string range $i 0 \
! 		    [expr [string length $i] - [string length $extra] - 1]]
! 	    set i [string trimright $i {"}]
  	}
  	set opts ""
  	set dir ""

brgds, H-P


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Patch: lib/libgloss.exp prunes MULTILIB_EXTRA_OPTS as a character set, but is a string
  2001-09-05 17:07 Patch: lib/libgloss.exp prunes MULTILIB_EXTRA_OPTS as a character set, but is a string Hans-Peter Nilsson
@ 2001-09-05 18:14 ` Rob Savoye
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Savoye @ 2001-09-05 18:14 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gdb-patches

On Thu, Sep 06, 2001 at 02:06:43AM +0200, Hans-Peter Nilsson wrote:

> Now, it appears you'll only see this bug if you specify board
> multilibs/variants in this format:
>  set target_list "cris-xsim{elinux,linux,aout,arch=v10,}"
> rather than:
>  set target_list "cris-xsim{-melinux,-mlinux,-maout,-march=v10,}"
> and even then, you'll find that "aout" (among others) is not
> translated into "-maout", but through magic means into... bah,
> read libgloss.exp yourself for the spells.  The manual doesn't
  
  I didn't write the multilib support in DejaGnu, that was added by the
GCC team. Your patch looks fine, but to be safe, I'm gonna fwd it to
the gcc-testors, and make sure there is no reason for the dehaviour you
noticed.

  The manual doesn't talk about multilib testing, because that was determined
to be pretty much a compiler specific testing feature. As DejaGnu is widely
used for way more than just testing the GNU tools, I never documented how
to do multilib testring. I think the GCC team are the only ones using that
feature.

> sources.redhat.com repository.  AFAIK, sourceforge hosts the
> official repository, but "cvs -d
> :pserver:anonymous@cvs.dejagnu.sourceforge.net:/cvsroot/dejagnu
> co dejagnu" doesn't work.  It seems the sourceforge dejagnu CVS
> setup it at fault: the cvsweb interface at
> <URL: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dejagnu/ >

  The official CVS repository is at the FSF, on gnu,org. The web site
is at http://www.gnu.org/software/dejagnu . I thought I had a pointer on the
Sourceforge site to the FSF site, but I'll go check.

	- rob -


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-05 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-05 17:07 Patch: lib/libgloss.exp prunes MULTILIB_EXTRA_OPTS as a character set, but is a string Hans-Peter Nilsson
2001-09-05 18:14 ` Rob Savoye

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox