This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Fix the bootstrap test when building with --enable-plugins
- From: Rafael Espindola <espindola at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Cc: nlewycky at google dot com, Ian Lance Taylor <iant at google dot com>
- Date: Fri, 9 Oct 2009 11:47:07 -0400
- Subject: [patch] Fix the bootstrap test when building with --enable-plugins
When we build binutils with --enable-plugins, bfd will depend on libdl
and this causes the gnu ld bootstrap tests to fail. The attached patch
fixes this. It adds -ldl if we have plugins enabled and skips the
static linking test since it would fail with the warning about using
ldl in a statically linked binary.
Note that I don't know tcl, so I am likely trying to detect plugin
support the wrong way.
2009-10-09 Rafael Avila de Espindola <espindola@google.com>
* bootstrap.exp: Detect if plugins are enabled. Skip the static
link test and add -ldl to the remaining tests if they are.
Cheers,
--
Rafael Ãvila de EspÃndola
? .git
? gold/po/es.gmo
? gold/po/id.gmo
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
===================================================================
RCS file: /cvs/src/src/ld/testsuite/ld-bootstrap/bootstrap.exp,v
retrieving revision 1.18
diff -u -r1.18 bootstrap.exp
--- ld/testsuite/ld-bootstrap/bootstrap.exp 2 Sep 2009 07:25:38 -0000 1.18
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 9 Oct 2009 15:38:50 -0000
@@ -30,6 +30,15 @@
return
}
+remote_exec host "$nm --help" "" "/dev/null" "plugin-support"
+set tmp [file_contents "plugin-support"]
+regexp ".*\(--plugin\).*\n" $tmp foo plugins
+if [info exists plugins] then {
+ set plugins "yes"
+} else {
+ set plugins "no"
+}
+
# Bootstrap ld. First link the object files together using -r, in
# order to test -r. Then link the result into an executable, ld1, to
# really test -r. Use ld1 to link a fresh ld, ld2. Use ld2 to link a
@@ -61,6 +70,11 @@
continue
}
+ if { $flags == "--static" && $plugins == "yes" } then {
+ untested $testname
+ continue
+ }
+
# If we only have a shared libbfd, we probably can't run the
# --static test.
if { $flags == "--static" && ! [string match "*libbfd.a*" $BFDLIB] } then {
@@ -91,6 +105,10 @@
}
}
+ if { $plugins == "yes" } {
+ set extralibs "$extralibs -ldl"
+ }
+
# On Irix 5, linking with --static only works if all the files are
# compiled using -non_shared.
if {"$flags" == "--static"} {