* [rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib
@ 2007-05-16 8:12 Markus Deuling
2007-05-16 9:28 ` Pedro Alves
0 siblings, 1 reply; 3+ messages in thread
From: Markus Deuling @ 2007-05-16 8:12 UTC (permalink / raw)
To: GDB Patches; +Cc: Ulrich Weigand
[-- Attachment #1: Type: text/plain, Size: 766 bytes --]
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
[-- Attachment #2: diff-fix-shlib-linker-opt --]
[-- Type: text/plain, Size: 573 bytes --]
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-*" {
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib
2007-05-16 8:12 [rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib Markus Deuling
@ 2007-05-16 9:28 ` Pedro Alves
2007-05-16 9:38 ` Markus Deuling
0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2007-05-16 9:28 UTC (permalink / raw)
To: Markus Deuling; +Cc: GDB Patches, Ulrich Weigand
On 5/16/07, Markus Deuling <deuling@xxx> wrote:
> 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.
>
I've seen something similar before. Did you try using ldflags instead?
I think those will only be used when linking.
set lib_flags "$lib_flags ldflags=-Wl,-Bsymbolic"
Cheers,
Pedro Alves
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib
2007-05-16 9:28 ` Pedro Alves
@ 2007-05-16 9:38 ` Markus Deuling
0 siblings, 0 replies; 3+ messages in thread
From: Markus Deuling @ 2007-05-16 9:38 UTC (permalink / raw)
To: Pedro Alves; +Cc: GDB Patches, Ulrich Weigand
Pedro Alves wrote:
> On 5/16/07, Markus Deuling <deuling@xxx> wrote:
>> 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.
>>
>
> I've seen something similar before. Did you try using ldflags instead?
> I think those will only be used when linking.
>
> set lib_flags "$lib_flags ldflags=-Wl,-Bsymbolic"
>
> Cheers,
> Pedro Alves
>
Hi Pedro,
yes, it works with ldflags :-)
Thank you very much. I withdraw the Patch.
Have a nice day!
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-05-16 9:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-16 8:12 [rfc] testsuite/lib/gdb.exp: Enable additional linker flags in gdb_compile_shlib Markus Deuling
2007-05-16 9:28 ` Pedro Alves
2007-05-16 9:38 ` Markus Deuling
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox