diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-12-25 19:22:10 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-12-26 17:41:20 -0800 |
commit | 22f1cc330d3501923d2dc27cd3fc424c69c3a73a (patch) | |
tree | 50e0ba30713afc37979787f6e1f06baaeced2bb6 | |
parent | d89e06ad94a46f6810d0a8787004b71b8ecaf87d (diff) | |
download | meta-clang-22f1cc330d3501923d2dc27cd3fc424c69c3a73a.tar.gz |
clang: Refresh off64_t musl patch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch | 101 |
1 files changed, 74 insertions, 27 deletions
diff --git a/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch b/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch index 77bad54..7730c6f 100644 --- a/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch +++ b/recipes-devtools/clang/clang/0035-cmake-Enable-64bit-off_t-on-32bit-glibc-systems.patch | |||
@@ -1,19 +1,19 @@ | |||
1 | From e5edc21a119c9bc0bea6e942adf8b172ec8a987a Mon Sep 17 00:00:00 2001 | 1 | From cd2fa12d715929642513fc441287c402f4560096 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | 2 | From: Khem Raj <raj.khem@gmail.com> |
3 | Date: Fri, 9 Dec 2022 16:17:12 -0800 | 3 | Date: Sun, 25 Dec 2022 15:13:41 -0800 |
4 | Subject: [PATCH] cmake: Enable 64bit off_t on 32bit glibc systems | 4 | Subject: [PATCH] build: Enable 64bit off_t on 32bit glibc systems |
5 | 5 | ||
6 | Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based | 6 | Pass -D_FILE_OFFSET_BITS=64 to compiler flags on 32bit glibc based |
7 | systems. This will make sure that 64bit versions of LFS functions are | 7 | systems. This will make sure that 64bit versions of LFS functions are |
8 | used e.g. seek will behave same as lseek64. Also revert [1] partially | 8 | used e.g. lseek will behave same as lseek64. Also revert [1] partially |
9 | because this added a cmake test to detect lseek64 but then forgot to | 9 | because this added a cmake test to detect lseek64 but then forgot to |
10 | pass the needed macro to actual compile, this test was incomplete too | 10 | pass the needed macro during actual compile, this test was incomplete too |
11 | since libc implementations like musl has 64bit off_t by default on 32bit | 11 | since libc implementations like musl has 64-bit off_t by default on 32-bit |
12 | systems and does not bundle[2] -D_LARGEFILE64_SOURCE under -D_GNU_SOURCE | 12 | systems and does not bundle -D_LARGEFILE64_SOURCE [2] under -D_GNU_SOURCE |
13 | like glibc, which means the compile now fails on musl because the cmake | 13 | like glibc, which means the compile now fails on musl because the cmake |
14 | check passes but we do not have _LARGEFILE64_SOURCE defined. Using the | 14 | check passes but we do not have _LARGEFILE64_SOURCE defined. Moreover, |
15 | *64 function was transitional anyways so use -D_FILE_OFFSET_BITS=64 | 15 | Using the *64 function was transitional anyways so use |
16 | instead | 16 | -D_FILE_OFFSET_BITS=64 instead |
17 | 17 | ||
18 | [1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b | 18 | [1] https://github.com/llvm/llvm-project/commit/8db7e5e4eed4c4e697dc3164f2c9351d8c3e942b |
19 | [2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc | 19 | [2] https://git.musl-libc.org/cgit/musl/commit/?id=25e6fee27f4a293728dd15b659170e7b9c7db9bc |
@@ -21,16 +21,18 @@ instead | |||
21 | Upstream-Status: Submitted [https://reviews.llvm.org/D139752] | 21 | Upstream-Status: Submitted [https://reviews.llvm.org/D139752] |
22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 22 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
23 | --- | 23 | --- |
24 | llvm/cmake/config-ix.cmake | 8 +++++--- | 24 | llvm/cmake/config-ix.cmake | 8 +++++--- |
25 | llvm/include/llvm/Config/config.h.cmake | 3 --- | 25 | llvm/include/llvm/Config/config.h.cmake | 3 --- |
26 | llvm/lib/Support/raw_ostream.cpp | 2 -- | 26 | llvm/lib/Support/raw_ostream.cpp | 2 -- |
27 | 3 files changed, 5 insertions(+), 8 deletions(-) | 27 | llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn | 2 -- |
28 | utils/bazel/llvm-project-overlay/llvm/config.bzl | 1 - | ||
29 | .../llvm/include/llvm/Config/config.h | 3 --- | ||
30 | utils/bazel/llvm_configs/config.h.cmake | 3 --- | ||
31 | 7 files changed, 5 insertions(+), 17 deletions(-) | ||
28 | 32 | ||
29 | diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake | ||
30 | index 7e657fd1532d..b03d433ea5b0 100644 | ||
31 | --- a/llvm/cmake/config-ix.cmake | 33 | --- a/llvm/cmake/config-ix.cmake |
32 | +++ b/llvm/cmake/config-ix.cmake | 34 | +++ b/llvm/cmake/config-ix.cmake |
33 | @@ -284,9 +284,6 @@ check_symbol_exists(futimes sys/time.h HAVE_FUTIMES) | 35 | @@ -284,9 +284,6 @@ check_symbol_exists(futimes sys/time.h H |
34 | if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE ) | 36 | if( HAVE_SIGNAL_H AND NOT LLVM_USE_SANITIZER MATCHES ".*Address.*" AND NOT APPLE ) |
35 | check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK) | 37 | check_symbol_exists(sigaltstack signal.h HAVE_SIGALTSTACK) |
36 | endif() | 38 | endif() |
@@ -40,20 +42,18 @@ index 7e657fd1532d..b03d433ea5b0 100644 | |||
40 | check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL) | 42 | check_symbol_exists(mallctl malloc_np.h HAVE_MALLCTL) |
41 | check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO) | 43 | check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO) |
42 | check_symbol_exists(mallinfo2 malloc.h HAVE_MALLINFO2) | 44 | check_symbol_exists(mallinfo2 malloc.h HAVE_MALLINFO2) |
43 | @@ -350,6 +347,11 @@ check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC) | 45 | @@ -350,6 +347,11 @@ check_symbol_exists(__GLIBC__ stdio.h LL |
44 | if( LLVM_USING_GLIBC ) | 46 | if( LLVM_USING_GLIBC ) |
45 | add_definitions( -D_GNU_SOURCE ) | 47 | add_definitions( -D_GNU_SOURCE ) |
46 | list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") | 48 | list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE") |
47 | +# enable 64bit off_t on 32bit systems using glibc | 49 | +# enable 64bit off_t on 32bit systems using glibc |
48 | + if (CMAKE_SIZEOF_VOID_P EQUAL 4) | 50 | + if (CMAKE_SIZEOF_VOID_P EQUAL 4) |
49 | + add_definitions( -D_FILE_OFFSET_BITS=64 ) | 51 | + add_compile_definitions(_FILE_OFFSET_BITS=64) |
50 | + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") | 52 | + list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_FILE_OFFSET_BITS=64") |
51 | + endif() | 53 | + endif() |
52 | endif() | 54 | endif() |
53 | # This check requires _GNU_SOURCE | 55 | # This check requires _GNU_SOURCE |
54 | if (NOT PURE_WINDOWS) | 56 | if (NOT PURE_WINDOWS) |
55 | diff --git a/llvm/include/llvm/Config/config.h.cmake b/llvm/include/llvm/Config/config.h.cmake | ||
56 | index 21ce3a94a5ed..d551ebad5c0c 100644 | ||
57 | --- a/llvm/include/llvm/Config/config.h.cmake | 57 | --- a/llvm/include/llvm/Config/config.h.cmake |
58 | +++ b/llvm/include/llvm/Config/config.h.cmake | 58 | +++ b/llvm/include/llvm/Config/config.h.cmake |
59 | @@ -128,9 +128,6 @@ | 59 | @@ -128,9 +128,6 @@ |
@@ -66,11 +66,9 @@ index 21ce3a94a5ed..d551ebad5c0c 100644 | |||
66 | /* Define to 1 if you have the <mach/mach.h> header file. */ | 66 | /* Define to 1 if you have the <mach/mach.h> header file. */ |
67 | #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H} | 67 | #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H} |
68 | 68 | ||
69 | diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp | ||
70 | index 651949ad5765..0bc71812cbd4 100644 | ||
71 | --- a/llvm/lib/Support/raw_ostream.cpp | 69 | --- a/llvm/lib/Support/raw_ostream.cpp |
72 | +++ b/llvm/lib/Support/raw_ostream.cpp | 70 | +++ b/llvm/lib/Support/raw_ostream.cpp |
73 | @@ -804,8 +804,6 @@ uint64_t raw_fd_ostream::seek(uint64_t off) { | 71 | @@ -804,8 +804,6 @@ uint64_t raw_fd_ostream::seek(uint64_t o |
74 | flush(); | 72 | flush(); |
75 | #ifdef _WIN32 | 73 | #ifdef _WIN32 |
76 | pos = ::_lseeki64(FD, off, SEEK_SET); | 74 | pos = ::_lseeki64(FD, off, SEEK_SET); |
@@ -79,6 +77,55 @@ index 651949ad5765..0bc71812cbd4 100644 | |||
79 | #else | 77 | #else |
80 | pos = ::lseek(FD, off, SEEK_SET); | 78 | pos = ::lseek(FD, off, SEEK_SET); |
81 | #endif | 79 | #endif |
82 | -- | 80 | --- a/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn |
83 | 2.38.1 | 81 | +++ b/llvm/utils/gn/secondary/llvm/include/llvm/Config/BUILD.gn |
84 | 82 | @@ -139,7 +139,6 @@ write_cmake_config("config") { | |
83 | values += [ | ||
84 | "HAVE_FUTIMENS=1", | ||
85 | "HAVE_LINK_H=1", | ||
86 | - "HAVE_LSEEK64=1", | ||
87 | "HAVE_MALLINFO=1", | ||
88 | "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", | ||
89 | ] | ||
90 | @@ -147,7 +146,6 @@ write_cmake_config("config") { | ||
91 | values += [ | ||
92 | "HAVE_FUTIMENS=", | ||
93 | "HAVE_LINK_H=", | ||
94 | - "HAVE_LSEEK64=", | ||
95 | "HAVE_MALLINFO=", | ||
96 | "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=", | ||
97 | ] | ||
98 | --- a/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
99 | +++ b/utils/bazel/llvm-project-overlay/llvm/config.bzl | ||
100 | @@ -40,7 +40,6 @@ posix_defines = [ | ||
101 | linux_defines = posix_defines + [ | ||
102 | "_GNU_SOURCE", | ||
103 | "HAVE_LINK_H=1", | ||
104 | - "HAVE_LSEEK64=1", | ||
105 | "HAVE_MALLINFO=1", | ||
106 | "HAVE_SBRK=1", | ||
107 | "HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1", | ||
108 | --- a/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h | ||
109 | +++ b/utils/bazel/llvm-project-overlay/llvm/include/llvm/Config/config.h | ||
110 | @@ -144,9 +144,6 @@ | ||
111 | /* Define to 1 if you have the <link.h> header file. */ | ||
112 | /* HAVE_LINK_H defined in Bazel */ | ||
113 | |||
114 | -/* Define to 1 if you have the `lseek64' function. */ | ||
115 | -/* HAVE_LSEEK64 defined in Bazel */ | ||
116 | - | ||
117 | /* Define to 1 if you have the <mach/mach.h> header file. */ | ||
118 | /* HAVE_MACH_MACH_H defined in Bazel */ | ||
119 | |||
120 | --- a/utils/bazel/llvm_configs/config.h.cmake | ||
121 | +++ b/utils/bazel/llvm_configs/config.h.cmake | ||
122 | @@ -128,9 +128,6 @@ | ||
123 | /* Define to 1 if you have the <link.h> header file. */ | ||
124 | #cmakedefine HAVE_LINK_H ${HAVE_LINK_H} | ||
125 | |||
126 | -/* Define to 1 if you have the `lseek64' function. */ | ||
127 | -#cmakedefine HAVE_LSEEK64 ${HAVE_LSEEK64} | ||
128 | - | ||
129 | /* Define to 1 if you have the <mach/mach.h> header file. */ | ||
130 | #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H} | ||
131 | |||