summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2010-11-02 22:03:58 +0100
committerKoen Kooi <koen@dominion.thruhere.net>2010-11-02 22:12:02 +0100
commitbe10a6b1321f250b1034c7d9d0a8ef18b296eef1 (patch)
tree9249025cbfbfbee4cc430d62b27f75301dd4dfde /recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch
parent93b28937ac67ba46d65f55637e42552e224aa7e2 (diff)
downloadmeta-openembedded-be10a6b1321f250b1034c7d9d0a8ef18b296eef1.tar.gz
angstrom-layers: meta-openembedded: replace poky gcc 4.5 sources with OE ones
This needs further investigation, but for now we can get the tested sources into the poky gcc harness Signed-off-by: Koen Kooi <k-kooi@ti.com>
Diffstat (limited to 'recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch')
-rw-r--r--recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch b/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch
new file mode 100644
index 0000000000..429e9ffd0c
--- /dev/null
+++ b/recipes-devtools/gcc/files/pr22133-mingw-path-fixup.patch
@@ -0,0 +1,29 @@
1diff -rupN gcc-4.2.orig/gcc/c-incpath.c gcc-4.2/gcc/c-incpath.c
2--- gcc-4.2.orig/gcc/c-incpath.c 2007-09-01 11:28:30.000000000 -0400
3+++ gcc-4.2/gcc/c-incpath.c 2008-08-17 16:56:01.000000000 -0400
4@@ -340,13 +340,18 @@ add_path (char *path, int chain, int cxx
5 cpp_dir *p;
6
7 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
8- /* Convert all backslashes to slashes. The native CRT stat()
9- function does not recognize a directory that ends in a backslash
10- (unless it is a drive root dir, such "c:\"). Forward slashes,
11- trailing or otherwise, cause no problems for stat(). */
12- char* c;
13- for (c = path; *c; c++)
14- if (*c == '\\') *c = '/';
15+ /* Remove unnecessary trailing slashes. On some versions of MS
16+ Windows, trailing _forward_ slashes cause no problems for stat().
17+ On newer versions, stat() does not recognise a directory that ends
18+ in a '\\' or '/', unless it is a drive root dir, such as "c:/",
19+ where it is obligatory. */
20+ int pathlen = strlen (path);
21+ char* end = path + pathlen - 1;
22+ /* Preserve the lead '/' or lead "c:/". */
23+ char* start = path + (pathlen > 2 && path[1] == ':' ? 3 : 1);
24+
25+ for (; end > start && IS_DIR_SEPARATOR (*end); end--)
26+ *end = 0;
27 #endif
28
29 p = XNEW (cpp_dir);