Skip to content

doesn't recognize -pthread option #142

Closed

Description

@ygrek

e.g. https://github.com/ygrek/mldonkey/actions/runs/10475349585/job/29011798015#step:7:26

I am pretty sure I don't need this option for ocaml builds and can find workarounds, but just to let you know

ftr from man gcc:

       -pthread
           Define additional macros required for using the POSIX threads library.  You should use this option consistently for both compilation and
           linking.  This option is supported on GNU/Linux targets, most other Unix derivatives, and also on x86 Cygwin and MinGW targets.

Activity

  1. dra27 commented on Nov 22, 2024

    @dra27
    Member

    Note that for OCaml 5.x this flag should be unnecessary on all builds, as the runtime requires pthreads (in fact, I think adding -pthread might even cause problems for the mingw-w64 build, because it links pthreads statically).

    For mingw-w64 on OCaml 4.x - but the key thing is that it should be being added as -link -pthread (i.e. it should be being passed from OCaml as -ccopt -link -ccopt -pthread)

  2. linked a pull request that will close this issuePass -pthread to the linker #148on Dec 16, 2024
  3. dra27 commented on Dec 16, 2024

    @dra27
    Member

    This is fixed for gcc-based toolchains (i.e. for mingw-w64) by passing the option on directly - note that if compiling for the MSVC port of OCaml, there'll still need to be handling on the caller's side to avoid passing -pthread at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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