diff options
-rw-r--r-- | tools/pnacl-llc/nacl_file.cpp | 33 | ||||
-rw-r--r-- | tools/pnacl-llc/pnacl-llc.cpp | 22 |
2 files changed, 5 insertions, 50 deletions
diff --git a/tools/pnacl-llc/nacl_file.cpp b/tools/pnacl-llc/nacl_file.cpp index 5e5e293599..e8c5a3e736 100644 --- a/tools/pnacl-llc/nacl_file.cpp +++ b/tools/pnacl-llc/nacl_file.cpp @@ -48,15 +48,6 @@ namespace { typedef std::vector<std::string> string_vector; -// True if the bitcode to be compiled is for a shared library. -// Used to return to the coordinator. -bool g_bitcode_is_shared_library; -// The soname of the current compilation unit, if it is a shared library. -// Empty string otherwise. -std::string* g_bitcode_soname = NULL; -// The newline separated list of libraries that the current bitcode compilation -// unit depends on. -std::string* g_bitcode_lib_dependencies = NULL; // The filename used internally for looking up the bitcode file. char kBitcodeFilename[] = "pnacl.pexe"; // The filename used internally for looking up the object code file. @@ -77,22 +68,6 @@ int GetObjectFileFD() { return object_file_fd; } -void NaClRecordObjectInformation(bool is_shared, const std::string& soname) { - // This function is invoked to begin recording library information. - // To make it reentrant, we clean up what might be left over from last time. - delete g_bitcode_soname; - delete g_bitcode_lib_dependencies; - // Then remember the module global information. - g_bitcode_is_shared_library = is_shared; - g_bitcode_soname = new std::string(soname); - g_bitcode_lib_dependencies = new std::string(); -} - -void NaClRecordSharedLibraryDependency(const std::string& library_name) { - const std::string& kDelimiterString("\n"); - *g_bitcode_lib_dependencies += (library_name + kDelimiterString); -} - namespace { int DoTranslate(string_vector* cmd_line_vec, int object_fd) { @@ -382,11 +357,13 @@ void stream_end(NaClSrpcRpc *rpc, out_args[3]->arrays.str = strdup(StrError.c_str()); return; } - out_args[0]->u.ival = g_bitcode_is_shared_library; + // TODO(eliben): We don't really use shared libraries now. At some + // point this should be cleaned up from SRPC as well. + out_args[0]->u.ival = false; // SRPC deletes the strings returned when the closure is invoked. // Therefore we need to use strdup. - out_args[1]->arrays.str = strdup(g_bitcode_soname->c_str()); - out_args[2]->arrays.str = strdup(g_bitcode_lib_dependencies->c_str()); + out_args[1]->arrays.str = strdup(""); + out_args[2]->arrays.str = strdup(""); rpc->result = NACL_SRPC_RESULT_OK; } diff --git a/tools/pnacl-llc/pnacl-llc.cpp b/tools/pnacl-llc/pnacl-llc.cpp index a3e87e26c8..e318e88f08 100644 --- a/tools/pnacl-llc/pnacl-llc.cpp +++ b/tools/pnacl-llc/pnacl-llc.cpp @@ -52,9 +52,6 @@ using namespace llvm; // are allowed. #if defined(__native_client__) int GetObjectFileFD(); -// The following two functions communicate metadata to the SRPC wrapper for LLC. -void NaClRecordObjectInformation(bool is_shared, const std::string& soname); -void NaClRecordSharedLibraryDependency(const std::string& library_name); DataStreamer* NaClBitcodeStreamer; #endif // @LOCALMOD-END @@ -359,25 +356,6 @@ static int compileModule(char **argv, LLVMContext &Context) { OwningPtr<ModulePass> AddPNaClExternalDeclsPass( createAddPNaClExternalDeclsPass()); AddPNaClExternalDeclsPass->runOnModule(*mod); - -#if defined(__native_client__) - // Record that this isn't a shared library. - // TODO(eliben): clean this up more once the pnacl-llc switch-over is - // working. - NaClRecordObjectInformation(false, mod->getSOName()); - - // To determine if we should compile PIC or not, we needed to load at - // least the metadata. Since we've already constructed the commandline, - // we have to hack this in after commandline processing. - if (mod->getOutputFormat() == Module::SharedOutputFormat) { - RelocModel = Reloc::PIC_; - } - // Also set PIC_ for dynamic executables: - // BUG= http://code.google.com/p/nativeclient/issues/detail?id=2351 - if (mod->lib_size() > 0) { - RelocModel = Reloc::PIC_; - } -#endif // defined(__native_client__) // @LOCALMOD-END // If we are supposed to override the target triple, do so now. |