diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b926fe794..e6be322ddb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,7 +134,7 @@ option(USE_MINIUPNPC "Build with miniUPnPc support" ON) option(USE_SYSTEM_SNAPPY "Dynamically link against system snappy" ${USE_SYSTEM_SNAPPY}) option(USE_SYSTEM_FFMPEG "Dynamically link against system FFMPEG" ${USE_SYSTEM_FFMPEG}) option(USE_SYSTEM_LIBZIP "Dynamically link against system libzip" ${USE_SYSTEM_LIBZIP}) -option(USE_ADDRESS_SANITIZER "Use address sanitizer" OFF) +option(USE_ASAN "Use address sanitizer" OFF) option(USE_UBSAN "Use undefined behaviour sanitizer" OFF) if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN) @@ -273,11 +273,11 @@ if(NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-uninitialized") endif() - if(USE_ADDRESS_SANITIZER) + if(USE_ASAN) message("Address sanitizer enabled (DEBUG only)") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address") set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address") - add_definitions(-DUSE_ADDRESS_SANITIZER) + add_definitions(-DUSE_ASAN) endif() if(USE_UBSAN) message("Undefined behaviour sanitizer enabled (DEBUG only)") diff --git a/Common/MemArenaPosix.cpp b/Common/MemArenaPosix.cpp index 9a6166b379..7df84ab35c 100644 --- a/Common/MemArenaPosix.cpp +++ b/Common/MemArenaPosix.cpp @@ -107,7 +107,7 @@ void MemArena::ReleaseView(void* view, size_t size) { u8* MemArena::Find4GBBase() { // Now, create views in high memory where there's plenty of space. -#if PPSSPP_ARCH(64BIT) && !defined(USE_ADDRESS_SANITIZER) +#if PPSSPP_ARCH(64BIT) && !defined(USE_ASAN) // We should probably just go look in /proc/self/maps for some free space. // But let's try the anonymous mmap trick, just like on 32-bit, but bigger and // aligned to 4GB for the movk trick. We can ensure that we get an aligned 4GB diff --git a/Core/MemMap.h b/Core/MemMap.h index 1bd6027c22..b82e619625 100644 --- a/Core/MemMap.h +++ b/Core/MemMap.h @@ -84,7 +84,7 @@ extern u32 g_PSPModel; // UWP has such limited memory management that we need to mask // even in 64-bit mode. Also, when using the sanitizer, we need to mask as well. -#if PPSSPP_ARCH(32BIT) || PPSSPP_PLATFORM(UWP) || USE_ADDRESS_SANITIZER || PPSSPP_PLATFORM(IOS) +#if PPSSPP_ARCH(32BIT) || PPSSPP_PLATFORM(UWP) || USE_ASAN || PPSSPP_PLATFORM(IOS) #define MASKED_PSP_MEMORY #endif diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 71431f227e..6c2f1ac95a 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -585,8 +585,8 @@ void SystemInfoScreen::CreateViews() { #else buildConfig->Add(new InfoItem("NDEBUG", "")); #endif -#ifdef USE_ADDRESS_SANITIZER - buildConfig->Add(new InfoItem("USE_ADDRESS_SANITIZER", "")); +#ifdef USE_ASAN + buildConfig->Add(new InfoItem("USE_ASAN", "")); #endif #ifdef USING_GLES2 buildConfig->Add(new InfoItem("USING_GLES2", "")); diff --git a/b.sh b/b.sh index 55ab6e642d..83aad6ba02 100755 --- a/b.sh +++ b/b.sh @@ -61,7 +61,7 @@ do export CXX=/usr/bin/clang++ ;; --sanitize) echo "Enabling address-sanitizer if available" - CMAKE_ARGS="-DUSE_ADDRESS_SANITIZER=ON ${CMAKE_ARGS}" + CMAKE_ARGS="-DUSE_ASAN=ON ${CMAKE_ARGS}" ;; *) MAKE_OPT="$1 ${MAKE_OPT}" ;;