Skip to content

Fix CMake build: add Clang -fbracket-depth, use GTest::gtest, drop un… - #600

Open
ehds wants to merge 1 commit into
google:masterfrom
ehds:fix-cmake-build
Open

Fix CMake build: add Clang -fbracket-depth, use GTest::gtest, drop un…#600
ehds wants to merge 1 commit into
google:masterfrom
ehds:fix-cmake-build

Conversation

@ehds

@ehds ehds commented Aug 31, 2026

Copy link
Copy Markdown
  1. Add COPTS $<$<CXX_COMPILER_ID:Clang>:-fbracket-depth=512> to range_tracker_fuzz_test
    Clang's default bracket-depth limit is exceeded by the deeply-nested template instantiation in range_tracker_fuzz.cc, causing a compile error; raising the limit fixes the Clang build:
/usr/lib/llvm20/bin/clang++ -DCENTIPEDE_DISABLE_RIEGELI -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -I/home/tcmalloc -I/home/tcmalloc/bld/_deps/fuzztest-src -I/home/tcmalloc/bld/_deps/re2-src -g -std=gnu++17 -fPIE -Wno-nullability-completeness -ftemplate-depth=1024 -MD -MT tcmalloc/internal/CMakeFiles/tcmalloc_internal_range_tracker_fuzz_test.dir/range_tracker_fuzz.cc.o -MF tcmalloc/internal/CMakeFiles/tcmalloc_internal_range_tracker_fuzz_test.dir/range_tracker_fuzz.cc.o.d -o tcmalloc/internal/CMakeFiles/tcmalloc_internal_range_tracker_fuzz_test.dir/range_tracker_fuzz.cc.o -c /home/tcmalloc/tcmalloc/internal/range_tracker_fuzz.cc
In file included from /home/tcmalloc/tcmalloc/internal/range_tracker_fuzz.cc:22:
In file included from /home/tcmalloc/bld/_deps/fuzztest-src/fuzztest/fuzztest.h:19:
In file included from /home/tcmalloc/bld/_deps/fuzztest-src/./fuzztest/domain.h:21:
In file included from /home/tcmalloc/bld/_deps/fuzztest-src/./fuzztest/domain_core.h:50:
/home/tcmalloc/bld/_deps/fuzztest-src/./fuzztest/internal/domains/aggregate_of_impl.h:47:62: fatal error: instantiating fold expression with 300 arguments exceeded expression nesting limit of 256
   47 |                            (Inner::has_custom_corpus_type || ...),
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/tcmalloc/bld/_deps/fuzztest-src/./fuzztest/internal/domains/aggregate_of_impl.h:54:11: note: in instantiation of template type alias 'AggregateOfImplCorpusType' requested here
   54 |           AggregateOfImplCorpusType<T, require_custom, Inner...>> {
  1. tcmalloc/testing/CMakeLists.txt — change rseq_util's dependency from @com_google_googletest//:gtest_for_library to GTest::gtest

  2. tcmalloc/testing/testutil.h — remove unused header filer #include "benchmark/benchmark.h"

@ehds
ehds requested a review from ckennelly as a code owner August 31, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant