public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix ld testcases on c6x
@ 2011-05-11 11:11 Bernd Schmidt
  2011-05-11 11:20 ` Joseph S. Myers
  2011-05-11 11:56 ` Alan Modra
  0 siblings, 2 replies; 4+ messages in thread
From: Bernd Schmidt @ 2011-05-11 11:11 UTC (permalink / raw)
  To: binutils; +Cc: Paul Brook, Joseph S. Myers

[-- Attachment #1: Type: text/plain, Size: 388 bytes --]

This corrects some ld testsuite failures which I failed to spot before
checking in my C6X -mpic patch. OK?

I'm also seeing

Running /local/src/egcs/src/ld/testsuite/ld-tic6x/tic6x.exp ...
FAIL: ld-tic6x/unwind-1
FAIL: ld-tic6x/unwind-2
FAIL: ld-tic6x/unwind-3
FAIL: ld-tic6x/unwind-4
ERROR: dump program unspecified in
/local/src/egcs/src/ld/testsuite/ld-tic6x/unwind-6.d

Paul?


Bernd

[-- Attachment #2: mpic-ts.diff --]
[-- Type: text/plain, Size: 2283 bytes --]

	* ld-elf/frame.exp: Use -mpic -mpid=near assembler options for tic6x.
	* ld-elf/exclude.exp: Likewise.

Index: ld/testsuite/ld-elf/frame.exp
===================================================================
--- ld/testsuite/ld-elf/frame.exp	(revision 316201)
+++ ld/testsuite/ld-elf/frame.exp	(working copy)
@@ -44,14 +44,20 @@ if { [istarget "hppa64-*-*"] || [istarge
     return
 }
 
+# This target requires extra as options when building code for shared
+# libraries.
+if { [istarget "tic6x-*-*"] } {
+    set as_opt "-mpic -mpid=near"
+}
+
 set test1	"read-only .eh_frame section"
 set test2	"read-only .gcc_except_table section"
 
 global as
 global ld
 
-if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
-     || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } {
+if { ![ld_assemble $as "$as_opt $srcdir/$subdir/tbss.s" tmpdir/tbss.o ]
+     || ![ld_assemble $as "$as_opt $srcdir/$subdir/frame.s" tmpdir/frame.o] } {
     unresolved "$test1"
     return
 }
@@ -66,7 +72,7 @@ if { [ld_simple_link $ld tmpdir/frame.so
     }
 }
 
-if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] {
+if ![ld_assemble $as "$as_opt $srcdir/$subdir/table.s" tmpdir/table.o ] {
     unresolved "$test2"
     return
 }
Index: ld/testsuite/ld-elf/exclude.exp
===================================================================
--- ld/testsuite/ld-elf/exclude.exp	(revision 316201)
+++ ld/testsuite/ld-elf/exclude.exp	(working copy)
@@ -31,6 +31,12 @@ if { [istarget "mcore-*-*"] } {
     return
 }
 
+# This target requires extra as options when building code for shared
+# libraries.
+if { [istarget "tic6x-*-*"] } {
+    set as_opt "-mpic -mpid=near"
+}
+
 global ar
 global as
 global ld
@@ -47,8 +53,8 @@ set test7 "ld exclude symbols from archi
 set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a"
 set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar"
 
-if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
-     || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
+if { ![ld_assemble $as "$as_opt $srcdir/$subdir/exclude1.s" tmpdir/exclude1.o ]
+     || ![ld_assemble $as "$as_opt $srcdir/$subdir/exclude2.s" tmpdir/exclude2.o] } {
     unresolved $test1
     return
 }

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

* Re: Fix ld testcases on c6x
  2011-05-11 11:11 Fix ld testcases on c6x Bernd Schmidt
@ 2011-05-11 11:20 ` Joseph S. Myers
  2011-05-11 11:56 ` Alan Modra
  1 sibling, 0 replies; 4+ messages in thread
From: Joseph S. Myers @ 2011-05-11 11:20 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: binutils, Paul Brook

On Wed, 11 May 2011, Bernd Schmidt wrote:

> This corrects some ld testsuite failures which I failed to spot before
> checking in my C6X -mpic patch. OK?

Passing these options is OK with me in C6X terms, but I think you need to 
set a default empty value of as_opt for other targets (Tcl doesn't like 
uninitialized variables), and as these are target-independent tests you 
probably need a global maintainer to approve the change.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: Fix ld testcases on c6x
  2011-05-11 11:11 Fix ld testcases on c6x Bernd Schmidt
  2011-05-11 11:20 ` Joseph S. Myers
@ 2011-05-11 11:56 ` Alan Modra
  2011-05-11 12:31   ` Bernd Schmidt
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Modra @ 2011-05-11 11:56 UTC (permalink / raw)
  To: Bernd Schmidt; +Cc: binutils, Paul Brook, Joseph S. Myers

On Wed, May 11, 2011 at 01:10:23PM +0200, Bernd Schmidt wrote:
> +if { ![ld_assemble $as "$as_opt $srcdir/$subdir/tbss.s" tmpdir/tbss.o ]
> +     || ![ld_assemble $as "$as_opt $srcdir/$subdir/frame.s" tmpdir/frame.o] }

Passing options like this in the "source" parameter of ld_assemble
isn't the cleanest way.  Better would be to twiddle ASFLAGS (See
ld-frv/tls.exp for an example).  I'll OK your patch changed to use
ASFLAGS.

Best would be to add an "asflags" parameter to ld_assemble but I won't
ask for that since I probably wouldn't bother to do so myself..
Preapproved if you do care to go that route.

-- 
Alan Modra
Australia Development Lab, IBM

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

* Re: Fix ld testcases on c6x
  2011-05-11 11:56 ` Alan Modra
@ 2011-05-11 12:31   ` Bernd Schmidt
  0 siblings, 0 replies; 4+ messages in thread
From: Bernd Schmidt @ 2011-05-11 12:31 UTC (permalink / raw)
  To: binutils, Paul Brook, Joseph S. Myers

[-- Attachment #1: Type: text/plain, Size: 718 bytes --]

On 05/11/2011 01:56 PM, Alan Modra wrote:
> On Wed, May 11, 2011 at 01:10:23PM +0200, Bernd Schmidt wrote:
>> +if { ![ld_assemble $as "$as_opt $srcdir/$subdir/tbss.s" tmpdir/tbss.o ]
>> +     || ![ld_assemble $as "$as_opt $srcdir/$subdir/frame.s" tmpdir/frame.o] }
> 
> Passing options like this in the "source" parameter of ld_assemble
> isn't the cleanest way.

I just followed lib/ld-lib.exp. I must say I dislike using ASFLAGS as in
ld-frv/tls.exp; it seems more error-prone since it has to be restored at
every return. So I went the other route and added a ld_assemble_flags
function. I'll give you some time to object to this version and check it
in as preapproved later today if I don't hear otherwise.


Bernd

[-- Attachment #2: as-flags.diff --]
[-- Type: text/plain, Size: 5563 bytes --]

	* config/default.exp (ld_assemble): Pass flags parameter to
	default_ld_assemble.
	(ld_assemble_flags): New function.
	* ld-elf/frame.exp: Pass -mpic and -mpid flags to the assembler on
	tic6x.
	* ld-elf/exclude.exp: Likewise.
	* lib/ld-lib.exp (default_ld_assemble): Take extra argument in_flags
	and pass it to the assembler.

Index: ld/testsuite/config/default.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/config/default.exp,v
retrieving revision 1.15
diff -c -p -r1.15 default.exp
*** ld/testsuite/config/default.exp	2 Sep 2009 07:25:37 -0000	1.15
--- ld/testsuite/config/default.exp	11 May 2011 12:26:58 -0000
*************** proc ld_compile { cc source object } {
*** 205,211 ****
  #	assemble a file
  #
  proc ld_assemble { as source object } {
! 	default_ld_assemble $as $source $object 
  }
  
  #
--- 205,219 ----
  #	assemble a file
  #
  proc ld_assemble { as source object } {
! 	default_ld_assemble $as "" $source $object 
! }
! 
! #
! # ld_assemble_flags
! #	assemble a file with extra flags
! #
! proc ld_assemble_flags { as flags source object } {
! 	default_ld_assemble $as $flags $source $object 
  }
  
  #
Index: ld/testsuite/ld-elf/exclude.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/exclude.exp,v
retrieving revision 1.7
diff -c -p -r1.7 exclude.exp
*** ld/testsuite/ld-elf/exclude.exp	2 Sep 2009 07:25:39 -0000	1.7
--- ld/testsuite/ld-elf/exclude.exp	11 May 2011 12:26:58 -0000
*************** if { [istarget "mcore-*-*"] } {
*** 31,36 ****
--- 31,44 ----
      return
  }
  
+ set as_opt ""
+ 
+ # This target requires extra as options when building code for shared
+ # libraries.
+ if { [istarget "tic6x-*-*"] } {
+     set as_opt "-mpic -mpid=near"
+ }
+ 
  global ar
  global as
  global ld
*************** set test7 "ld exclude symbols from archi
*** 47,54 ****
  set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a"
  set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar"
  
! if { ![ld_assemble $as $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
!      || ![ld_assemble $as $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
      unresolved $test1
      return
  }
--- 55,62 ----
  set test8 "ld exclude symbols from archive - --exclude-libs foo,libexclude.a"
  set test9 "ld don't exclude symbols from archive - --exclude-libs foo:bar"
  
! if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude1.s tmpdir/exclude1.o ]
!      || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/exclude2.s tmpdir/exclude2.o] } {
      unresolved $test1
      return
  }
Index: ld/testsuite/ld-elf/frame.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-elf/frame.exp,v
retrieving revision 1.8
diff -c -p -r1.8 frame.exp
*** ld/testsuite/ld-elf/frame.exp	2 Sep 2009 07:25:39 -0000	1.8
--- ld/testsuite/ld-elf/frame.exp	11 May 2011 12:26:58 -0000
*************** if { [istarget "hppa64-*-*"] || [istarge
*** 44,57 ****
      return
  }
  
  set test1	"read-only .eh_frame section"
  set test2	"read-only .gcc_except_table section"
  
  global as
  global ld
  
! if { ![ld_assemble $as $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
!      || ![ld_assemble $as $srcdir/$subdir/frame.s tmpdir/frame.o] } {
      unresolved "$test1"
      return
  }
--- 44,65 ----
      return
  }
  
+ set as_opt ""
+ 
+ # This target requires extra as options when building code for shared
+ # libraries.
+ if { [istarget "tic6x-*-*"] } {
+     set as_opt "-mpic -mpid=near"
+ }
+ 
  set test1	"read-only .eh_frame section"
  set test2	"read-only .gcc_except_table section"
  
  global as
  global ld
  
! if { ![ld_assemble_flags $as $as_opt $srcdir/$subdir/tbss.s tmpdir/tbss.o ]
!      || ![ld_assemble_flags $as $as_opt $srcdir/$subdir/frame.s tmpdir/frame.o] } {
      unresolved "$test1"
      return
  }
*************** if { [ld_simple_link $ld tmpdir/frame.so
*** 66,72 ****
      }
  }
  
! if ![ld_assemble $as $srcdir/$subdir/table.s tmpdir/table.o ] {
      unresolved "$test2"
      return
  }
--- 74,80 ----
      }
  }
  
! if ![ld_assemble_flags $as $as_opt $srcdir/$subdir/table.s tmpdir/table.o ] {
      unresolved "$test2"
      return
  }
Index: ld/testsuite/lib/ld-lib.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/lib/ld-lib.exp,v
retrieving revision 1.80
diff -c -p -r1.80 ld-lib.exp
*** ld/testsuite/lib/ld-lib.exp	6 Apr 2011 17:09:56 -0000	1.80
--- ld/testsuite/lib/ld-lib.exp	11 May 2011 12:26:59 -0000
*************** proc default_ld_compile { cc source obje
*** 295,308 ****
  
  # Assemble a file.
  #
! proc default_ld_assemble { as source object } {
      global ASFLAGS
      global host_triplet
  
      if ![info exists ASFLAGS] { set ASFLAGS "" }
  
      set flags [big_or_little_endian]
!     set exec_output [run_host_cmd "$as" "$flags $ASFLAGS -o $object $source"]
      set exec_output [prune_warnings $exec_output]
      if [string match "" $exec_output] then {
  	return 1
--- 295,308 ----
  
  # Assemble a file.
  #
! proc default_ld_assemble { as in_flags source object } {
      global ASFLAGS
      global host_triplet
  
      if ![info exists ASFLAGS] { set ASFLAGS "" }
  
      set flags [big_or_little_endian]
!     set exec_output [run_host_cmd "$as" "$flags $in_flags $ASFLAGS -o $object $source"]
      set exec_output [prune_warnings $exec_output]
      if [string match "" $exec_output] then {
  	return 1

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

end of thread, other threads:[~2011-05-11 12:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 11:11 Fix ld testcases on c6x Bernd Schmidt
2011-05-11 11:20 ` Joseph S. Myers
2011-05-11 11:56 ` Alan Modra
2011-05-11 12:31   ` Bernd Schmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).