Author: sje
Date: 2011-01-11 12:49:40 -0500 (Tue, 11 Jan 2011)
New Revision: 3452

Modified:
   trunk/osprey/driver/OPTIONS
   trunk/osprey/driver/main.c
   trunk/osprey/driver/run.c
   trunk/osprey/driver/run.h
Log:
When using the -v option, do not echo out the call to gcc (or g++)
that is used for the link because this confuses libtool when it is
building shared libraries.  The -v option is still passed to the gcc
command so the collect2 or ld command that gcc or g++ generates is
shown, but not the actual gcc call itself.  If you use -show instead of
(or in addition to) -v then you will still see the gcc call.
Fixes bug 648.

Approved by: Sun Chan


Modified: trunk/osprey/driver/OPTIONS
===================================================================
--- trunk/osprey/driver/OPTIONS 2011-01-10 22:46:27 UTC (rev 3451)
+++ trunk/osprey/driver/OPTIONS 2011-01-11 17:49:40 UTC (rev 3452)
@@ -170,7 +170,7 @@
 -show-defaults {show_defaults = TRUE; execute_flag = FALSE;} ALL       NONE    
""
        "Show the default compiler options being used"
 % gcc has -v show version as well as phases, so take that meaning
--v     {show_flag = TRUE; show_version++;} ALL CPP,as,ld       self "-show"
+-v     {v_flag = TRUE; show_version++;} ALL    CPP,as,ld       self "-show"
        "show phases and version as they are being invoked"
 -fullwarn toggle(&msglevel,2);         FTN  CPP        "-m2"
        "give more warnings, especially about missing prototypes"

Modified: trunk/osprey/driver/main.c
===================================================================
--- trunk/osprey/driver/main.c  2011-01-10 22:46:27 UTC (rev 3451)
+++ trunk/osprey/driver/main.c  2011-01-11 17:49:40 UTC (rev 3452)
@@ -388,7 +388,7 @@
        {
                print_help_msg();
        }
-       if ( ! show_version && ! execute_flag && ! show_flag && ! dump_version) 
{
+       if ( ! show_version && ! execute_flag && ! show_flag && ! v_flag && ! 
dump_version) {
                do_exit(RC_OKAY);       /* just exit */
        }
        if (source_kind == S_NONE || read_stdin) {

Modified: trunk/osprey/driver/run.c
===================================================================
--- trunk/osprey/driver/run.c   2011-01-10 22:46:27 UTC (rev 3451)
+++ trunk/osprey/driver/run.c   2011-01-11 17:49:40 UTC (rev 3452)
@@ -87,6 +87,7 @@
 #include "lib_phase_dir.h"
 
 boolean show_flag = FALSE;
+boolean v_flag = FALSE;
 boolean show_but_not_run = FALSE;
 boolean execute_flag = TRUE;
 boolean time_flag = FALSE;
@@ -314,6 +315,18 @@
                fprintf(stderr, "%s ", name);
                print_string_list(stderr, args);
        }
+
+       /* When using -v (and not -show), do not echo out the gcc call
+          that does the link phase.  libtool uses the -v option and greps
+          for lines with -L to determine the link method when building
+          shared libraries.  Echoing both the gcc call and the collect2/ld
+          call that gcc generates confuses libtool.  */
+
+       if (v_flag && !show_flag && phase != P_ld && phase != P_ldplus) {
+               fprintf(stderr, "%s ", name);
+               print_string_list(stderr, args);
+       }
+
        if (!execute_flag) return;
 
        if (time_flag) init_time();
@@ -672,7 +685,7 @@
                                   ) {
                                        nomsg_error(RC_INTERNAL_ERROR);
                                }
-                               else if (!show_flag || save_stderr) {
+                               else if (!(show_flag || v_flag) || save_stderr) 
{
                                        nomsg_error(RC_USER_ERROR);
                                } else {
                                        error("%s returned non-zero status %d",
@@ -947,7 +960,7 @@
     }
     else if (user_err) {
       /* assume phase will print diagnostics */
-      if (!show_flag || save_stderr)
+      if (!(show_flag || v_flag) || save_stderr)
        nomsg_error(RC_USER_ERROR);
       else
         error("%s returned non-zero status %d", name, status);

Modified: trunk/osprey/driver/run.h
===================================================================
--- trunk/osprey/driver/run.h   2011-01-10 22:46:27 UTC (rev 3451)
+++ trunk/osprey/driver/run.h   2011-01-11 17:49:40 UTC (rev 3452)
@@ -47,6 +47,7 @@
 extern boolean show_copyright; /* show the compiler copyright */
 extern boolean dump_version;   /* dump the compiler version */
 extern boolean show_flag;      /* show what driver does */
+extern boolean v_flag;         /* show what driver does, except link call */
 extern boolean execute_flag;   /* execute phases */
 extern boolean time_flag;      /* give time info */
 extern boolean run_m4;         /* run m4 on each ratfor file */


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to