1 From a0a66f8ce2520681709702871eb7ded77be6a1e8 Mon Sep 17 00:00:00 2001
2 From: Andy Fiddaman <omnios@citrus-it.co.uk>
3 Date: Mon, 11 Jan 2021 14:09:40 +0000
4 Subject: 13185 -zassert-deflib does not work for 64-bit objects
7 gcc/gcc.cc | 33 ++++++++++++++++++++++++++-------
8 1 file changed, 26 insertions(+), 7 deletions(-)
10 diff --git a/gcc/gcc.cc b/gcc/gcc.cc
11 index fbcc9d03314..ec524111a20 100644
14 @@ -7931,15 +7931,34 @@ is_directory (const char *path1, bool linker)
17 /* Exclude directories that the linker is known to search. */
19 - && IS_DIR_SEPARATOR (path[0])
21 - && filename_ncmp (path + 1, "lib", 3) == 0)
23 + if (linker && IS_DIR_SEPARATOR (path[0])) {
24 + size_t len = cp - path;
26 + if (len >= 6 && filename_ncmp (path + 1, "lib", 3) == 0) {
29 + if (multilib_os_dir != NULL
30 + && len == 6 + strlen(multilib_os_dir) + 1
31 + && filename_ncmp(path + 5, multilib_os_dir,
32 + strlen(multilib_os_dir)) == 0) {
38 && filename_ncmp (path + 1, "usr", 3) == 0
39 && IS_DIR_SEPARATOR (path[4])
40 - && filename_ncmp (path + 5, "lib", 3) == 0)))
42 + && filename_ncmp (path + 5, "lib", 3) == 0) {
45 + if (multilib_os_dir != NULL
46 + && len == 10 + strlen(multilib_os_dir) + 1
47 + && filename_ncmp(path + 9, multilib_os_dir,
48 + strlen(multilib_os_dir)) == 0) {
54 return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));