Skip to content

Commit f6d4107

Browse files
committed
fix error with posix functions
> The error is coming from Go's CGo trying to build the standard library with the Zig C++ compiler, and it's failing to find certain POSIX terminal functions (grantpt, posix_openpt, ptsname, unlockpt). ``` bazel-out/darwin_x86_64-fastbuild-ST-1dd79e0b6a44/bin/external/rules_go~0.45.1/stdlib_/src/internal/testpty/pty_cgo.go:24:17: could not determine kind of name for C.grantpt bazel-out/darwin_x86_64-fastbuild-ST-1dd79e0b6a44/bin/external/rules_go~0.45.1/stdlib_/src/internal/testpty/pty_cgo.go:20:12: could not determine kind of name for C.posix_openpt bazel-out/darwin_x86_64-fastbuild-ST-1dd79e0b6a44/bin/external/rules_go~0.45.1/stdlib_/src/internal/testpty/pty_cgo.go:32:26: could not determine kind of name for C.ptsname bazel-out/darwin_x86_64-fastbuild-ST-1dd79e0b6a44/bin/external/rules_go~0.45.1/stdlib_/src/internal/testpty/pty_cgo.go:28:17: could not determine kind of name for C.unlockpt ```
1 parent 7760991 commit f6d4107

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

toolchain/private/defs.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ def _target_linux_gnu(gocpu, zigcpu, glibc_version):
161161
linkopts = [],
162162
dynamic_library_linkopts = [],
163163
supports_dynamic_linker = True,
164-
copts = [],
164+
copts = [
165+
"-D_POSIX_C_SOURCE=200809L",
166+
],
165167
libc = "glibc",
166168
bazel_target_cpu = "k8",
167169
constraint_values = [

0 commit comments

Comments
 (0)