Skip to content

Commit

Permalink
loader: Downgrade wrong arch errors on windows
Browse files Browse the repository at this point in the history
On linux, when the loader fails to load a .so if it was due to being on the
wrong architecture, the loader downgraded the error to INFO level. This
commit does the same thing for windows. Error code 193 is winapi's way to
signify that the dll failed to load cause of the architecture.
  • Loading branch information
charles-lunarg committed Aug 26, 2021
1 parent 90fd66f commit 5661252
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,11 @@ void loader_log(const struct loader_instance *inst, VkFlags msg_type, int32_t ms
// log error from to library loading
void loader_log_load_library_error(const struct loader_instance *inst, const char *filename) {
const char *error_message = loader_platform_open_library_error(filename);
// If the error is due to incompatible ELF class, report it with INFO level
// Discussed in Github issue 262
// If the error is due to incompatible architecture (eg 32 bit vs 64 bit), report it with INFO level
// Discussed in Github issue 262 & 644
// "wrong ELF class" is a linux error, " with error 193" is a windows error
VkFlags err_flag = VULKAN_LOADER_ERROR_BIT;
if (strstr(error_message, "wrong ELF class:") != NULL) {
if (strstr(error_message, "wrong ELF class:") != NULL || strstr(error_message, " with error 193") != NULL) {
err_flag = VULKAN_LOADER_INFO_BIT;
}
loader_log(inst, err_flag, 0, error_message);
Expand Down

0 comments on commit 5661252

Please sign in to comment.