Switch to the separate RS loading path.
This change goes with a similar change to libbcc that separates compilation
from loading. We create our own symbol resolvers in the driver.
Change-Id: Ifdeed588d5935c49a1e19bdc46d0a8f0b9252e00
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index 70c9d8f..01a3e5a 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -418,8 +418,11 @@
return false;
}
- mCompilerDriver->setRSRuntimeLookupFunction(lookupRuntimeStub);
- mCompilerDriver->setRSRuntimeLookupContext(this);
+ // Configure symbol resolvers (via compiler-rt and the RS runtime).
+ mRSRuntime.setLookupFunction(lookupRuntimeStub);
+ mRSRuntime.setContext(this);
+ mResolver.chainResolver(mCompilerRuntime);
+ mResolver.chainResolver(mRSRuntime);
// Run any compiler setup functions we have been provided with.
RSSetupCompilerCallback setupCompilerCallback =
@@ -471,8 +474,8 @@
// Skip the cache lookup
} else if (!is_force_recompile()) {
// Attempt to just load the script from cache first if we can.
- exec = mCompilerDriver->loadScript(cacheDir, resName,
- (const char *)bitcode, bitcodeSize);
+ exec = bcc::RSCompilerDriver::loadScript(cacheDir, resName,
+ (const char *)bitcode, bitcodeSize, mResolver);
}
if (exec == NULL) {
@@ -480,9 +483,8 @@
bitcodeSize, core_lib, useRSDebugContext,
bccPluginName);
if (built) {
- exec = mCompilerDriver->loadScript(cacheDir, resName,
- (const char *)bitcode,
- bitcodeSize);
+ exec = bcc::RSCompilerDriver::loadScript(cacheDir, resName,
+ (const char *)bitcode, bitcodeSize, mResolver);
}
}