[libcxx-commits] [libcxx] [libc++] Protect the libc++ implementation from CUDA SDK's `__noinline__` macro (PR #73838)

Artem Belevich via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 30 14:11:37 PST 2023


Artem-B wrote:

Hmm. Looks like undefining `__inline__` in a wrapper for `__config` is not going to work.
libc++ defines
```
#    define _LIBCPP_NOINLINE __attribute__((__noinline__))
```
The problem is that expansion of `__inline__` happens later, so when some other header uses `_LIBCPP_NOINLINE` while `__noinline__` is defined by CUDA, we still have a problem, even though the `_LIBCPP_NOINLINE`  is defined exactly as it was supposed to. With wrappers, we'd need to wrap every libc++ header which uses `_LIBCPP_NOINLINE`.

I think we do deed to deal with this in libc++. At the very least we should try figuring out how to define _LIBCPP_NOINLINE` in a way that's not affected by macro expansion later on.


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


More information about the libcxx-commits mailing list