diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch index 17fa9d9831..43be5cd2e8 100644 --- a/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch +++ b/meta/recipes-devtools/go/go/0001-cmd-go-make-content-based-hash-generation-less-pedan.patch | |||
@@ -74,7 +74,7 @@ index c88b315..a06455c 100644 | |||
74 | + cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true) | 74 | + cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true) |
75 | 75 | ||
76 | - ccExe := b.ccExe() | 76 | - ccExe := b.ccExe() |
77 | + ccExe := filterCompilerFlags(b.ccExe()) | 77 | + ccExe := filterCompilerFlags(b.ccExe(), true) |
78 | fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) | 78 | fmt.Fprintf(h, "CC=%q %q %q %q\n", ccExe, cppflags, cflags, ldflags) |
79 | // Include the C compiler tool ID so that if the C | 79 | // Include the C compiler tool ID so that if the C |
80 | // compiler changes we rebuild the package. | 80 | // compiler changes we rebuild the package. |
@@ -83,7 +83,7 @@ index c88b315..a06455c 100644 | |||
83 | } | 83 | } |
84 | if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { | 84 | if len(p.CXXFiles)+len(p.SwigCXXFiles) > 0 { |
85 | - cxxExe := b.cxxExe() | 85 | - cxxExe := b.cxxExe() |
86 | + cxxExe := filterCompilerFlags(b.cxxExe()) | 86 | + cxxExe := filterCompilerFlags(b.cxxExe(), true) |
87 | fmt.Fprintf(h, "CXX=%q %q\n", cxxExe, cxxflags) | 87 | fmt.Fprintf(h, "CXX=%q %q\n", cxxExe, cxxflags) |
88 | if cxxID, err := b.gccToolID(cxxExe[0], "c++"); err == nil { | 88 | if cxxID, err := b.gccToolID(cxxExe[0], "c++"); err == nil { |
89 | fmt.Fprintf(h, "CXX ID=%q\n", cxxID) | 89 | fmt.Fprintf(h, "CXX ID=%q\n", cxxID) |
@@ -91,7 +91,7 @@ index c88b315..a06455c 100644 | |||
91 | } | 91 | } |
92 | if len(p.FFiles) > 0 { | 92 | if len(p.FFiles) > 0 { |
93 | - fcExe := b.fcExe() | 93 | - fcExe := b.fcExe() |
94 | + fcExe := filterCompilerFlags(b.fcExe()) | 94 | + fcExe := filterCompilerFlags(b.fcExe(), true) |
95 | fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) | 95 | fmt.Fprintf(h, "FC=%q %q\n", fcExe, fflags) |
96 | if fcID, err := b.gccToolID(fcExe[0], "f95"); err == nil { | 96 | if fcID, err := b.gccToolID(fcExe[0], "f95"); err == nil { |
97 | fmt.Fprintf(h, "FC ID=%q\n", fcID) | 97 | fmt.Fprintf(h, "FC ID=%q\n", fcID) |
@@ -104,20 +104,22 @@ index c88b315..a06455c 100644 | |||
104 | } | 104 | } |
105 | 105 | ||
106 | // Configuration specific to compiler toolchain. | 106 | // Configuration specific to compiler toolchain. |
107 | @@ -2705,8 +2707,23 @@ func envList(key, def string) []string { | 107 | @@ -2705,8 +2707,25 @@ func envList(key, def string) []string { |
108 | return args | 108 | return args |
109 | } | 109 | } |
110 | 110 | ||
111 | +var filterFlags = os.Getenv("CGO_PEDANTIC") == "" | 111 | +var filterFlags = os.Getenv("CGO_PEDANTIC") == "" |
112 | + | 112 | + |
113 | +func filterCompilerFlags(flags []string) []string { | 113 | +func filterCompilerFlags(flags []string, keepfirst bool) []string { |
114 | + var newflags []string | 114 | + var newflags []string |
115 | + var realkeepfirst bool = keepfirst | ||
115 | + if !filterFlags { | 116 | + if !filterFlags { |
116 | + return flags | 117 | + return flags |
117 | + } | 118 | + } |
118 | + for _, flag := range flags { | 119 | + for _, flag := range flags { |
119 | + if strings.HasPrefix(flag, "-m") { | 120 | + if strings.HasPrefix(flag, "-m") || realkeepfirst { |
120 | + newflags = append(newflags, flag) | 121 | + newflags = append(newflags, flag) |
122 | + realkeepfirst = false | ||
121 | + } | 123 | + } |
122 | + } | 124 | + } |
123 | + return newflags | 125 | + return newflags |
@@ -129,21 +131,21 @@ index c88b315..a06455c 100644 | |||
129 | defaults := "-g -O2" | 131 | defaults := "-g -O2" |
130 | 132 | ||
131 | if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { | 133 | if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { |
132 | @@ -2724,6 +2741,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l | 134 | @@ -2724,6 +2743,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l |
133 | if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { | 135 | if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { |
134 | return | 136 | return |
135 | } | 137 | } |
136 | + if filtered { | 138 | + if filtered { |
137 | + cppflags = filterCompilerFlags(cppflags) | 139 | + cppflags = filterCompilerFlags(cppflags, false) |
138 | + cflags = filterCompilerFlags(cflags) | 140 | + cflags = filterCompilerFlags(cflags, false) |
139 | + cxxflags = filterCompilerFlags(cxxflags) | 141 | + cxxflags = filterCompilerFlags(cxxflags, false) |
140 | + fflags = filterCompilerFlags(fflags) | 142 | + fflags = filterCompilerFlags(fflags, false) |
141 | + ldflags = filterCompilerFlags(ldflags) | 143 | + ldflags = filterCompilerFlags(ldflags, false) |
142 | + } | 144 | + } |
143 | 145 | ||
144 | return | 146 | return |
145 | } | 147 | } |
146 | @@ -2739,7 +2763,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`) | 148 | @@ -2739,7 +2765,7 @@ var cgoRe = lazyregexp.New(`[/\\:]`) |
147 | 149 | ||
148 | func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { | 150 | func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { |
149 | p := a.Package | 151 | p := a.Package |
@@ -152,7 +154,7 @@ index c88b315..a06455c 100644 | |||
152 | if err != nil { | 154 | if err != nil { |
153 | return nil, nil, err | 155 | return nil, nil, err |
154 | } | 156 | } |
155 | @@ -3246,7 +3270,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { | 157 | @@ -3246,7 +3272,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { |
156 | 158 | ||
157 | // Run SWIG on one SWIG input file. | 159 | // Run SWIG on one SWIG input file. |
158 | func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { | 160 | func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { |