Add call to get_compiler_info to gdb_compile_shlib.
authorAndrew Burgess <aburgess@broadcom.com>
Tue, 10 Dec 2013 17:04:17 +0000 (17:04 +0000)
committerAndrew Burgess <aburgess@broadcom.com>
Tue, 10 Dec 2013 17:04:17 +0000 (17:04 +0000)
    https://sourceware.org/ml/gdb-patches/2013-12/msg00374.html

gdb/testsuite/ChangeLog

* lib/gdb.exp (gdb_compile_shlib): Add call to get_compiler_info,
update comment.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 0e1e78501f10e5e6f6115ad84fda39842f237c30..ec01bffda7552cbd32ec7da0be94f8db2aaf9909 100644 (file)
@@ -1,3 +1,8 @@
+2013-12-10  Andrew Burgess  <aburgess@broadcom.com>
+
+       * lib/gdb.exp (gdb_compile_shlib): Add call to get_compiler_info,
+       update comment.
+
 2013-12-10  Joel Brobecker  <brobecker@adacore.com>
 
        * gdb.ada/int_deref.exp: Add test verifying that we print
index d221505d00eefc7c46c9b950450d633c1f272cd1..ebeb659876b0bf1a42031eed4bfdc28064b81fe3 100644 (file)
@@ -2809,12 +2809,19 @@ proc gdb_compile_pthreads {source dest type options} {
     }
 }
 
-# Build a shared library from SOURCES.  You must use get_compiler_info
-# first.
+# Build a shared library from SOURCES.
 
 proc gdb_compile_shlib {sources dest options} {
     set obj_options $options
 
+    set info_options ""
+    if { [lsearch -exact $options "c++"] >= 0 } {
+       set info_options "c++"
+    }
+    if [get_compiler_info ${info_options}] {
+       return -1
+    }
+
     switch -glob [test_compiler_info] {
         "xlc-*" {
             lappend obj_options "additional_flags=-qpic"