aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-06 21:51:35 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-14 20:13:10 +0200
commit0c4f66d02980f16989ab9a70e01066df78cb48f8 (patch)
treeddeabd2bec2ce35e996bb4921d0189c816a7f7b2 /testsuite
parent80cb95b3610d34fd80f95b74f40339b9b540b302 (diff)
downloadltrace-0c4f66d02980f16989ab9a70e01066df78cb48f8.tar.gz
Libraries shouldn't be added to command line if object is compiled
Command lines like gcc x.c -c y.so prompt gcc to emits warnings, and DejaGNU then thinks there were failures.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/lib/ltrace.exp68
1 files changed, 36 insertions, 32 deletions
diff --git a/testsuite/lib/ltrace.exp b/testsuite/lib/ltrace.exp
index f002935..c0d0dcf 100644
--- a/testsuite/lib/ltrace.exp
+++ b/testsuite/lib/ltrace.exp
@@ -50,38 +50,42 @@ set LTRACE_ARGS "";
# OPTIONS is option to compiler in this compilation.
proc ltrace_compile {source dest type options} {
global LTRACE_TESTCASE_OPTIONS;
-
- # Add platform-specific options if a shared library was specified using
- # "shlib=librarypath" in OPTIONS.
- set new_options ""
- set shlib_found 0
-
- foreach opt $options {
- if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
- if [test_compiler_info "xlc*"] {
- # IBM xlc compiler doesn't accept shared library named other
- # than .so: use "-Wl," to bypass this
- lappend source "-Wl,$shlib_name"
- } else {
- lappend source $shlib_name
- }
-
- if {$shlib_found == 0} {
- set shlib_found 1
-
- if { ([test_compiler_info "gcc-*"]&& ([istarget "powerpc*-*-aix*"]|| [istarget "rs6000*-*-aix*"] ))} {
- lappend options "additional_flags=-L${objdir}/${subdir}"
- } elseif { [istarget "mips-sgi-irix*"] } {
- lappend options "additional_flags=-rpath ${objdir}/${subdir}"
- }
- }
-
- } else {
- lappend new_options $opt
- }
- }
- #end of for loop
- set options $new_options
+
+ if {![string equal "object" $type]} {
+ # Add platform-specific options if a shared library was specified using
+ # "shlib=librarypath" in OPTIONS.
+ set new_options ""
+ set shlib_found 0
+
+ foreach opt $options {
+ if [regexp {^shlib=(.*)} $opt dummy_var shlib_name] {
+ if [test_compiler_info "xlc*"] {
+ # IBM xlc compiler doesn't accept shared library named other
+ # than .so: use "-Wl," to bypass this
+ lappend source "-Wl,$shlib_name"
+ } else {
+ lappend source $shlib_name
+ }
+
+ if {$shlib_found == 0} {
+ set shlib_found 1
+
+ if { ([test_compiler_info "gcc-*"]&& ([istarget "powerpc*-*-aix*"]|| [istarget "rs6000*-*-aix*"] ))} {
+ lappend options "additional_flags=-L${objdir}/${subdir}"
+ } elseif { [istarget "mips-sgi-irix*"] } {
+ lappend options "additional_flags=-rpath ${objdir}/${subdir}"
+ }
+ }
+
+ } else {
+ lappend new_options $opt
+ }
+ }
+
+ #end of for loop
+ set options $new_options
+ }
+
# dump some information for debug purpose.
verbose "options are $options"
verbose "source is $source $dest $type $options"