We're about to move this package to cmd/cgo/internal, where it will
get caught up in the "CGO_ENABLED=0 go install cmd" done by make.bash.
Currently, building this package with CGO_ENABLED=0 fails because it
contains several source files that don't themselves import "C", but do
import a subdirectory where that package imports "C" and thus has no
exported API.
Fix the CGO_ENABLED=0 build of this package by adding the necessary
cgo build tags. Not all source files need it, but this CL makes
"CGO_ENABLED=0 go test -c" work in this package.
For #37486.
Change-Id: Id137cdfbdd950eea802413536d990ab642ebcd7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/493215
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
20 files changed:
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
import "testing"
package cgotest
import "testing"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build cgo && !windows
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build cgo && !windows
// Issue 18146: pthread_create failure during syscall.Exec.
// Issue 18146: pthread_create failure during syscall.Exec.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that we can have two identical cgo packages in a single binary.
// No runtime test; just make sure it compiles.
// Test that we can have two identical cgo packages in a single binary.
// No runtime test; just make sure it compiles.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 26430: incomplete typedef leads to inconsistent typedefs error.
// No runtime test; just make sure it compiles.
// Issue 26430: incomplete typedef leads to inconsistent typedefs error.
// No runtime test; just make sure it compiles.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 26743: typedef of uint leads to inconsistent typedefs error.
// No runtime test; just make sure it compiles.
// Issue 26743: typedef of uint leads to inconsistent typedefs error.
// No runtime test; just make sure it compiles.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Failed to resolve typedefs consistently.
// No runtime test; just make sure it compiles.
// Failed to resolve typedefs consistently.
// No runtime test; just make sure it compiles.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
+//go:build cgo && !windows
// Issue 29563: internal linker fails on duplicate weak symbols.
// No runtime test; just make sure it compiles.
// Issue 29563: internal linker fails on duplicate weak symbols.
// No runtime test; just make sure it compiles.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 30527: function call rewriting casts untyped
// constants to int because of ":=" usage.
// Issue 30527: function call rewriting casts untyped
// constants to int because of ":=" usage.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cgotest
// Issue 43639: No runtime test needed, make sure package misc/cgo/test/issue43639 compiles well.
package cgotest
// Issue 43639: No runtime test needed, make sure package misc/cgo/test/issue43639 compiles well.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 52611: inconsistent compiler behaviour when compiling a C.struct.
// No runtime test; just make sure it compiles.
// Issue 52611: inconsistent compiler behaviour when compiling a C.struct.
// No runtime test; just make sure it compiles.
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Issue 8828: compiling a file with -compiler=gccgo fails if a .c file
// has the same name as compiled directory.
// Issue 8828: compiling a file with -compiler=gccgo fails if a .c file
// has the same name as compiled directory.
+// Copyright 2023 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build cgo
+
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Test that we can link together two different cgo packages that both
// use the same libgcc function.
// Test that we can link together two different cgo packages that both
// use the same libgcc function.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.