OSDN Git Service

2009-10-08 Rafael Avila de Espindola <espindola@google.com>
authorespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 13:59:32 +0000 (13:59 +0000)
committerespindola <espindola@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Oct 2009 13:59:32 +0000 (13:59 +0000)
* lto-plugin.c (add_input_library): New.
(all_symbols_read_handler): Use add_input_library for items that
start with -l.
(process_option): Fit in 80 columns.
(onload): Handle LDPT_ADD_INPUT_LIBRARY.

2009-10-08  Rafael Avila de Espindola  <espindola@google.com>

* gcc.c (LINK_COMMAND_SPEC): Pass libc with -pass-through if it is
being statically linked.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152558 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcc.c
lto-plugin/ChangeLog
lto-plugin/lto-plugin.c

index 12bebb0..8f0ba61 100644 (file)
@@ -1,3 +1,8 @@
+2009-10-08  Rafael Avila de Espindola  <espindola@google.com>
+
+       * gcc.c (LINK_COMMAND_SPEC): Pass libc with -pass-through if it is
+       being statically linked.
+
 2009-10-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * collect2.c (add_lto_object): Only define if OBJECT_FORMAT_NONE.
 2009-10-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * collect2.c (add_lto_object): Only define if OBJECT_FORMAT_NONE.
index d94462d..1891adb 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -775,6 +775,7 @@ proper position among the other output files.  */
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=%(lto_gcc) \
     %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}    \
     -plugin-opt=%(lto_wrapper) \
     -plugin-opt=%(lto_gcc) \
     %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}    \
+    %{static:-plugin-opt=-pass-through=-lc}    \
     %{O*:-plugin-opt=-O%*} \
     %{w:-plugin-opt=-w} \
     %{f*:-plugin-opt=-f%*} \
     %{O*:-plugin-opt=-O%*} \
     %{w:-plugin-opt=-w} \
     %{f*:-plugin-opt=-f%*} \
index 49f2efb..cabfcca 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-08  Rafael Avila de Espindola  <espindola@google.com>
+
+       * lto-plugin.c (add_input_library): New.
+       (all_symbols_read_handler): Use add_input_library for items that
+       start with -l.
+       (process_option): Fit in 80 columns.
+       (onload): Handle LDPT_ADD_INPUT_LIBRARY.
+
 2009-10-02  Diego Novillo  <dnovillo@google.com>
 
        * Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
 2009-10-02  Diego Novillo  <dnovillo@google.com>
 
        * Makefile.am (AM_CPPFLAGS): Remove -D_LARGEFILE_SOURCE
index a0c1a54..71b4961 100644 (file)
@@ -81,6 +81,7 @@ static ld_plugin_register_all_symbols_read register_all_symbols_read;
 static ld_plugin_get_symbols get_symbols;
 static ld_plugin_register_cleanup register_cleanup;
 static ld_plugin_add_input_file add_input_file;
 static ld_plugin_get_symbols get_symbols;
 static ld_plugin_register_cleanup register_cleanup;
 static ld_plugin_add_input_file add_input_file;
+static ld_plugin_add_input_library add_input_library;
 
 static struct plugin_file_info *claimed_files = NULL;
 static unsigned int num_claimed_files = 0;
 
 static struct plugin_file_info *claimed_files = NULL;
 static unsigned int num_claimed_files = 0;
@@ -467,7 +468,10 @@ all_symbols_read_handler (void)
       unsigned int i;
       for (i = 0; i < num_pass_through_items; i++)
         {
       unsigned int i;
       for (i = 0; i < num_pass_through_items; i++)
         {
-          add_input_file (pass_through_items[i]);
+          if (strncmp (pass_through_items[i], "-l", 2) == 0)
+            add_input_library (pass_through_items[i] + 2);
+          else
+            add_input_file (pass_through_items[i]);
           free (pass_through_items[i]);
           pass_through_items[i] = NULL;
         }
           free (pass_through_items[i]);
           pass_through_items[i] = NULL;
         }
@@ -607,8 +611,10 @@ process_option (const char *option)
   else if (!strncmp (option, "-pass-through=", strlen("-pass-through=")))
     {
       num_pass_through_items++;
   else if (!strncmp (option, "-pass-through=", strlen("-pass-through=")))
     {
       num_pass_through_items++;
-      pass_through_items = realloc (pass_through_items, num_pass_through_items * sizeof (char *));
-      pass_through_items[num_pass_through_items - 1] = strdup (option + strlen ("-pass-through="));
+      pass_through_items = realloc (pass_through_items,
+                                    num_pass_through_items * sizeof (char *));
+      pass_through_items[num_pass_through_items - 1] =
+          strdup (option + strlen ("-pass-through="));
     }
   else
     {
     }
   else
     {
@@ -655,6 +661,9 @@ onload (struct ld_plugin_tv *tv)
        case LDPT_ADD_INPUT_FILE:
          add_input_file = p->tv_u.tv_add_input_file;
          break;
        case LDPT_ADD_INPUT_FILE:
          add_input_file = p->tv_u.tv_add_input_file;
          break;
+       case LDPT_ADD_INPUT_LIBRARY:
+         add_input_library = p->tv_u.tv_add_input_library;
+         break;
        case LDPT_OPTION:
          process_option (p->tv_u.tv_string);
          break;
        case LDPT_OPTION:
          process_option (p->tv_u.tv_string);
          break;