diff options
author | Tom Rini <trini@embeddedalley.com> | 2009-01-16 23:10:09 -0500 |
---|---|---|
committer | Tom Rini <trini@embeddedalley.com> | 2009-01-16 23:15:52 -0500 |
commit | 2378bfca9bbb2cd7cf488a4e74c780ff6ea1f010 (patch) | |
tree | 25284cc310ccfb9d512ba9df30e33938cf48b5de /packages/gcc/files/pr22133-mingw-path-fixup.patch | |
parent | 23633fdd4b216a8117b203ec02d86a187f76616a (diff) |
gcc-canadian-sdk: Add a version of gcc 4.2.4 for building Canadian SDKs.
With this, add some patches specific to fixing up MinGW issues on 4.2.x
Diffstat (limited to 'packages/gcc/files/pr22133-mingw-path-fixup.patch')
-rw-r--r-- | packages/gcc/files/pr22133-mingw-path-fixup.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/gcc/files/pr22133-mingw-path-fixup.patch b/packages/gcc/files/pr22133-mingw-path-fixup.patch new file mode 100644 index 0000000000..429e9ffd0c --- /dev/null +++ b/packages/gcc/files/pr22133-mingw-path-fixup.patch @@ -0,0 +1,29 @@ +diff -rupN gcc-4.2.orig/gcc/c-incpath.c gcc-4.2/gcc/c-incpath.c +--- gcc-4.2.orig/gcc/c-incpath.c 2007-09-01 11:28:30.000000000 -0400 ++++ gcc-4.2/gcc/c-incpath.c 2008-08-17 16:56:01.000000000 -0400 +@@ -340,13 +340,18 @@ add_path (char *path, int chain, int cxx + cpp_dir *p; + + #if defined (HAVE_DOS_BASED_FILE_SYSTEM) +- /* Convert all backslashes to slashes. The native CRT stat() +- function does not recognize a directory that ends in a backslash +- (unless it is a drive root dir, such "c:\"). Forward slashes, +- trailing or otherwise, cause no problems for stat(). */ +- char* c; +- for (c = path; *c; c++) +- if (*c == '\\') *c = '/'; ++ /* Remove unnecessary trailing slashes. On some versions of MS ++ Windows, trailing _forward_ slashes cause no problems for stat(). ++ On newer versions, stat() does not recognise a directory that ends ++ in a '\\' or '/', unless it is a drive root dir, such as "c:/", ++ where it is obligatory. */ ++ int pathlen = strlen (path); ++ char* end = path + pathlen - 1; ++ /* Preserve the lead '/' or lead "c:/". */ ++ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1); ++ ++ for (; end > start && IS_DIR_SEPARATOR (*end); end--) ++ *end = 0; + #endif + + p = XNEW (cpp_dir); |