Skip to content

[scudo] Remove internal linkage from LargeBlock header helpers (NFC) - #207708

Merged
vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-scudo
Jul 6, 2026
Merged

vgvassilev merged 1 commit into
llvm:mainfrom
flash1729:wunused-template-scudo

Conversation

@flash1729

Copy link
Copy Markdown
Member

addHeaderTag and getHeader are static function templates in secondary.h, so any TU that includes the header without using them trips -Wunused-template. Dropping static fixes the warning.

Part of #202945.

addHeaderTag and getHeader are static function templates in secondary.h, so
any TU that includes the header without using them trips -Wunused-template.
The scudo unit tests hit this. Dropping static fixes the warning.

Part of llvm#202945.
@llvmorg-github-actions

Copy link
Copy Markdown

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Aditya Medhane (flash1729)

Changes

addHeaderTag and getHeader are static function templates in secondary.h, so any TU that includes the header without using them trips -Wunused-template. Dropping static fixes the warning.

Part of #202945.


Full diff: https://github.com/llvm/llvm-project/pull/207708.diff

1 Files Affected:

  • (modified) compiler-rt/lib/scudo/standalone/secondary.h (+3-3)
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 26c45cc4b7626..b4a5685080b03 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -56,17 +56,17 @@ static_assert(!archSupportsMemoryTagging() ||
 
 constexpr uptr getHeaderSize() { return sizeof(Header); }
 
-template <typename Config> static uptr addHeaderTag(uptr Ptr) {
+template <typename Config> uptr addHeaderTag(uptr Ptr) {
   if (allocatorSupportsMemoryTagging<Config>())
     return addFixedTag(Ptr, 1);
   return Ptr;
 }
 
-template <typename Config> static Header *getHeader(uptr Ptr) {
+template <typename Config> Header *getHeader(uptr Ptr) {
   return reinterpret_cast<Header *>(addHeaderTag<Config>(Ptr)) - 1;
 }
 
-template <typename Config> static Header *getHeader(const void *Ptr) {
+template <typename Config> Header *getHeader(const void *Ptr) {
   return getHeader<Config>(reinterpret_cast<uptr>(Ptr));
 }
 

@flash1729

Copy link
Copy Markdown
Member Author

Ping for review @cferris1000 @vgvassilev

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vgvassilev
vgvassilev merged commit dcf969e into llvm:main Jul 6, 2026
13 checks passed
@llvm-ci

llvm-ci commented Jul 6, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder amdgpu-offload-build-only running on AMD-bb-w-01 while building compiler-rt at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/226/builds/11844

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
CMake Error at /usr/local/therock-tools/share/cmake-3.27/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /usr/local/therock-tools/share/cmake-3.27/Modules/CMakeTestFortranCompiler.cmake:20 (CMAKE_DETERMINE_COMPILER_ABI)
  cmake/config-Fortran.cmake:148 (enable_language)
  CMakeLists.txt:297 (include)


-- Configuring incomplete, errors occurred!
[8656/8689] Creating library symlink lib/libFIRCodeGen.so
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-bins && /usr/local/therock-tools/bin/cmake -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt -DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../openmp -DLLVM_EXTERNAL_OFFLOAD_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../offload -DLLVM_EXTERNAL_FLANG_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../flang-rt --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang -DCMAKE_CXX_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang -DCMAKE_Fortran_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/flang -DCMAKE_LINKER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/ld.lld -DCMAKE_AR=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-ar -DCMAKE_RANLIB=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-ranlib -DCMAKE_NM=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-strip -DCMAKE_READELF=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_Fortran_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/tmp/llvm.install.test -DLLVM_BINARY_DIR=/home/botworker/bbot/amdgpu-offload-build-only/build -DLLVM_CONFIG_PATH=/home/botworker/bbot/amdgpu-offload-build-only/build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF "-DLLVM_LIT_ARGS=-v --show-unsupported --timeout 100 --show-xfail -j 16" -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=23.0.0git -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DLLVM_ENABLE_DOXYGEN=OFF -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_Fortran_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= -DLLVM_LIBDIR_SUFFIX= -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt -DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../openmp -DLLVM_EXTERNAL_OFFLOAD_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../offload -DLLVM_EXTERNAL_FLANG_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../flang-rt -DFORTRAN_SUPPORTS_REAL16=0 -DCOMPILER_RT_TEST_EXTERNAL_BUILTINS=ON "-DLLVM_ENABLE_RUNTIMES=compiler-rt;openmp;offload;flang-rt" -DFLANG_RUNTIME_F128_MATH_LIB= -DLIBOMPTEST_BUILD_UNITTESTS=ON -DLIBOMP_ENABLE_ARM64X=OFF "-DRUNTIMES_CMAKE_ARGS=-DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt;-DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../
d-only/llvm-project/llvm/runtimes/../../flang-rt" -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=openmp -GNinja -C/home/botworker/bbot/amdgpu-offload-build-only/build/projects/runtimes/tmp/runtimes-cache-Release.cmake -S /home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../runtimes -B /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-bins && /usr/local/therock-tools/bin/cmake -E touch /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-stamps/runtimes-configure
[8658/8689] Linking CXX shared library lib/libFlangOpenMPTransforms.so.23.0git
[8659/8689] Linking CXX shared library lib/libFIRTransforms.so.23.0git
[8660/8689] Linking CXX executable bin/fir-lsp-server
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 75, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@

1 similar comment
@llvm-ci

llvm-ci commented Jul 6, 2026

Copy link
Copy Markdown

LLVM Buildbot has detected a new failure on builder amdgpu-offload-build-only running on AMD-bb-w-01 while building compiler-rt at step 4 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/226/builds/11844

Here is the relevant piece of the build log for the reference
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
CMake Error at /usr/local/therock-tools/share/cmake-3.27/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  /usr/local/therock-tools/share/cmake-3.27/Modules/CMakeTestFortranCompiler.cmake:20 (CMAKE_DETERMINE_COMPILER_ABI)
  cmake/config-Fortran.cmake:148 (enable_language)
  CMakeLists.txt:297 (include)


-- Configuring incomplete, errors occurred!
[8656/8689] Creating library symlink lib/libFIRCodeGen.so
FAILED: runtimes/runtimes-stamps/runtimes-configure /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-stamps/runtimes-configure 
cd /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-bins && /usr/local/therock-tools/bin/cmake -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt -DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../openmp -DLLVM_EXTERNAL_OFFLOAD_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../offload -DLLVM_EXTERNAL_FLANG_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../flang-rt --no-warn-unused-cli -DCMAKE_C_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang -DCMAKE_CXX_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang++ -DCMAKE_ASM_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/clang -DCMAKE_Fortran_COMPILER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/flang -DCMAKE_LINKER=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/ld.lld -DCMAKE_AR=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-ar -DCMAKE_RANLIB=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-ranlib -DCMAKE_NM=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-nm -DCMAKE_OBJDUMP=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-objdump -DCMAKE_OBJCOPY=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-objcopy -DCMAKE_STRIP=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-strip -DCMAKE_READELF=/home/botworker/bbot/amdgpu-offload-build-only/build/./bin/llvm-readelf -DCMAKE_C_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_Fortran_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-unknown-linux-gnu -DCMAKE_INSTALL_PREFIX=/tmp/llvm.install.test -DLLVM_BINARY_DIR=/home/botworker/bbot/amdgpu-offload-build-only/build -DLLVM_CONFIG_PATH=/home/botworker/bbot/amdgpu-offload-build-only/build/bin/llvm-config -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=OFF "-DLLVM_LIT_ARGS=-v --show-unsupported --timeout 100 --show-xfail -j 16" -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=23.0.0git -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/local/bin/ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DLLVM_ENABLE_DOXYGEN=OFF -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_Fortran_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON -DCLANG_RESOURCE_DIR= -DLLVM_LIBDIR_SUFFIX= -DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt -DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../openmp -DLLVM_EXTERNAL_OFFLOAD_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../offload -DLLVM_EXTERNAL_FLANG_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../flang-rt -DFORTRAN_SUPPORTS_REAL16=0 -DCOMPILER_RT_TEST_EXTERNAL_BUILTINS=ON "-DLLVM_ENABLE_RUNTIMES=compiler-rt;openmp;offload;flang-rt" -DFLANG_RUNTIME_F128_MATH_LIB= -DLIBOMPTEST_BUILD_UNITTESTS=ON -DLIBOMP_ENABLE_ARM64X=OFF "-DRUNTIMES_CMAKE_ARGS=-DLLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../compiler-rt;-DLLVM_EXTERNAL_OPENMP_SOURCE_DIR=/home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../
d-only/llvm-project/llvm/runtimes/../../flang-rt" -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=openmp -GNinja -C/home/botworker/bbot/amdgpu-offload-build-only/build/projects/runtimes/tmp/runtimes-cache-Release.cmake -S /home/botworker/bbot/amdgpu-offload-build-only/llvm-project/llvm/runtimes/../../runtimes -B /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-bins && /usr/local/therock-tools/bin/cmake -E touch /home/botworker/bbot/amdgpu-offload-build-only/build/runtimes/runtimes-stamps/runtimes-configure
[8658/8689] Linking CXX shared library lib/libFlangOpenMPTransforms.so.23.0git
[8659/8689] Linking CXX shared library lib/libFIRTransforms.so.23.0git
[8660/8689] Linking CXX executable bin/fir-lsp-server
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 75, in run_command
    util.report_run_cmd(cmd, cwd=directory)
  File "/home/botworker/bbot/amdgpu-offload-build-only/llvm-zorg/zorg/buildbot/builders/annotated/util.py", line 49, in report_run_cmd
    subprocess.check_call(cmd, shell=shell, *args, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ninja']' returned non-zero exit status 1.
@@@STEP_FAILURE@@@

@flash1729
flash1729 deleted the wunused-template-scudo branch August 7, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants