python/hypothesis: update to 6.122.3
[oi-userland.git] / components / developer / gcc-13 / patches / 0031-13185-zassert-deflib-does-not-work-for-64-bit-object.patch
blob8cf8f31c45a09254a880335885d69b84509b8d64
1 From 48bdc90872ba3e3f62311c7b8e70e3dc8b5152fb 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.cc | 33 ++++++++++++++++++++++++++-------
8 1 file changed, 26 insertions(+), 7 deletions(-)
10 diff --git a/gcc/gcc.cc b/gcc/gcc.cc
11 index 16bb07f2cdc5..b27c8d8627a1 100644
12 --- a/gcc/gcc.cc
13 +++ b/gcc/gcc.cc
14 @@ -7905,15 +7905,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));