Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang on Cygwin64 compains about -mthreads #38

Closed
3 tasks done
Lastique opened this issue Jun 9, 2021 · 0 comments · Fixed by #284
Closed
3 tasks done

Clang on Cygwin64 compains about -mthreads #38

Lastique opened this issue Jun 9, 2021 · 0 comments · Fixed by #284
Labels
bug Something isn't working

Comments

@Lastique
Copy link
Contributor

Lastique commented Jun 9, 2021

Make sure you completed the following tasks

Environment and version details

  • Operating System+version: Windows 10, Cygwin64
  • Compiler+version: Clang 8.0.1
  • Shell: Bash
  • B2 Version: Boost.Build develop, revision ae1b579

Brief problem description

Boost.Build inserts -mthreads argument to the compiler command line, which the compiler doesn't recognize.

Also, the compiler is detected as clang-linux-4, even though it is clang 8 on Cygwin. At least the version seems off.

Steps to reproduce the issue

  1. Build b2 in Cygwin64. Use the workaround proposed in Building b2 on Cygwin64 fails #37.
  2. Build Boost.Filesystem tests (I use it as an example; the problem likely reproduces with any project). Command line: ./bjam.exe -j 8 toolset=clang cxxstd=17 address-model=64 variant=release threading=multi runtime-link=shared optimization=speed inlining=full libs/filesystem/test

Actual behavior summary

The compiler output contains lots of warnings like these:

clang-linux.compile.c++.without-pch bin.v2/libs/filesystem/test/macro_default_test.test/clang-linux-4/release/cxxstd-17-iso/threading-multi/visibility-hidden/macro_default_test.obj
clang-8: warning: argument unused during compilation: '-mthreads' [-Wunused-command-line-argument]

Expected behavior summary

No such warnings should be present. The compiler version should be correct, instead of clang-linux-4.

@Lastique Lastique added the bug Something isn't working label Jun 9, 2021
Kojoley added a commit to Kojoley/build that referenced this issue Apr 23, 2023
-mthreads is obsolete and is not presented in clang, and was never a thing in cygwin (fixes bfgroup#38).

I have no idea why clang was configured to add -pthread on threadapi=win32, changing this is a breaking change but is the right thing to do. I run Boost.Thread tests and it passed cleanly on both threadapi=win32 and threadapi=pthread.
grafikrobot pushed a commit that referenced this issue Apr 24, 2023
-mthreads is obsolete and is not presented in clang, and was never a thing in cygwin (fixes #38).

I have no idea why clang was configured to add -pthread on threadapi=win32, changing this is a breaking change but is the right thing to do. I run Boost.Thread tests and it passed cleanly on both threadapi=win32 and threadapi=pthread.
github-actions bot pushed a commit that referenced this issue Apr 24, 2023
-mthreads is obsolete and is not presented in clang, and was never a thing in cygwin (fixes #38).

I have no idea why clang was configured to add -pthread on threadapi=win32, changing this is a breaking change but is the right thing to do. I run Boost.Thread tests and it passed cleanly on both threadapi=win32 and threadapi=pthread.

(cherry picked from commit 308bdd5)
grafikrobot pushed a commit that referenced this issue Apr 24, 2023
-mthreads is obsolete and is not presented in clang, and was never a thing in cygwin (fixes #38).

I have no idea why clang was configured to add -pthread on threadapi=win32, changing this is a breaking change but is the right thing to do. I run Boost.Thread tests and it passed cleanly on both threadapi=win32 and threadapi=pthread.

(cherry picked from commit 308bdd5)

Co-authored-by: Nikita Kniazev <nok.raven@gmail.com>

[skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant