~ubuntu-branches/debian/sid/gcc-4.8/sid

« back to all changes in this revision

Viewing changes to .svn/pristine/80/80978a03317dd74d21fae19a1c8e59d3f06045c5.svn-base

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-12-19 19:48:34 UTC
  • Revision ID: package-import@ubuntu.com-20141219194834-4dz1q7rrn5pad823
Tags: 4.8.4-1
* GCC 4.8.4 release.
  - Fix PR target/61407 (darwin), PR middle-end/58624 (ice),
    PR sanitizer/64265 (wrong code).
* Require recent binutils to pass go test failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: Pass -fuse-ld=gold to gccgo on targets supporting -fsplit-stack
 
2
 
 
3
gcc/go/                                                                                      
 
4
                                                                                             
 
5
        * gospec.c (lang_specific_driver): Pass -fuse-ld=gold on targets                     
 
6
        supporting -fsplit-stack, unless overwritten.                                        
 
7
                                                                                             
 
8
gcc/                                                                                         
 
9
        * configure.ac: New define HAVE_GOLD_NON_DEFAULT.                                    
 
10
        * config.in: Regenerate.                                                             
 
11
                                                                                             
 
12
libgo/                                                                                       
 
13
        * configure.ac (libgo_cv_c_linker_supports_split_stack): Fix quoting.                
 
14
        Check the linker used by the gccgo driver.                            
 
15
 
 
16
Index: b/src/gcc/go/gospec.c
 
17
===================================================================
 
18
--- a/src/gcc/go/gospec.c
 
19
+++ b/src/gcc/go/gospec.c
 
20
@@ -117,6 +117,10 @@
 
21
   /* Whether the -S option was used.  */
 
22
   bool saw_opt_S = false;
 
23
 
 
24
+  /* "-fuse-ld=" if it appears on the command line.  */
 
25
+  bool saw_use_ld = false;
 
26
+  int need_gold = 0;
 
27
+
 
28
   /* The first input file with an extension of .go.  */
 
29
   const char *first_go_file = NULL;  
 
30
 
 
31
@@ -217,6 +221,11 @@
 
32
            }
 
33
 
 
34
          break;
 
35
+
 
36
+       case OPT_fuse_ld_bfd:
 
37
+       case OPT_fuse_ld_gold:
 
38
+         saw_use_ld = true;
 
39
+         break;
 
40
        }
 
41
     }
 
42
 
 
43
@@ -226,8 +235,14 @@
 
44
   shared_libgcc = 0;
 
45
 #endif
 
46
 
 
47
+#if defined(TARGET_CAN_SPLIT_STACK) && defined(HAVE_GOLD_NON_DEFAULT)
 
48
+  if (!saw_use_ld)
 
49
+    need_gold = 1;
 
50
+#endif
 
51
+
 
52
   /* Make sure to have room for the trailing NULL argument.  */
 
53
-  num_args = argc + need_math + shared_libgcc + (library > 0) * 5 + 10;
 
54
+  num_args = argc + need_math + shared_libgcc + need_gold +
 
55
+    (library > 0) * 5 + 10;
 
56
   new_decoded_options = XNEWVEC (struct cl_decoded_option, num_args);
 
57
 
 
58
   i = 0;
 
59
@@ -244,6 +259,14 @@
 
60
                       &new_decoded_options[j]);
 
61
       j++;
 
62
     }
 
63
+#ifdef HAVE_GOLD_NON_DEFAULT
 
64
+  if (need_gold)
 
65
+    {
 
66
+      generate_option (OPT_fuse_ld_gold, NULL, 1, CL_DRIVER,
 
67
+                      &new_decoded_options[j]);
 
68
+      j++;
 
69
+    }
 
70
+#endif
 
71
 #endif
 
72
 
 
73
   /* NOTE: We start at 1 now, not 0.  */
 
74
Index: b/src/libgo/configure.ac
 
75
===================================================================
 
76
--- a/src/libgo/configure.ac
 
77
+++ b/src/libgo/configure.ac
 
78
@@ -348,10 +348,10 @@
 
79
 dnl others.
 
80
 AC_CACHE_CHECK([whether linker supports split stack],
 
81
 [libgo_cv_c_linker_supports_split_stack],
 
82
-libgo_cv_c_linker_supports_split_stack=no
 
83
-if $LD --help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; then
 
84
+[libgo_cv_c_linker_supports_split_stack=no
 
85
+if $GOC -Wl,--help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; then
 
86
   libgo_cv_c_linker_supports_split_stack=yes
 
87
-fi)
 
88
+fi])
 
89
 if test "$libgo_cv_c_linker_supports_split_stack" = yes; then
 
90
   AC_DEFINE(LINKER_SUPPORTS_SPLIT_STACK, 1,
 
91
            [Define if the linker support split stack adjustments])
 
92
Index: b/src/gcc/config.in
 
93
===================================================================
 
94
--- a/src/gcc/config.in
 
95
+++ b/src/gcc/config.in
 
96
@@ -1133,6 +1133,12 @@
 
97
 #endif
 
98
 
 
99
 
 
100
+/* Define if the gold linker is available as a non-default */
 
101
+#ifndef USED_FOR_TARGET
 
102
+#undef HAVE_GOLD_NON_DEFAULT
 
103
+#endif
 
104
+
 
105
+
 
106
 /* Define if you have the iconv() function. */
 
107
 #ifndef USED_FOR_TARGET
 
108
 #undef HAVE_ICONV
 
109
Index: b/src/gcc/configure.ac
 
110
===================================================================
 
111
--- a/src/gcc/configure.ac
 
112
+++ b/src/gcc/configure.ac
 
113
@@ -2059,6 +2059,12 @@
 
114
 fi
 
115
 AC_MSG_RESULT($ld_is_gold)
 
116
 
 
117
+# Check to see if ld is used, and gold is available
 
118
+if test x$ld_is_gold = xno && which ${gcc_cv_ld}.gold >/dev/null 2>&1; then
 
119
+  AC_DEFINE(HAVE_GOLD_NON_DEFAULT, 1,
 
120
+           [Define if the gold linker is available as a non-default])
 
121
+fi
 
122
+
 
123
 ORIGINAL_LD_FOR_TARGET=$gcc_cv_ld
 
124
 AC_SUBST(ORIGINAL_LD_FOR_TARGET)
 
125
 case "$ORIGINAL_LD_FOR_TARGET" in