initial import from Debian
version: 14.3.0-5 commit: bee30ab0fff2fd6af94c62376c8aa4221bb831e0
This commit is contained in:
37
debian/patches/gcc-search-prefixed-as-ld.diff
vendored
Normal file
37
debian/patches/gcc-search-prefixed-as-ld.diff
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
# DP: Search for the <triplet>-as / -ld before serching for as / ld.
|
||||
|
||||
--- a/src/gcc/gcc.cc
|
||||
+++ b/src/gcc/gcc.cc
|
||||
@@ -2937,6 +2937,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 += MAX (strlen(DEFAULT_REAL_TARGET_MACHINE), multiarch_len) + 2; /* triplet prefix for as, ld. */
|
||||
path = XNEWVEC (char, len);
|
||||
}
|
||||
|
||||
@@ -3150,6 +3151,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;
|
||||
|
Reference in New Issue
Block a user