ffmpeg-6: fix COMPONENT_REVISION
[oi-userland.git] / components / developer / gcc-7 / patches / 0028-13185-zassert-deflib-does-not-work-for-64-bit-object.patch
blob03d38d556e9ea204cb6850e081ece82868d3d69e
1 From 2cc1e414c8baf7d2e2b9492d3343b0e84508c186 Mon Sep 17 00:00:00 2001
2 From: Andy Fiddaman <omnios@citrus-it.co.uk>
3 Date: Mon, 11 Jan 2021 14:09:40 +0000
4 Subject: 13185 -zassert-deflib does not work for 64-bit objects
6 ---
7 gcc/gcc.c | 33 ++++++++++++++++++++++++++-------
8 1 file changed, 26 insertions(+), 7 deletions(-)
10 diff --git a/gcc/gcc.c b/gcc/gcc.c
11 index eced0d53aae..3b74f3c2970 100644
12 --- a/gcc/gcc.c
13 +++ b/gcc/gcc.c
14 @@ -7017,15 +7017,34 @@ is_directory (const char *path1, bool linker)
15 *cp = '\0';
17 /* Exclude directories that the linker is known to search. */
18 - if (linker
19 - && IS_DIR_SEPARATOR (path[0])
20 - && ((cp - path == 6
21 - && filename_ncmp (path + 1, "lib", 3) == 0)
22 - || (cp - path == 10
23 + if (linker && IS_DIR_SEPARATOR (path[0])) {
24 + size_t len = cp - path;
26 + if (len >= 6 && filename_ncmp (path + 1, "lib", 3) == 0) {
27 + if (len == 6)
28 + return 0;
29 + if (multilib_os_dir != NULL
30 + && len == 6 + strlen(multilib_os_dir) + 1
31 + && filename_ncmp(path + 5, multilib_os_dir,
32 + strlen(multilib_os_dir)) == 0) {
33 + return 0;
34 + }
35 + }
37 + if (len >= 10
38 && filename_ncmp (path + 1, "usr", 3) == 0
39 && IS_DIR_SEPARATOR (path[4])
40 - && filename_ncmp (path + 5, "lib", 3) == 0)))
41 - return 0;
42 + && filename_ncmp (path + 5, "lib", 3) == 0) {
43 + if (len == 10)
44 + return 0;
45 + if (multilib_os_dir != NULL
46 + && len == 10 + strlen(multilib_os_dir) + 1
47 + && filename_ncmp(path + 9, multilib_os_dir,
48 + strlen(multilib_os_dir)) == 0) {
49 + return 0;
50 + }
51 + }
52 + }
54 return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));