-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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_cuda_runtime_wrapper.h __THROW macro redefinition inconsistent with libc #47213
Comments
assigned to @Artem-B |
Could you attach complete clang command line and complete compiler output? Which CUDA version are you compiling with? Tensorflow is probably the heaviest user of clang as the CUDA compiler and the header in question didn't change for quite a while. I'm not aware of this issue being triggered in our internal and public TF builds. My guess is that it's probably a corner case specific to your build. Or some recent change in the standard library headers that break the workarounds in the wrapper headers. |
@Artem Belevich Did you at all read my explanation of the issue? Which part of it do you disagree with? It might be a while before I am back at this project and can give you all the details you have asked for. The relevant part of the compiler output is already in the previous message. I am using libc++. I think CUDA version was 6.1 if I remember correctly. The OS is CentOS 8. |
[user@host]$ /lib/libc.so.6 |
I think the issue is being triggered by So, on the surface, your suggestion to undefine __NTH* may work. Interestingly enough, recent CUDA versions no longer redefine __THROW. There's also a question of whether _FORTIFY_SOURCE is expected to work on the GPU side. My understanding that it requires some runtime support and there's no libraries for the GPU side. We may potentially need to disable _FORTIFY_SOURCE for GPU-side compilation, though it's probably a separate issue. Feel free to send the patch for review and we'll discuss the details there. |
I have encountered the same problem. Has a patch been published for review? |
https://reviews.llvm.org/D110781 should fix it. |
*** Bug #40735 has been marked as a duplicate of this bug. *** |
We should include the fix in clang-13.0.1. |
The fix is in commit 29e00b2 : https://reviews.llvm.org/rG29e00b29f76adb15a51c1ccd6c1fdb6fce5f4d7b |
Merged: 73daeb3 |
mentioned in issue #51489 |
Extended Description
Trying to build TensorFlow with LLVM trunk, I arrived at this error
Looking at those files I see that the macros are defined in
/usr/include/sys/cdefs.h
. This file defines __THROW, __NTH and __NTHNL with consistent exception specifier as they are used to declare and define the same functions. However__clang_cuda_runtime_wrapper.h
re-defines only the__THROW
macro:I think the other two macros should also be cleared to avoid breaking the exception specifier consistency in libc. If you agree please let me know and I will be glad to contribute the fix.
The text was updated successfully, but these errors were encountered: