+ // Don't self-load the linker. This is because the build system is
+ // not clever enough to understand that all the libraries packaged
+ // in the final .apk don't need to be explicitly loaded.
+ if (Linker.isChromiumLinkerLibrary(library)) {
+ if (DEBUG) Log.i(TAG, "ignoring self-linker load");
+ continue;
+ }
+
+ // Determine where the library should be loaded from.
+ String zipFilePath = null;
+ String libFilePath = System.mapLibraryName(library);
+ if (apkFilePath != null && Linker.isInZipFile()) {
+ // The library is in the APK file.
+ if (!Linker.checkLibraryIsMappableInApk(apkFilePath, libFilePath)) {
+ sLibraryIsMappableInApk = false;
+ }
+ if (sLibraryIsMappableInApk || useMapExecSupportFallback) {
+ // Load directly from the APK (or use the no map executable
+ // support fallback, see crazy_linker_elf_loader.cpp).
+ zipFilePath = apkFilePath;
+ Log.i(TAG, "Loading " + library + " "
+ + (useMapExecSupportFallback
+ ? "using no map executable support fallback"
+ : "directly")
+ + " from within " + apkFilePath);
+ } else {
+ // Unpack library fallback.
+ Log.i(TAG, "Loading " + library
+ + " using unpack library fallback from within "
+ + apkFilePath);
+ libFilePath = LibraryLoaderHelper.buildFallbackLibrary(
+ context, library);
+ fallbackWasUsed = true;
+ Log.i(TAG, "Built fallback library " + libFilePath);
+ }