This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib


Hi,

I try to build a shared library using gdb_compile_shlib. The build is done in two steps (compile and link).

The testcase I work on adds set lib_flags "$lib_flags additional_flags=-Wl,-Bsymbolic"
as an option to gdb_compile_shlib. The compile run quits with
gcc: -Bsymbolic: linker input file unused because linking not done
because the linker option is given to the compile run, too.


This patch removes any linker options for the first compile run. This makes it possible to add
additional linker flags to gdb_compile_shlib.

Testsuite showed no regression. Is that ok to commit?


ChangeLog:


	* lib/gdb.exp (gdb_compile_shlib): Remove linker options for first
	compile run.

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com




diff -urN src/gdb/testsuite/lib/gdb.exp dev/gdb/testsuite/lib/gdb.exp
--- src/gdb/testsuite/lib/gdb.exp	2007-04-02 05:53:41.000000000 +0200
+++ dev/gdb/testsuite/lib/gdb.exp	2007-05-16 09:56:44.000000000 +0200
@@ -1608,7 +1608,14 @@
 # first.
 
 proc gdb_compile_shlib {sources dest options} {
-    set obj_options $options
+
+    # Remove linker options from obj_options.
+    set obj_options ""
+    foreach obj $options {
+      if ![regexp {.*-Wl,*} $obj --] {
+	lappend obj_options $obj
+      }
+    }
 
     switch -glob [test_compiler_info] {
         "xlc-*" {




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