We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03a849f commit 457c06cCopy full SHA for 457c06c
src/cmd/go/testdata/script/build_issue413974.txt
@@ -0,0 +1,37 @@
1
+# Regression test for https://go.dev/issue/413974:
2
+# cgo build should reproduce binaries with LTO enable
3
+
4
+[!cgo] skip
5
6
+env GOFLAGS=-ldflags=-linkmode=external
7
+env CGO_CFLAGS=-flto
8
9
+go build -o main.exe
10
+mv main.exe main1.exe
11
12
+go clean -cache
13
14
15
+mv main.exe main2.exe
16
17
+cmp -q main2.exe main1.exe
18
19
+exec sha256sum main2.exe
20
+exec sha256sum main1.exe
21
22
+-- go.mod --
23
+module main
24
25
+go 1.18
26
+-- main.go --
27
+package main
28
29
+import "C"
30
31
+import "runtime"
32
33
+var _ C.int
34
35
+func main() {
36
+ println(runtime.GOROOT())
37
+}
0 commit comments