Index: llvm/cmake/modules/HandleLLVMOptions.cmake =================================================================== --- llvm/cmake/modules/HandleLLVMOptions.cmake +++ llvm/cmake/modules/HandleLLVMOptions.cmake @@ -1019,14 +1019,14 @@ set(LLVM_SOURCE_PREFIX "" CACHE STRING "Use prefix for sources in debug info") if(LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO) - check_c_compiler_flag("-fdebug-prefix-map=foo=bar" SUPPORTS_FDEBUG_PREFIX_MAP) + check_c_compiler_flag("-ffile-prefix-map=foo=bar" SUPPORTS_FFILE_PREFIX_MAP) if(LLVM_ENABLE_PROJECTS_USED) get_filename_component(source_root "${LLVM_MAIN_SRC_DIR}/.." ABSOLUTE) else() set(source_root "${LLVM_MAIN_SRC_DIR}") endif() file(RELATIVE_PATH relative_root "${source_root}" "${CMAKE_BINARY_DIR}") - append_if(SUPPORTS_FDEBUG_PREFIX_MAP "-fdebug-prefix-map=${CMAKE_BINARY_DIR}=${relative_root}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) - append_if(SUPPORTS_FDEBUG_PREFIX_MAP "-fdebug-prefix-map=${source_root}/=${LLVM_SOURCE_PREFIX}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append_if(SUPPORTS_FFILE_PREFIX_MAP "-ffile-prefix-map=${CMAKE_BINARY_DIR}=${relative_root}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) + append_if(SUPPORTS_FFILE_PREFIX_MAP "-ffile-prefix-map=${source_root}/=${LLVM_SOURCE_PREFIX}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) add_flag_if_supported("-no-canonical-prefixes" NO_CANONICAL_PREFIXES) endif()