From d466a98e302565e67f9a7e351c2982a96bc9f5f3 Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 9 Apr 2021 20:09:32 +0000 Subject: [PATCH] Consider only dll files to be shared libraries. This avoids problems where we consider other executables and object files as libraries and the dyld decides to scan them. Upon this we hit files opened by other processes and locked by the system (such as bootstat.dat :)) Thanks to Bertrand Bellenot for the diagnosis! --- lib/Interpreter/DynamicLibraryManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Interpreter/DynamicLibraryManager.cpp b/lib/Interpreter/DynamicLibraryManager.cpp index 58d7beda..4ae1f107 100644 --- a/lib/Interpreter/DynamicLibraryManager.cpp +++ b/lib/Interpreter/DynamicLibraryManager.cpp @@ -276,8 +276,10 @@ namespace cling { (Magic == file_magic::elf_shared_object) #endif #elif defined(_WIN32) - (Magic == file_magic::pecoff_executable - || platform::IsDLL(libFullPath.str())) + // We should only include dll libraries without including executables, + // object code and others... + (Magic == file_magic::pecoff_executable && + platform::IsDLL(libFullPath.str())) #else # error "Unsupported platform." #endif