jpeach commented on PR #10326:
URL: https://github.com/apache/trafficserver/pull/10326#issuecomment-1704481010
I went down a bit of a rabbit hole on this one ....
IIUC this is a lllvm libc++ problem. `<math.h>` comes in via `<atomic>`
which comes in via `<DbgCtl.h>`
```
.. ../../../include/ts/DbgCtl.h
... /usr/local/opt/llvm/bin/../include/c++/v1/atomic
.... /usr/local/opt/llvm/bin/../include/c++/v1/cstring
.... /usr/local/opt/llvm/bin/../include/c++/v1/cmath
..... /usr/local/opt/llvm/bin/../include/c++/v1/math.h
```
Relevant libc++ header says:
```C
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <cmath>
# include <compare>
# include <type_traits>
#endif
```
So in theory, setting that define should help. However, if we do that, we
end up with a different path:
```
... /usr/local/opt/llvm/bin/../include/c++/v1/utility
.... /usr/local/opt/llvm/bin/../include/c++/v1/compare
.....
/usr/local/opt/llvm/bin/../include/c++/v1/__compare/compare_partial_order_fallback.h
...... /usr/local/opt/llvm/bin/../include/c++/v1/__compare/partial_order.h
.......
/usr/local/opt/llvm/bin/../include/c++/v1/__compare/compare_three_way.h
....... /usr/local/opt/llvm/bin/../include/c++/v1/__compare/weak_order.h
........ /usr/local/opt/llvm/bin/../include/c++/v1/__compare/strong_order.h
......... /usr/local/opt/llvm/bin/../include/c++/v1/cmath
.......... /usr/local/opt/llvm/bin/../include/c++/v1/math.h
```
And in `<cmath>` we find code like this, which unconditionally pulls
`<math.h>` into the global namespace:
```C
...
#include <math.h>
...
_LIBCPP_BEGIN_NAMESPACE_STD
...
_LIBCPP_END_NAMESPACE_STD
...
```
So yeh, c++ seems like it's a bug mess with regard to `<math.h>` symbols.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]