Skip to content

Commit

Permalink
13185 -zassert-deflib does not work for 64-bit objects
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed May 31, 2023
1 parent 6073fa1 commit a62b8c7
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions gcc/gcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7905,15 +7905,34 @@ is_directory (const char *path1, bool linker)
*cp = '\0';

/* Exclude directories that the linker is known to search. */
if (linker
&& IS_DIR_SEPARATOR (path[0])
&& ((cp - path == 6
&& filename_ncmp (path + 1, "lib", 3) == 0)
|| (cp - path == 10
if (linker && IS_DIR_SEPARATOR (path[0])) {
size_t len = cp - path;

if (len >= 6 && filename_ncmp (path + 1, "lib", 3) == 0) {
if (len == 6)
return 0;
if (multilib_os_dir != NULL
&& len == 6 + strlen(multilib_os_dir) + 1
&& filename_ncmp(path + 5, multilib_os_dir,
strlen(multilib_os_dir)) == 0) {
return 0;
}
}

if (len >= 10
&& filename_ncmp (path + 1, "usr", 3) == 0
&& IS_DIR_SEPARATOR (path[4])
&& filename_ncmp (path + 5, "lib", 3) == 0)))
return 0;
&& filename_ncmp (path + 5, "lib", 3) == 0) {
if (len == 10)
return 0;
if (multilib_os_dir != NULL
&& len == 10 + strlen(multilib_os_dir) + 1
&& filename_ncmp(path + 9, multilib_os_dir,
strlen(multilib_os_dir)) == 0) {
return 0;
}
}
}

return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
}
Expand Down

0 comments on commit a62b8c7

Please sign in to comment.