This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Fix objc testsuite (was: Re: objc failures on branch)



With the introduction of libgcc_so, the objc testsuite is broken if
libgcc_s is not installed already:

$  /usr/src/packages/BUILD/gcc/obj/gcc/xgcc
  -B/usr/src/packages/BUILD/gcc/obj/gcc/
  /usr/src/packages/BUILD/gcc/gcc/testsuite/objc/execute/bf-1.m -w -O
  -I/usr/src/packages/BUILD/gcc/gcc/testsuite/../../libobjc
  -L/usr/src/packages/BUILD/gcc/obj/gcc
  -L/usr/src/packages/BUILD/gcc/obj/i486-suse-linux/libobjc/.libs
  -L/usr/src/packages/BUILD/gcc/obj/gcc -lobjc -lm -o
  /usr/src/packages/BUILD/gcc/obj/gcc/testsuite/bf-1.x
/usr/lib/gcc-lib/i486-suse-linux/3.0/../../../../i486-suse-linux/bin/ld: warning: libgcc_s.so.0, needed by /usr/src/packages/BUILD/gcc/obj/i486-suse-linux/libobjc/.libs/libobjc.so, not found (try using -rpath or -rpath-link)
/usr/src/packages/BUILD/gcc/obj/i486-suse-linux/libobjc/.libs/libobjc.so: undefined reference to `__eprintf@GCC_3.0'
collect2: ld returned 1 exit status

We need to add an rpath so that libgcc_so can be found.  Here's patch
which has been tested on i686-linux.

Ok to commit to both branches?

Andreas

2001-03-07  Andreas Jaeger  <aj@suse.de>

	* testsuite/lib/objc.exp (objc_target_compile): Path --rpath for
	libgcc_s.so.

============================================================
Index: gcc/testsuite/lib/objc.exp
--- gcc/testsuite/lib/objc.exp	2000/08/06 18:41:49	1.5
+++ gcc/testsuite/lib/objc.exp	2001/03/07 13:08:55
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1996, 1997, 2000, 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
@@ -113,6 +113,7 @@
 }
 
 proc objc_target_compile { source dest type options } {
+    global rootme;
     global tmpdir;
     global gluefile wrap_flags;
     global OBJC_UNDER_TEST
@@ -121,6 +122,7 @@
 
     set ld_library_path "."
     lappend options "libs=-lobjc"
+    lappend options "additional_flags=-Wl,--rpath=${rootme}"
 
     if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
 	lappend options "libs=${gluefile}"

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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