This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[PATCH] Fix libjava.loader/loader.exp problems


Hello,

I've run into two problems in the new loader.exp, which are fixed by
the following patch.

- In gcj_loader_test_one, the literal "executable" should be passed as
  'type' argument, not the variable "$executable".  This bug causes the
  library paths not to be added to the command line, so that the default
  libjava library, not the newly built one, is used.

- In gcj_loader_run, $GCJ_UNDER_TEST is directly executed to perform the
  resource compilation.  This is a problem when running a test with
  non-standard --target_board (e.g. for -m31 multilib), because the extra
  options are not passed.  This causes a 64-bit object to be generated
  even when running a 32-bit multilib test, which in turn causes following
  tests to fail because they cannot link with a wrong-format object.
  This is fixed by using the regular libjava_tcompile routine instead.

Tested on s390x-ibm-linux, both with and without -m31.

OK to commit?


ChangeLog:

      * libjava.loader/loader.exp (gcj_loader_test_one): Fix typo in
      'type' argument to libjava_tcompile.
      (gcj_loader_run): Use libjava_tcompile instead of running
      GCJ_UNDER_TEST directly.


Index: libjava/testsuite/libjava.loader/loader.exp
===================================================================
RCS file: /cvs/gcc/gcc/libjava/testsuite/libjava.loader/loader.exp,v
retrieving revision 1.1
diff -c -p -r1.1 loader.exp
*** libjava/testsuite/libjava.loader/loader.exp 4 Nov 2002 01:31:12 -0000     1.1
--- libjava/testsuite/libjava.loader/loader.exp 21 Nov 2002 12:17:55 -0000
*************** proc gcj_loader_test_one {srcfile} {
*** 13,19 ****
      set args [libjava_arguments link]
      lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o"
    set x [prune_warnings \
!          [libjava_tcompile $srcfile "$executable" "$executable" $args]]

      if { $x != "" } {
      verbose "target_compile failed: $x" 2
--- 13,19 ----
      set args [libjava_arguments link]
      lappend args "additional_flags=--main=[file rootname [file tail $srcfile]] $srcdir/$subdir/MyLoader.java $objdir/dummy.o"
    set x [prune_warnings \
!          [libjava_tcompile $srcfile "$executable" executable $args]]

      if { $x != "" } {
      verbose "target_compile failed: $x" 2
*************** proc gcj_loader_run {} {
*** 44,51 ****
    }
    pass "bytecompile $file"

    set x [prune_warnings \
!          [eval exec "$GCJ_UNDER_TEST --resource $objdir/dummy.class -c $objdir/dummy.class -o $objdir/dummy.o"]]
      if { $x != "" } {
      verbose "resource compilation failed: $x" 2

--- 44,54 ----
    }
    pass "bytecompile $file"

+   set args [libjava_arguments compile]
+   lappend args "additional_flags=--resource $objdir/dummy.class"
    set x [prune_warnings \
!          [libjava_tcompile "$objdir/dummy.class" "$objdir/dummy.o" object $args]]
!
      if { $x != "" } {
      verbose "resource compilation failed: $x" 2



Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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