Skip to content

sanitizers=true fails to build #69556

Closed
@matthiaskrgr

Description

@matthiaskrgr

I'm using clang/llvm to build (instead of gcc).

git clone https://github.com/rust-lang/rust/ --depth=1
cd rust
cp config.toml.example > config.toml

make sure sanitizers are built:
config.toml:

# Build the sanitizer runtimes
sanitizers = true

use llvm ar and ranlib

ar = "llvm-ar"
ranlib = "llvm-ranlib"

./x.py build

fails to build:

make[3]: Leaving directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
make[3]: Entering directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
[ 54%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_openbsd.cc.o
[ 54%] Building CXX object lib/asan/CMakeFiles/RTAsan.x86_64.dir/asan_allocator.cc.o
[ 54%] Building CXX object lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc:1132:1: error: 'assertion_failed__1132' declared as an array with a negative size
CHECK_SIZE_AND_OFFSET(ipc_perm, mode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h:1437:3: note: expanded from macro 'CHECK_SIZE_AND_OFFSET'
  COMPILER_CHECK(sizeof(((__sanitizer_##CLASS *) NULL)->MEMBER) == \
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:336:30: note: expanded from macro 'COMPILER_CHECK'
#define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/matthias/vcs/github/rust__asan_test/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:342:57: note: expanded from macro 'IMPL_COMPILER_ASSERT'
    typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                        ^~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/build.make:336: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/sanitizer_platform_limits_posix.cc.o] Error 1
make[3]: Leaving directory '/home/matthias/vcs/github/rust__asan_test/build/x86_64-unknown-linux-gnu/native/sanitizers/build'
make[2]: *** [CMakeFiles/Makefile2:1028: lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.x86_64.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions