This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib
- From: Markus Deuling <deuling at de dot ibm dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Wed, 16 May 2007 10:11:16 +0200
- Subject: [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-*" {