Commit 7bf46c1
Pass large ldflags to cgo via response file instead of env variable. (#4386)
**What type of PR is this?**
Bug fix
**What does this PR do? Why is it needed?**
Pass ldflags to cgo tool via a response file instead of `CGO_LDFLAGS`
env variable for go 1.23+. This avoids the "argument list too long"
error, which can happen if `CGO_LDFLAGS` is so large that it exceeds the
system limits.
Support to accept ldflags via file was added to `go` more than a year
ago. References:
- https://go-review.googlesource.com/c/go/+/584655
- Discussion: golang/go#66456
**Which issues(s) does this PR fix?**
Fixes #2654
---------
Co-authored-by: Dhiraj Goel <[email protected]>
Co-authored-by: Jay Conrod <[email protected]>1 parent 98940c3 commit 7bf46c1
2 files changed
+77
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
99 | 132 | | |
100 | 133 | | |
101 | 134 | | |
| |||
142 | 175 | | |
143 | 176 | | |
144 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
145 | 182 | | |
146 | 183 | | |
147 | 184 | | |
| |||
438 | 475 | | |
439 | 476 | | |
440 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
334 | 358 | | |
335 | 359 | | |
336 | 360 | | |
| |||
0 commit comments