Skip to content

Conversation

@masaori335
Copy link
Contributor

More fix of the log symbol issue. #10319

@masaori335 masaori335 added Plugins Build work related to build configuration or environment labels Aug 31, 2023
@masaori335 masaori335 self-assigned this Aug 31, 2023
@jpeach
Copy link
Contributor

jpeach commented Sep 4, 2023

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:

  #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:

...
#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.

@masaori335 masaori335 merged commit a727dcc into apache:master Sep 4, 2023
@zwoop zwoop added this to the 10.0.0 milestone Feb 29, 2024
cmcfarlen pushed a commit to cmcfarlen/trafficserver that referenced this pull request Jun 3, 2024
* asf/master: (22 commits)
  fix: check whether a protocol is enabled during the length calculation in create_npn_advertisement (apache#10381)
  Coverity 1518612: Remove dead code (apache#10384)
  prefetch_cmcd: make autests more robust by removing need for gold file wildcard (apache#10382)
  Give a chance to send a response before receiving next request on H2 (apache#9997)
  CID 1516688: Fix uninitialized member of AcceptOptions (apache#10152)
  Fix slice head request memory issue (apache#10285)
  Fixes the TSMgmt metrics APIs for new API metrics (apache#10379)
  Minor parent.config a/an change (apache#10372)
  Allow DbgCtl tag to be set after instance construction. (apache#10375)
  Fix more build dep issues, for later PRs to work (apache#10376)
  money_trace cid 1518569: string not null terminated (apache#10373)
  Fix a couple of Coverity issues in health check plugin, around filenames (apache#10371)
  Fixes some build issues that happens with  other changes (apache#10374)
  Eliminate unreachable code covered by switch default (apache#10370)
  Add tests for disk failure (apache#10192)
  Disable copying/moving for DbgCtl. (apache#10321)
  Cmake autest (apache#10327)
  cmake: add unit tests from mgmt/rpc (apache#10366)
  Adjust CMakeLists with git worktree (apache#10298)
  Fix example plugins build (apache#10326)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build work related to build configuration or environment Plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants