@@ -430,20 +430,24 @@ class AOTIBackend final : public ::executorch::runtime::BackendInterface {
430430 // We could load the .so content directly. But I don't want to deal with
431431 // relocation. So dumping a file and using dlopen
432432
433- // Create a temporary file
434- std::ofstream outfile (" /tmp/test.so" , std::ios::binary);
433+ // // Create a temporary file
434+ // std::ofstream outfile("/tmp/test.so", std::ios::binary);
435435
436- // Write the ELF buffer to the temporary file
437- outfile.write ((char *)processed->data (), sizeof (void *) * processed->size ());
436+ // // Write the ELF buffer to the temporary file
437+ // outfile.write((char*)processed->data(), sizeof(void*) * processed->size());
438438
439- // Finish writing the file to disk
440- outfile.close ();
439+ // // Finish writing the file to disk
440+ // outfile.close();
441441
442- // Free the in-memory buffer
443- processed->Free ();
442+ // // Free the in-memory buffer
443+ // processed->Free();
444+
445+ const char * so_path = static_cast <const char *>(processed->data ());
446+
447+ printf (" so path: %s\n " , so_path);
444448
445449 // Load the ELF using dlopen
446- void * so_handle = dlopen (" /tmp/test.so " , RTLD_LAZY | RTLD_LOCAL);
450+ void * so_handle = dlopen (so_path , RTLD_LAZY | RTLD_LOCAL);
447451 if (so_handle == nullptr ) {
448452 std::cout << dlerror () << std::endl;
449453 return Error::AccessFailed;
0 commit comments