Skip to content

pthreads.h missing when cross-compiling from OS X to Windows #234

@jonasteuwen

Description

@jonasteuwen

In particular, I'm using abseill-cpp, which will assume the existence of pthreads.h

(08:59:11) ERROR: /private/var/tmp/_bazel_jonasteuwen/d145e1e5b1c819e6d5e937b13f41ba9f/external/abseil-cpp~/absl/base/BUILD.bazel:248:11: Compiling absl/base/internal/thread_identity.cc failed: (Exit 1): c++ failed: error executing CppCompile command (from target @@abseil-cpp~//absl/base:base) external/hermetic_cc_toolchain~~toolchains~zig_config/tools/x86_64-windows-gnu/c++ -MD -MF bazel-out/darwin_arm64-opt/bin/external/abseil-cpp~/absl/base/_objs/base/thread_identity.d ... (remaining 57 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
external/abseil-cpp~/absl/base/internal/thread_identity.cc:18:10: fatal error: 'pthread.h' file not found
   18 | #include <pthread.h>
      |          ^~~~~~~~~~~
1 error generated.

This seems to be related to ziglang/zig#10989, where they seem to have solved the problem. I see that ziglang/zig#22156 apparently would solve it.

However, that doesn't seem to be exposed in hermetic_cc_toolchain. Any known workarounds?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions