0

I realize this is unsupported, but I'm trying to understand if there's some way around it.

bazel build //src/envoy

ERROR: /home/christy/.cache/bazel/_bazel_christy/bf2fef385bbf6e59110f7665da7ca8d6/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_ppc64le_stripped/stdlib~/pkg failed (Exit 1)`
<br>
`# runtime/cgo`
`gcc_libinit.c: In function 'int _cgo_try_pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)':
gcc_libinit.c:106:21: error: invalid conversion from 'void*' to 'timespec*' [-fpermissive]
   nanosleep(&ts, nil);

I'm compiling istio/proxy more or less with bazel 0.11.1 (compiled on my host).

From reading other issues, it seems that I need to have GoStdlib compiled using gcc instead of g++, but that's not the case:

(cd /home/christy/.cache/bazel/_bazel_christy/bf2fef385bbf6e59110f7665da7ca8d6/execroot/__main__ && \
exec env - \
TMPDIR=/tmp \
/home/christy/.cache/bazel/_bazel_christy/bf2fef385bbf6e59110f7665da7ca8d6/execroot/__main__/_bin/linux-sandbox -t 15 -w /home/christy/.cache/bazel/_bazel_christy/bf2fef385bbf6e59110f7665da7ca8d6/bazel-sandbox/2886789570067698588/execroot/__main__ -w /tmp -w /dev/shm -D -- bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_ppc64le_stripped/stdlib -go external/go_sdk/bin/go -root_file external/go_sdk/packages.txt -goos linux -goarch ppc64le '-cgo=1' -compiler_path /usr/bin -cc /usr/bin/g++ -cpp_flag -U_FORTIFY_SOURCE -cpp_flag -fstack-protector -cpp_flag -B/usr/bin -cpp_flag -B/usr/bin -cpp_flag -Wunused-but-set-parameter -cpp_flag -Wno-free-nonheap-object -cpp_flag -fno-omit-frame-pointer -cpp_flag -g0 -cpp_flag -O2 -cpp_flag '-D_FORTIFY_SOURCE=1' -cpp_flag -DNDEBUG -cpp_flag -ffunction-sections -cpp_flag -fdata-sections -cpp_flag -g0 -ld_flag -lm -ld_flag '-fuse-ld=gold' -ld_flag -Wl,-no-as-needed -ld_flag -Wl,-z,relro,-z,now -ld_flag -B/usr/bin -ld_flag -B/usr/bin -ld_flag -pass-exit-codes -out 'bazel-out/host/bin/external/io_bazel_rules_go/linux_ppc64le_stripped/stdlib~')
Jin
  • 12,748
  • 3
  • 36
  • 41
Christy
  • 239
  • 2
  • 7
  • I've found a spot in the envoy bazel files where it looks to be preventing the ability to override the gcc compiler by setting it to what's set for cc every time. If I tweak that then some things that need a pure C compiler work, but it's still not solved. – Christy Mar 28 '18 at 14:36
  • cherry-picking in two upstream envoy commits that reworked how the C/C++ toolchains are set up seem to have gotten me around this. – Christy Mar 28 '18 at 20:01

0 Answers0