diff options
author | clyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-17 11:21:51 +0000 |
---|---|---|
committer | clyon <clyon@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-17 11:21:51 +0000 |
commit | 53a225f6816eefd1d92827cabd91a65de999a84c (patch) | |
tree | be2156ba86dbc5ed25b5429decddd2c59da0aab2 | |
parent | 98114d59a3c4f75f717409b7ce707ed11d2d2e63 (diff) |
2014-01-16 Zhenqiang Chen <zhenqiang.chen@linaro.org>
Linaro local patch for armv4t multilib support.
* gcc/config/arm/t-mlibs: New file.
* config.gcc: Add t-mlibs.
* incpath.c (add_standard_paths): Try multilib path first.
* gcc.c (for_each_path): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/linaro/gcc-4_8-branch@206704 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.linaro | 8 | ||||
-rw-r--r-- | gcc/config.gcc | 2 | ||||
-rw-r--r-- | gcc/config/arm/t-mlibs | 21 | ||||
-rw-r--r-- | gcc/gcc.c | 27 | ||||
-rw-r--r-- | gcc/incpath.c | 45 |
5 files changed, 80 insertions, 23 deletions
diff --git a/gcc/ChangeLog.linaro b/gcc/ChangeLog.linaro index 85e69254f0b..3cb59050ef7 100644 --- a/gcc/ChangeLog.linaro +++ b/gcc/ChangeLog.linaro @@ -1,3 +1,11 @@ +2014-01-16 Zhenqiang Chen <zhenqiang.chen@linaro.org> + + Linaro local patch for armv4t multilib support. + * gcc/config/arm/t-mlibs: New file. + * config.gcc: Add t-mlibs. + * incpath.c (add_standard_paths): Try multilib path first. + * gcc.c (for_each_path): Likewise. + 2013-12-21 Christophe Lyon <christophe.lyon@linaro.org> * LINARO-VERSION: Bump version. diff --git a/gcc/config.gcc b/gcc/config.gcc index dd15c340474..064790c3a5a 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -878,7 +878,7 @@ arm*-*-linux-*) # ARM GNU/Linux with ELF tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ;; esac - tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi" + tmake_file="${tmake_file} arm/t-arm arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi arm/t-mlibs" tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h arm/aout.h vxworks-dummy.h arm/arm.h" # Define multilib configuration for arm-linux-androideabi. case ${target} in diff --git a/gcc/config/arm/t-mlibs b/gcc/config/arm/t-mlibs new file mode 100644 index 00000000000..c8f9962750b --- /dev/null +++ b/gcc/config/arm/t-mlibs @@ -0,0 +1,21 @@ +# A set of predefined MULTILIB for different ARM targets. +# Through the configure option --with-multilib-list, user can customize the +# final MULTILIB implementation. + +comma := , +space := +space += + +MULTILIB_OPTIONS = marm +MULTILIB_DIRNAMES = arm +MULTILIB_OPTIONS += march=armv4t +MULTILIB_DIRNAMES += armv4t +MULTILIB_OPTIONS += mfloat-abi=soft +MULTILIB_DIRNAMES += soft + +MULTILIB_EXCEPTIONS = + +MULTILIB_REQUIRED = marm/march=armv4t/mfloat-abi=soft + +MULTILIB_OSDIRNAMES = marm/march.armv4t/mfloat-abi.soft=!arm-linux-gnueabi + diff --git a/gcc/gcc.c b/gcc/gcc.c index fea73945a52..1d125f71b75 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -2227,7 +2227,7 @@ for_each_path (const struct path_prefix *paths, } /* Now try the multiarch path. */ - if (!skip_multi_dir + if (!skip_multi_dir && !multi_dir && !pl->require_machine_suffix && multiarch_dir) { memcpy (path + len, multiarch_suffix, multiarch_len + 1); @@ -2263,6 +2263,16 @@ for_each_path (const struct path_prefix *paths, if (ret) break; } + + /* Now try the multiarch path. */ + if (!skip_multi_dir + && !pl->require_machine_suffix && multiarch_dir) + { + memcpy (path + len, multiarch_suffix, multiarch_len + 1); + ret = callback (path, callback_info); + if (ret) + break; + } } if (pl) break; @@ -7662,6 +7672,21 @@ set_multilib_dir (void) ++p; } + if (first) + { + if (this_path_len > 3 + && this_path[0] == '.' + && this_path[1] == ':' + && this_path[2] == ':') + { + char *new_multiarch_dir = XNEWVEC (char, this_path_len + 1); + + strncpy (new_multiarch_dir, this_path, this_path_len); + new_multiarch_dir[this_path_len] = '\0'; + multiarch_dir = &new_multiarch_dir[3]; + } + } + if (ok && first) { if (this_path_len != 1 diff --git a/gcc/incpath.c b/gcc/incpath.c index 018da982c14..e5c3e9d6760 100644 --- a/gcc/incpath.c +++ b/gcc/incpath.c @@ -148,20 +148,22 @@ add_standard_paths (const char *sysroot, const char *iprefix, if (!filename_ncmp (p->fname, cpp_GCC_INCLUDE_DIR, len)) { char *str = concat (iprefix, p->fname + len, NULL); - if (p->multilib == 1 && imultilib) - str = reconcat (str, str, dir_separator_str, - imultilib, NULL); - else if (p->multilib == 2) + if (p->multilib && imultilib) + { + str = reconcat (str, str, dir_separator_str, + imultilib, NULL); + add_path (str, SYSTEM, p->cxx_aware, false); + } + else + add_path (str, SYSTEM, p->cxx_aware, false); + + if (p->multilib && imultiarch) { - if (!imultiarch) - { - free (str); - continue; - } + char *str = concat (iprefix, p->fname + len, NULL); str = reconcat (str, str, dir_separator_str, imultiarch, NULL); + add_path (str, SYSTEM, p->cxx_aware, false); } - add_path (str, SYSTEM, p->cxx_aware, false); } } } @@ -171,7 +173,7 @@ add_standard_paths (const char *sysroot, const char *iprefix, { if (!p->cplusplus || cxx_stdinc) { - char *str; + char *str, *str2; /* Should this directory start with the sysroot? */ if (sysroot && p->add_sysroot) @@ -215,19 +217,20 @@ add_standard_paths (const char *sysroot, const char *iprefix, else str = update_path (p->fname, p->component); - if (p->multilib == 1 && imultilib) - str = reconcat (str, str, dir_separator_str, imultilib, NULL); - else if (p->multilib == 2) + str2 = xstrdup(str); + if (p->multilib && imultilib) { - if (!imultiarch) - { - free (str); - continue; - } - str = reconcat (str, str, dir_separator_str, imultiarch, NULL); + str = reconcat (str, str, dir_separator_str, imultilib, NULL); + add_path (str, SYSTEM, p->cxx_aware, false); } + else + add_path (str, SYSTEM, p->cxx_aware, false); - add_path (str, SYSTEM, p->cxx_aware, false); + if (p->multilib && imultiarch) + { + str2 = reconcat (str2, str2, dir_separator_str, imultiarch, NULL); + add_path (str2, SYSTEM, p->cxx_aware, false); + } } } } |