diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-11-19 17:35:47 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-11-19 17:35:47 +0300 |
commit | 03bebac19e6fef19299d7326d3ee41f8a7dd1316 (patch) | |
tree | bb413d22ada331790f08b7b9a592e5ab95cd8918 /debian/patches/gcc-search-prefixed-as-ld.diff | |
parent | 94a19f31b81e9e7e295414fe2ad2302e0db25a08 (diff) | |
parent | 8f6c4b0033c72f8ac14694c419a99458339dd6a9 (diff) | |
download | gcc-9-03bebac19e6fef19299d7326d3ee41f8a7dd1316.tar.gz |
Merge tag 'debian/9.2.1-19'
Diffstat (limited to 'debian/patches/gcc-search-prefixed-as-ld.diff')
-rw-r--r-- | debian/patches/gcc-search-prefixed-as-ld.diff | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/gcc-search-prefixed-as-ld.diff b/debian/patches/gcc-search-prefixed-as-ld.diff new file mode 100644 index 0000000..2b9cc5e --- /dev/null +++ b/debian/patches/gcc-search-prefixed-as-ld.diff @@ -0,0 +1,37 @@ +# DP: Search for the <triplet>-as / -ld before serching for as / ld. + +--- a/src/gcc/gcc.c ++++ b/src/gcc/gcc.c +@@ -2686,6 +2686,7 @@ for_each_path (const struct path_prefix + { + len = paths->max_len + extra_space + 1; + len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len); ++ len += multiarch_len + 2; /* triplet prefix for as, ld. */ + path = XNEWVEC (char, len); + } + +@@ -2899,6 +2900,24 @@ file_at_path (char *path, void *data) + struct file_at_path_info *info = (struct file_at_path_info *) data; + size_t len = strlen (path); + ++ /* search for the <triplet>-as / -ld first. */ ++ if (! strcmp (info->name, "as") || ! strcmp (info->name, "ld")) ++ { ++ struct file_at_path_info prefix_info = *info; ++ char *prefixed_name = XNEWVEC (char, info->name_len + 2 ++ + strlen (DEFAULT_REAL_TARGET_MACHINE)); ++ strcpy (prefixed_name, DEFAULT_REAL_TARGET_MACHINE); ++ strcat (prefixed_name, "-"); ++ strcat (prefixed_name, info->name); ++ prefix_info.name = (const char *) prefixed_name; ++ prefix_info.name_len = strlen (prefixed_name); ++ if (file_at_path (path, &prefix_info)) ++ { ++ XDELETEVEC (prefixed_name); ++ return path; ++ } ++ XDELETEVEC (prefixed_name); ++ } + memcpy (path + len, info->name, info->name_len); + len += info->name_len; + |