Guest User

patch-gcc.c

a guest
Nov 8th, 2010
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. 2010-10-30 Alexander Williams <[email protected]>
  2.  
  3. Index: gcc/gcc.c
  4. ===================================================================
  5. --- gcc/gcc.c
  6. +++ gcc/gcc.c (working copy)
  7. @@ -1753,7 +1753,8 @@
  8. {
  9. char *buf;
  10.  
  11. - buf = concat ("%{static|static-libgcc:", static_name, " ", eh_name, "}"
  12. + buf = concat ("%{pg:", static_name, " ", eh_name, "} %{!pg:",
  13. + "%{static|static-libgcc|pg:", static_name, " ", eh_name, "}"
  14. "%{!static:%{!static-libgcc:"
  15. #if USE_LD_AS_NEEDED
  16. "%{!shared-libgcc:",
  17. @@ -1776,7 +1777,7 @@
  18. "%{shared:", shared_name, "}"
  19. #endif
  20. #endif
  21. - "}}", NULL);
  22. + "}}}", NULL);
  23.  
  24. obstack_grow (obstack, buf, strlen (buf));
  25. free (buf);
  26. @@ -3601,6 +3602,44 @@
  27. exit (status);
  28. }
  29.  
  30. + /* Options specified as if they appeared on the command line. */
  31. + temp = getenv ("GCC_OPTIONS");
  32. + if ((temp) && (strlen (temp) > 0))
  33. + {
  34. + int len;
  35. + int optc = 1;
  36. + int new_argc;
  37. + const char **new_argv;
  38. + char *envopts;
  39. +
  40. + while (ISSPACE (*temp))
  41. + temp++;
  42. + len = strlen (temp);
  43. + envopts = (char *) xmalloc (len + 1);
  44. + strcpy (envopts, temp);
  45. +
  46. + for (i = 0; i < (len - 1); i++)
  47. + if ((ISSPACE (envopts[i])) && ! (ISSPACE (envopts[i+1])))
  48. + optc++;
  49. +
  50. + new_argv = (const char **) alloca ((optc + argc) * sizeof(char *));
  51. +
  52. + for (i = 0, new_argc = 1; new_argc <= optc; new_argc++)
  53. + {
  54. + while (ISSPACE (envopts[i]))
  55. + i++;
  56. + new_argv[new_argc] = envopts + i;
  57. + while (!ISSPACE (envopts[i]) && (envopts[i] != '\0'))
  58. + i++;
  59. + envopts[i++] = '\0';
  60. + }
  61. + for (i = 1; i < argc; i++)
  62. + new_argv[new_argc++] = argv[i];
  63. +
  64. + argv = new_argv;
  65. + argc = new_argc;
  66. + }
  67. +
  68. /* Convert new-style -- options to old-style. */
  69. translate_options (&argc,
  70. CONST_CAST2 (const char *const **, const char ***,
  71. @@ -7087,6 +7126,7 @@
  72.  
  73. /* Sysrooted prefixes are relocated because target_system_root is
  74. also relocated by gcc_exec_prefix. */
  75. +
  76. if (*standard_startfile_prefix_1)
  77. add_sysrooted_prefix (&startfile_prefixes,
  78. standard_startfile_prefix_1, "BINUTILS",
  79. @@ -7304,7 +7344,7 @@
  80. }
  81.  
  82. if (n_infiles == added_libraries)
  83. - fatal ("no input files");
  84. + fatal ("No input files specified");
  85.  
  86. /* Make a place to record the compiler output file names
  87. that correspond to the input files. */
Advertisement
Add Comment
Please, Sign In to add comment