[flang-commits] [clang] [flang] [flang][Driver] Support -pthread in the frontend (PR #77360)

Kareem Ergawy via flang-commits flang-commits at lists.llvm.org
Wed Jan 10 22:28:09 PST 2024


ergawy wrote:

Sorry for the late reply. This slipped my mind. Added myself as a reviewer to not forget.

> Could you take a look at #77135 and see whether `-gpulibc` could be helpful for testing?

I don't think this will help since that's a different library, right?

For testing purposes, something like adding `-nolibc` ([see](https://github.com/llvm/llvm-project/blob/main/clang/lib/Driver/ToolChains/Gnu.cpp#L619-L620)) **_might_** help I assume but it is not supported for `flang`. For example, if you try the equivalent C example for the Fortran code I attached above and compile it with `clang -nolibc`, you get: `/usr/bin/ld: test_pthread.c:(.text+0xd6): undefined reference to `pthread_create'`. And I say "**_might help_**" because even if you try `clang -nolibc -pthread` you would still get the linker error because the `pthread` library is simply empty (i.e. does define any symbols) (at least for my Ubuntu system; don't know how general this is for GNU toolchains).

https://github.com/llvm/llvm-project/pull/77360


More information about the flang-commits mailing list