Revert "Link libclcore.bc for RenderScript by default."
This reverts commit 0467d9a53b20f8c9069019cde9f035c127acbc9a.
diff --git a/Android.mk b/Android.mk
index 0d45176..c4d3520 100644
--- a/Android.mk
+++ b/Android.mk
@@ -34,7 +34,7 @@
#=====================================================================
-# Calculate SHA1 checksum for libbcc.so, libRS.so and libclcore.bc
+# Calculate SHA1 checksum for libbcc.so and libRS.so
#=====================================================================
include $(CLEAR_VARS)
@@ -45,8 +45,7 @@
libbcc_SHA1_SRCS := \
$(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libbcc.so \
- $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRS.so \
- $(call intermediates-dir-for,SHARED_LIBRARIES,libclcore.bc,,)/libclcore.bc
+ $(TARGET_OUT_INTERMEDIATE_LIBRARIES)/libRS.so
libbcc_GEN_SHA1_STAMP := $(LOCAL_PATH)/tools/build/gen-sha1-stamp.py
intermediates := $(call local-intermediates-dir)
diff --git a/include/bcc/RenderScript/RSInfo.h b/include/bcc/RenderScript/RSInfo.h
index 16054f5..37019c5 100644
--- a/include/bcc/RenderScript/RSInfo.h
+++ b/include/bcc/RenderScript/RSInfo.h
@@ -161,14 +161,12 @@
static const char LibBCCPath[];
static const char LibRSPath[];
- static const char LibCLCorePath[];
private:
// SHA-1 of the built-in dependencies. Will be initialized in
// LoadBuiltInSHA1Information().
static const uint8_t *LibBCCSHA1;
static const uint8_t *LibRSSHA1;
- static const uint8_t *LibCLCoreSHA1;
static bool CheckDependency(const RSInfo &pInfo,
const char *pInputFilename,
diff --git a/include/bcc/RenderScript/RSScript.h b/include/bcc/RenderScript/RSScript.h
index e69dcc8..2a96d35 100644
--- a/include/bcc/RenderScript/RSScript.h
+++ b/include/bcc/RenderScript/RSScript.h
@@ -73,8 +73,6 @@
virtual bool doReset();
public:
- static bool LinkRuntime(RSScript &pScript);
-
RSScript(Source &pSource);
// Add dependency information for this script given the source named
diff --git a/lib/Core/bcc.cpp b/lib/Core/bcc.cpp
index 451b144..5a7bfa5 100644
--- a/lib/Core/bcc.cpp
+++ b/lib/Core/bcc.cpp
@@ -27,7 +27,6 @@
#include "bcc/Config/BuildInfo.h"
#include "bcc/RenderScript/RSExecutable.h"
-#include "bcc/RenderScript/RSInfo.h"
#include "bcc/RenderScript/RSScript.h"
#include "bcc/Source.h"
#include "bcc/Support/Log.h"
@@ -259,13 +258,8 @@
extern "C" int bccLinkFile(BCCScriptRef script,
char const *path,
unsigned long flags) {
- RSScriptContext *rsctx = unwrap(script);
- if ((::strcmp(path, RSInfo::LibCLCorePath) == 0) &&
- (rsctx->script != NULL)) {
- return (RSScript::LinkRuntime(*rsctx->script) == false);
- } else {
- return BCC_DEPRECATED_API;
- }
+ return (helper_add_source(unwrap(script), path,
+ flags, /* pIsLink */true) == false);
}
diff --git a/lib/RenderScript/RSInfo.cpp b/lib/RenderScript/RSInfo.cpp
index 6f1b309..f3010cf 100644
--- a/lib/RenderScript/RSInfo.cpp
+++ b/lib/RenderScript/RSInfo.cpp
@@ -29,11 +29,8 @@
const char RSInfo::LibBCCPath[] = "/system/lib/libbcc.so";
const char RSInfo::LibRSPath[] = "/system/lib/libRS.so";
-const char RSInfo::LibCLCorePath[] = "/system/lib/libclcore.bc";
-
const uint8_t *RSInfo::LibBCCSHA1 = NULL;
const uint8_t *RSInfo::LibRSSHA1 = NULL;
-const uint8_t *RSInfo::LibCLCoreSHA1 = NULL;
void RSInfo::LoadBuiltInSHA1Information() {
if (LibBCCSHA1 != NULL) {
@@ -50,8 +47,6 @@
LibBCCSHA1 = reinterpret_cast<const uint8_t *>(::dlsym(h, "libbcc_so_SHA1"));
LibRSSHA1 = reinterpret_cast<const uint8_t *>(::dlsym(h, "libRS_so_SHA1"));
- LibCLCoreSHA1 =
- reinterpret_cast<const uint8_t *>(::dlsym(h, "libclcore_bc_SHA1"));
return;
}
@@ -74,8 +69,8 @@
bool RSInfo::CheckDependency(const RSInfo &pInfo,
const char *pInputFilename,
const RSScript::SourceDependencyListTy &pDeps) {
- // Built-in dependencies are libbcc.so, libRS.so and libclcore.bc.
- static const unsigned NumBuiltInDependencies = 3;
+ // Built-in dependencies are libbcc.so and libRS.so.
+ static const unsigned NumBuiltInDependencies = 2;
LoadBuiltInSHA1Information();
@@ -90,8 +85,6 @@
pInfo.mDependencyTable[0];
const std::pair<const char *, const uint8_t *> &cache_libRS_dep =
pInfo.mDependencyTable[1];
- const std::pair<const char *, const uint8_t *> &cache_libclcore_dep =
- pInfo.mDependencyTable[2];
// Check libbcc.so.
if (::memcmp(cache_libbcc_dep.second, LibBCCSHA1, SHA1_DIGEST_LENGTH) != 0) {
@@ -113,17 +106,6 @@
return false;
}
- // Check libclcore.bc.
- if (::memcmp(cache_libclcore_dep.second, LibCLCoreSHA1,
- SHA1_DIGEST_LENGTH) != 0) {
- ALOGD("Cache %s is dirty due to %s has been updated.", pInputFilename,
- LibRSPath);
- PRINT_DEPENDENCY("current - ", LibCLCorePath, LibCLCoreSHA1);
- PRINT_DEPENDENCY("cache - ", cache_libclcore_dep.first,
- cache_libclcore_dep.second);
- return false;
- }
-
for (unsigned i = 0; i < pDeps.size(); i++) {
const RSScript::SourceDependency &in_dep = *(pDeps[i]);
const std::pair<const char *, const uint8_t *> &cache_dep =
diff --git a/lib/RenderScript/RSInfoExtractor.cpp b/lib/RenderScript/RSInfoExtractor.cpp
index ae1085a..2e58fb7 100644
--- a/lib/RenderScript/RSInfoExtractor.cpp
+++ b/lib/RenderScript/RSInfoExtractor.cpp
@@ -167,7 +167,6 @@
// pool.
string_pool_size += ::strlen(LibBCCPath) + 1 + SHA1_DIGEST_LENGTH;
string_pool_size += ::strlen(LibRSPath) + 1 + SHA1_DIGEST_LENGTH;
- string_pool_size += ::strlen(LibCLCorePath) + 1 + SHA1_DIGEST_LENGTH;
for (unsigned i = 0, e = pDeps.size(); i != e; i++) {
const RSScript::SourceDependency *source_dep = pDeps[i];
if (source_dep != NULL) {
@@ -372,12 +371,6 @@
goto bail;
}
- if (!writeDependency(LibCLCorePath, LibCLCoreSHA1,
- result->mStringPool, &cur_string_pool_offset,
- result->mDependencyTable)) {
- goto bail;
- }
-
//===--------------------------------------------------------------------===//
// Record dependency information.
//===--------------------------------------------------------------------===//
diff --git a/lib/RenderScript/RSScript.cpp b/lib/RenderScript/RSScript.cpp
index 0efc43b..ef39897 100644
--- a/lib/RenderScript/RSScript.cpp
+++ b/lib/RenderScript/RSScript.cpp
@@ -20,8 +20,6 @@
#include <llvm/ADT/STLExtras.h>
-#include "bcc/RenderScript/RSInfo.h"
-#include "bcc/Source.h"
#include "bcc/Support/Log.h"
using namespace bcc;
@@ -33,27 +31,6 @@
return;
}
-bool RSScript::LinkRuntime(RSScript &pScript) {
- // Using the same context with the source in pScript.
- BCCContext &context = pScript.getSource().getContext();
- Source *libclcore_source = Source::CreateFromFile(context,
- RSInfo::LibCLCorePath);
- if (libclcore_source == NULL) {
- ALOGE("Failed to load Renderscript library '%s' to link!",
- RSInfo::LibCLCorePath);
- return false;
- }
-
- if (!pScript.getSource().merge(*libclcore_source,
- /* pPreserveSource */false)) {
- ALOGE("Failed to link RenderScript library '%s'!", RSInfo::LibCLCorePath);
- delete libclcore_source;
- return false;
- }
-
- return true;
-}
-
RSScript::RSScript(Source &pSource)
: Script(pSource), mInfo(NULL), mCompilerVersion(0),
mOptimizationLevel(kOptLvl3) { }