This is the mail archive of the 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
  /usr/src/packages/BUILD/gcc/gcc/testsuite/objc/execute/bf-1.m -w -O
  -L/usr/src/packages/BUILD/gcc/obj/gcc -lobjc -lm -o
/usr/lib/gcc-lib/i486-suse-linux/3.0/../../../../i486-suse-linux/bin/ld: warning:, needed by /usr/src/packages/BUILD/gcc/obj/i486-suse-linux/libobjc/.libs/, not found (try using -rpath or -rpath-link)
/usr/src/packages/BUILD/gcc/obj/i486-suse-linux/libobjc/.libs/ 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?


2001-03-07  Andreas Jaeger  <>

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

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

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