Commit 8b91074e by Tom Tromey Committed by Tom Tromey

libjava.exp (libjava_arguments): Don't use -nodefaultlibs.

	* lib/libjava.exp (libjava_arguments): Don't use -nodefaultlibs.
	(libjava_find_lib): Add `-L' option to find the actual library.

From-SVN: r26782
parent 395e3bf9
1999-05-03 Tom Tromey <tromey@cygnus.com> 1999-05-03 Tom Tromey <tromey@cygnus.com>
* lib/libjava.exp (libjava_arguments): Don't use -nodefaultlibs.
(libjava_find_lib): Add `-L' option to find the actual library.
* libjava.mauve/mauve.exp (test_mauve): Pass `link' to * libjava.mauve/mauve.exp (test_mauve): Pass `link' to
libjava_arguments when linking. libjava_arguments when linking.
(test_mauve_sim): Likewise. (test_mauve_sim): Likewise.
......
...@@ -80,18 +80,24 @@ proc libjava_init { args } { ...@@ -80,18 +80,24 @@ proc libjava_init { args } {
} }
# Find a library. We know where libtool puts the actual libraries, # Find a library. We know where libtool puts the actual libraries,
# and we look there. # and we look there. The implementation is fairly hacky. We can't
# compile with -nodefaultlibs, because that will also eliminate the
# system libraries we need. In order to have gcj still work, it must
# find the appropriate libraries so we must add -L options for their
# paths. However we can't simply use those libraries; we still need
# libtool for linking.
proc libjava_find_lib {dir name} { proc libjava_find_lib {dir name} {
global base_dir global base_dir
set gp [get_multilibs] set gp [get_multilibs]
foreach sub {.libs _libs} { foreach sub {.libs _libs} {
if {$gp != ""} { if {$gp != ""} {
if {[file exists $gp/$dir/$sub/lib${name}.a]} then { if {[file exists $gp/$dir/$sub/lib${name}.a]} then {
return "$gp/$dir/lib${name}.la" return "$gp/$dir/lib${name}.la -L$gp/$dir/$sub"
} }
} }
set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \ set lib [findfile $base_dir/../../$dir/$sub/lib${name}.a \
"$base_dir/../../$dir/lib${name}.la" ""] "$base_dir/../../$dir/lib${name}.la -L$base_dir/../../$dir/$sub" \
""]
if {$lib != ""} { if {$lib != ""} {
return $lib return $lib
} }
...@@ -194,10 +200,6 @@ proc libjava_arguments {{mode compile}} { ...@@ -194,10 +200,6 @@ proc libjava_arguments {{mode compile}} {
} }
} }
if {$mode == "link"} {
lappend args "additional_flags=-nodefaultlibs -lm -lgcc -lc -lgcc"
}
return $args return $args
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment