From eb14fa51959ab02dbcff9cadf0a2f741dd2472a0 Mon Sep 17 00:00:00 2001 From: Finagolfin Date: Thu, 8 Jun 2023 12:43:26 +0530 Subject: [PATCH] Android: look in lib/linux/ for the LLVM sanitizers instead --- Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift b/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift index 8cde8e9cd..c35d5a78d 100644 --- a/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift +++ b/Sources/SwiftDriver/Jobs/Toolchain+LinkerSupport.swift @@ -26,9 +26,14 @@ extension Toolchain { for targetInfo: FrontendTargetInfo, parsedOptions: inout ParsedOptions ) throws -> VirtualPath { + var platform = targetInfo.target.triple.platformName(conflatingDarwin: true)! + // compiler-rt moved these Android sanitizers into `lib/linux/` a couple + // years ago, llvm/llvm-project@a68ccba, so look for them there instead. + if platform == "android" { + platform = "linux" + } return VirtualPath.lookup(targetInfo.runtimeResourcePath.path) - .appending(components: "clang", "lib", - targetInfo.target.triple.platformName(conflatingDarwin: true)!) + .appending(components: "clang", "lib", platform) } func runtimeLibraryPaths(