File gcc46-bnc747918.diff of Package gcc46

2012-02-07  Jakub Jelinek  <jakub@redhat.com>
 
	* gcc.c (main): Don't look for lto-wrapper or lto-wrapper
	or LTOPLUGINSONAME if have_c.

Index: gcc/gcc.c
===================================================================
*** gcc/gcc.c.orig	2012-03-15 10:38:07.000000000 +0100
--- gcc/gcc.c	2012-03-15 10:40:29.000000000 +0100
*************** main (int argc, char **argv)
*** 6441,6447 ****
  
    /* Set up to remember the pathname of the lto wrapper. */
  
!   lto_wrapper_file = find_a_file (&exec_prefixes, "lto-wrapper", X_OK, false);
    if (lto_wrapper_file)
      {
        lto_wrapper_spec = lto_wrapper_file;
--- 6441,6451 ----
  
    /* Set up to remember the pathname of the lto wrapper. */
  
!   if (have_c)
!     lto_wrapper_file = NULL;
!   else
!     lto_wrapper_file = find_a_file (&exec_prefixes, "lto-wrapper",
! 				    X_OK, false);
    if (lto_wrapper_file)
      {
        lto_wrapper_spec = lto_wrapper_file;
*************** warranty; not even for MERCHANTABILITY o
*** 6819,6853 ****
    if (num_linker_inputs > 0 && !seen_error () && print_subprocess_help < 2)
      {
        int tmp = execution_count;
  #ifdef HAVE_LTO_PLUGIN
!       const char *fno_use_linker_plugin = "fno-use-linker-plugin";
  #else
!       const char *fuse_linker_plugin = "fuse-linker-plugin";
  #endif
  
!       /* We'll use ld if we can't find collect2.  */
!       if (! strcmp (linker_name_spec, "collect2"))
! 	{
! 	  char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
! 	  if (s == NULL)
! 	    linker_name_spec = "ld";
! 	}
  
  #ifdef HAVE_LTO_PLUGIN
!       if (!switch_matches (fno_use_linker_plugin,
! 			   fno_use_linker_plugin + strlen (fno_use_linker_plugin), 0))
  #else
!       if (switch_matches (fuse_linker_plugin,
! 			  fuse_linker_plugin + strlen (fuse_linker_plugin), 0))
  #endif
! 	{
! 	  linker_plugin_file_spec = find_a_file (&exec_prefixes,
! 						 LTOPLUGINSONAME, R_OK,
! 						 false);
! 	  if (!linker_plugin_file_spec)
! 	    fatal_error ("-fuse-linker-plugin, but " LTOPLUGINSONAME " not found");
  	}
-       lto_gcc_spec = argv[0];
  
        /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  	 for collect.  */
--- 6823,6863 ----
    if (num_linker_inputs > 0 && !seen_error () && print_subprocess_help < 2)
      {
        int tmp = execution_count;
+ 
+       if (! have_c)
+ 	{
  #ifdef HAVE_LTO_PLUGIN
! 	  const char *fno_use_linker_plugin = "fno-use-linker-plugin";
  #else
! 	  const char *fuse_linker_plugin = "fuse-linker-plugin";
  #endif
  
! 	  /* We'll use ld if we can't find collect2.  */
! 	  if (! strcmp (linker_name_spec, "collect2"))
! 	    {
! 	      char *s = find_a_file (&exec_prefixes, "collect2", X_OK, false);
! 	      if (s == NULL)
! 		linker_name_spec = "ld";
! 	    }
  
  #ifdef HAVE_LTO_PLUGIN
! 	  if (!switch_matches (fno_use_linker_plugin,
! 			       fno_use_linker_plugin
! 			       + strlen (fno_use_linker_plugin), 0))
  #else
! 	    if (switch_matches (fuse_linker_plugin,
! 				fuse_linker_plugin
! 				+ strlen (fuse_linker_plugin), 0))
  #endif
! 	      {
! 		linker_plugin_file_spec = find_a_file (&exec_prefixes,
! 						       LTOPLUGINSONAME, R_OK,
! 						       false);
! 		if (!linker_plugin_file_spec)
! 		  fatal_error ("-fuse-linker-plugin, but " LTOPLUGINSONAME " not found");
! 	      }
! 	  lto_gcc_spec = argv[0];
  	}
  
        /* Rebuild the COMPILER_PATH and LIBRARY_PATH environment variables
  	 for collect.  */
openSUSE Build Service is sponsored by