-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix compilation on macOS with GCC. #1603
Conversation
c7476ac
to
a245e48
Compare
Updated copyright years. |
What is the status? Currently, I am blocked updating to 2022.0 on macOS. |
@saschasc, feel free to use |
Sorry. I realized there is more to this than disabling the warnings. We will review this pull request, |
#elif __GNUC__ | ||
#pragma GCC diagnostic push | ||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is __GNUC__ macro really predefined when using Apple Clang? Shouldn't we still have "elif __clang__"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, __GNUC__
is defined.
$ /usr/bin/clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: arm64-apple-darwin24.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
$ cat ./a.cpp
#ifdef __GNUC__
#error __GNUC__ is defined.
#endif
$ /usr/bin/clang ./a.cpp
./a.cpp:2:2: error: __GNUC__ is defined.
2 | #error __GNUC__ is defined.
| ^
1 error generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked the CI, it is using Apple Clang.
I am using the Conan version and right now switching back to the older one. Happy if this gets fixed for the next version. Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR fixes compilation on macOS with GCC (broken in 2022.0, worked fine in 2021.13). What's changed:
__TBB_WAITPKG_INTRINSICS_PRESENT
: it is now always defined totrue
on macOS and GCC (always fresh LLVM assembler, so the intrinsic is always present).-Wdeprecated-declarations
inco_context.h
: the warning was disabled with a Clang-specific pragma, replaced with Clang-compatible GCC version.With this changes it is possible to compile and run all tests:
Compilation with
BUILD_SHARED_LIBS=YES
still fails: the linker cannot find a vtable fordetail::r1::unsafe_wait
. This should be fixed separately.Fixes #1556
Type of change
Tests
Documentation
Breaks backward compatibility
Notify the following users
Other information