Skip to content

Commit 9e11b24

Browse files
[libc] Fix bazel and ssize_t for unistd
This patch fixes the bazel build after llvm#119312 lands. Also fixes where ssize_t is requested from in overlay mode.
1 parent 1dac0cd commit 9e11b24

File tree

2 files changed

+66
-3
lines changed

2 files changed

+66
-3
lines changed

libc/hdr/types/ssize_t.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
#else
1616

17-
#define __need_ssize_t
18-
#include <stddef.h>
19-
#undef __need_ssize_t
17+
#include <sys/types.h>
2018

2119
#endif // LIBC_FULL_BUILD
2220

utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ libc_support_library(
180180
],
181181
)
182182

183+
libc_support_library(
184+
name = "hdr_unistd_macros",
185+
hdrs = ["hdr/unistd_macros.h"],
186+
deps = [
187+
":hdr_unistd_overlay",
188+
],
189+
)
190+
183191
libc_support_library(
184192
name = "hdr_limits_macros",
185193
hdrs = ["hdr/limits_macros.h"],
@@ -195,6 +203,11 @@ libc_support_library(
195203
hdrs = ["hdr/stdlib_overlay.h"],
196204
)
197205

206+
libc_support_library(
207+
name = "hdr_unistd_overlay",
208+
hdrs = ["hdr/unistd_overlay.h"],
209+
)
210+
198211
############################ Type Proxy Header Files ###########################
199212

200213
libc_support_library(
@@ -300,6 +313,11 @@ libc_support_library(
300313
hdrs = ["hdr/types/pid_t.h"],
301314
)
302315

316+
libc_support_library(
317+
name = "types_uid_t",
318+
hdrs = ["hdr/types/uid_t.h"],
319+
)
320+
303321
libc_support_library(
304322
name = "types_off_t",
305323
hdrs = ["hdr/types/off_t.h"],
@@ -3996,6 +4014,7 @@ libc_function(
39964014
":__support_common",
39974015
":__support_osutil_syscall",
39984016
":errno",
4017+
":hdr_unistd_macros",
39994018
],
40004019
)
40014020

@@ -4008,6 +4027,7 @@ libc_function(
40084027
":__support_osutil_syscall",
40094028
":errno",
40104029
":hdr_fcntl_macros",
4030+
":hdr_unistd_macros",
40114031
],
40124032
)
40134033

@@ -4023,6 +4043,7 @@ libc_function(
40234043
":__support_common",
40244044
":__support_osutil_syscall",
40254045
":errno",
4046+
":hdr_unistd_macros",
40264047
],
40274048
)
40284049

@@ -4067,6 +4088,8 @@ libc_function(
40674088
":__support_common",
40684089
":__support_osutil_syscall",
40694090
":errno",
4091+
":hdr_unistd_macros",
4092+
":types_off_t",
40704093
],
40714094
)
40724095

@@ -4078,6 +4101,8 @@ libc_function(
40784101
# ":__support_common",
40794102
# ":__support_osutil_syscall",
40804103
# ":errno",
4104+
# ":hdr_unistd_macros",
4105+
# ":types_size_t",
40814106
# ],
40824107
# )
40834108

@@ -4089,6 +4114,9 @@ libc_function(
40894114
":__support_common",
40904115
":__support_osutil_syscall",
40914116
":errno",
4117+
":hdr_unistd_macros",
4118+
":types_size_t",
4119+
":types_uid_t",
40924120
],
40934121
)
40944122

@@ -4100,6 +4128,8 @@ libc_function(
41004128
":__support_common",
41014129
":__support_osutil_syscall",
41024130
":errno",
4131+
":hdr_unistd_macros",
4132+
":types_pid_t",
41034133
],
41044134
)
41054135

@@ -4111,6 +4141,8 @@ libc_function(
41114141
":__support_common",
41124142
":__support_osutil_syscall",
41134143
":errno",
4144+
":hdr_unistd_macros",
4145+
":types_uid_t",
41144146
],
41154147
)
41164148

@@ -4125,6 +4157,7 @@ libc_function(
41254157
# ":__support_file_file",
41264158
# ":__support_osutil_syscall",
41274159
# ":errno",
4160+
# ":hdr_unistd_macros",
41284161
# ],
41294162
# )
41304163

@@ -4136,6 +4169,7 @@ libc_function(
41364169
":__support_common",
41374170
":__support_osutil_syscall",
41384171
":errno",
4172+
":hdr_unistd_macros",
41394173
],
41404174
)
41414175

@@ -4148,6 +4182,7 @@ libc_function(
41484182
":__support_osutil_syscall",
41494183
":errno",
41504184
":hdr_fcntl_macros",
4185+
":hdr_unistd_macros",
41514186
],
41524187
)
41534188

@@ -4160,6 +4195,7 @@ libc_function(
41604195
":__support_osutil_syscall",
41614196
":errno",
41624197
":hdr_fcntl_macros",
4198+
":hdr_unistd_macros",
41634199
],
41644200
)
41654201

@@ -4184,6 +4220,8 @@ libc_function(
41844220
":__support_file_linux_lseekimpl",
41854221
":__support_osutil_syscall",
41864222
":errno",
4223+
":hdr_unistd_macros",
4224+
":types_off_t",
41874225
],
41884226
)
41894227

@@ -4200,6 +4238,10 @@ libc_function(
42004238
":__support_macros_sanitizer",
42014239
":__support_osutil_syscall",
42024240
":errno",
4241+
":hdr_unistd_macros",
4242+
":types_off_t",
4243+
":types_size_t",
4244+
":types_ssize_t",
42034245
],
42044246
)
42054247

@@ -4215,6 +4257,10 @@ libc_function(
42154257
":__support_common",
42164258
":__support_osutil_syscall",
42174259
":errno",
4260+
":hdr_unistd_macros",
4261+
":types_off_t",
4262+
":types_size_t",
4263+
":types_ssize_t",
42184264
],
42194265
)
42204266

@@ -4228,6 +4274,9 @@ libc_function(
42284274
":__support_macros_sanitizer",
42294275
":__support_osutil_syscall",
42304276
":errno",
4277+
":hdr_unistd_macros",
4278+
":types_size_t",
4279+
":types_ssize_t",
42314280
],
42324281
)
42334282

@@ -4240,6 +4289,9 @@ libc_function(
42404289
":__support_osutil_syscall",
42414290
":errno",
42424291
":hdr_fcntl_macros",
4292+
":hdr_unistd_macros",
4293+
":types_size_t",
4294+
":types_ssize_t",
42434295
],
42444296
)
42454297

@@ -4252,6 +4304,9 @@ libc_function(
42524304
":__support_osutil_syscall",
42534305
":errno",
42544306
":hdr_fcntl_macros",
4307+
":hdr_unistd_macros",
4308+
":types_size_t",
4309+
":types_ssize_t",
42554310
],
42564311
)
42574312

@@ -4276,6 +4331,7 @@ libc_function(
42764331
":__support_osutil_syscall",
42774332
":errno",
42784333
":hdr_fcntl_macros",
4334+
":hdr_unistd_macros",
42794335
],
42804336
)
42814337

@@ -4288,6 +4344,7 @@ libc_function(
42884344
":__support_osutil_syscall",
42894345
":errno",
42904346
":hdr_fcntl_macros",
4347+
":hdr_unistd_macros",
42914348
],
42924349
)
42934350

@@ -4302,6 +4359,7 @@ libc_function(
43024359
# ":__support_common",
43034360
# ":__support_osutil_syscall",
43044361
# ":errno",
4362+
# ":hdr_unistd_macros",
43054363
# ],
43064364
# )
43074365

@@ -4313,6 +4371,8 @@ libc_function(
43134371
":__support_common",
43144372
":__support_osutil_syscall",
43154373
":errno",
4374+
":hdr_unistd_macros",
4375+
":types_ssize_t",
43164376
],
43174377
)
43184378

@@ -4324,6 +4384,8 @@ libc_function(
43244384
":__support_common",
43254385
":__support_osutil_syscall",
43264386
":errno",
4387+
":hdr_unistd_macros",
4388+
":types_off_t",
43274389
],
43284390
)
43294391

@@ -4360,6 +4422,9 @@ libc_function(
43604422
":__support_common",
43614423
":__support_osutil_syscall",
43624424
":errno",
4425+
":hdr_unistd_macros",
4426+
":types_size_t",
4427+
":types_ssize_t",
43634428
],
43644429
)
43654430

0 commit comments

Comments
 (0)