View | Details | Raw Unified | Return to bug 253557
Collapse All | Expand All

(-)b/lang/rust/Makefile (-1 / +1 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	rust
4
PORTNAME=	rust
5
PORTVERSION?=	1.50.0
5
PORTVERSION?=	1.50.0
6
PORTREVISION?=	0
6
PORTREVISION?=	1
7
CATEGORIES=	lang
7
CATEGORIES=	lang
8
MASTER_SITES=	https://static.rust-lang.org/dist/:src \
8
MASTER_SITES=	https://static.rust-lang.org/dist/:src \
9
		https://dev-static.rust-lang.org/dist/:src \
9
		https://dev-static.rust-lang.org/dist/:src \
(-)b/lang/rust/files/patch-backtrace (+918 lines)
Added Link Here
1
https://github.com/rust-lang/rust/issues/78184
2
3
--- library/backtrace/src/symbolize/gimli.rs.orig	2021-02-10 17:36:59 UTC
4
+++ library/backtrace/src/symbolize/gimli.rs
5
@@ -361,6 +361,7 @@ cfg_if::cfg_if! {
6
     } else if #[cfg(any(
7
         target_os = "linux",
8
         target_os = "fuchsia",
9
+        target_os = "freebsd",
10
     ))] {
11
         // Other Unix (e.g. Linux) platforms use ELF as an object file format
12
         // and typically implement an API called `dl_iterate_phdr` to load
13
--- vendor/libc-0.2.77/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
14
+++ vendor/libc-0.2.77/src/unix/bsd/freebsdlike/mod.rs
15
@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
16
 pub type id_t = i64;
17
 pub type vm_size_t = ::uintptr_t;
18
 
19
+// elf.h
20
+
21
+pub type Elf32_Addr = u32;
22
+pub type Elf32_Half = u16;
23
+pub type Elf32_Lword = u64;
24
+pub type Elf32_Off = u32;
25
+pub type Elf32_Sword = i32;
26
+pub type Elf32_Word = u32;
27
+
28
+pub type Elf64_Addr = u64;
29
+pub type Elf64_Half = u16;
30
+pub type Elf64_Lword = u64;
31
+pub type Elf64_Off = u64;
32
+pub type Elf64_Sword = i32;
33
+pub type Elf64_Sxword = i64;
34
+pub type Elf64_Word = u32;
35
+pub type Elf64_Xword = u64;
36
+
37
+cfg_if! {
38
+    if #[cfg(target_pointer_width = "64")] {
39
+        type Elf_Addr = Elf64_Addr;
40
+        type Elf_Half = Elf64_Half;
41
+        type Elf_Phdr = Elf64_Phdr;
42
+    } else if #[cfg(target_pointer_width = "32")] {
43
+        type Elf_Addr = Elf32_Addr;
44
+        type Elf_Half = Elf32_Half;
45
+        type Elf_Phdr = Elf32_Phdr;
46
+    }
47
+}
48
+
49
+// link.h
50
+
51
 #[cfg_attr(feature = "extra_traits", derive(Debug))]
52
 pub enum timezone {}
53
 impl ::Copy for timezone {}
54
@@ -233,6 +265,43 @@ s! {
55
         pub piod_addr: *mut ::c_void,
56
         pub piod_len: ::size_t,
57
     }
58
+
59
+    // elf.h
60
+
61
+    pub struct Elf32_Phdr {
62
+        pub p_type: Elf32_Word,
63
+        pub p_offset: Elf32_Off,
64
+        pub p_vaddr: Elf32_Addr,
65
+        pub p_paddr: Elf32_Addr,
66
+        pub p_filesz: Elf32_Word,
67
+        pub p_memsz: Elf32_Word,
68
+        pub p_flags: Elf32_Word,
69
+        pub p_align: Elf32_Word,
70
+    }
71
+
72
+    pub struct Elf64_Phdr {
73
+        pub p_type: Elf64_Word,
74
+        pub p_flags: Elf64_Word,
75
+        pub p_offset: Elf64_Off,
76
+        pub p_vaddr: Elf64_Addr,
77
+        pub p_paddr: Elf64_Addr,
78
+        pub p_filesz: Elf64_Xword,
79
+        pub p_memsz: Elf64_Xword,
80
+        pub p_align: Elf64_Xword,
81
+    }
82
+
83
+    // link.h
84
+
85
+    pub struct dl_phdr_info {
86
+        pub dlpi_addr: Elf_Addr,
87
+        pub dlpi_name: *const ::c_char,
88
+        pub dlpi_phdr: *const Elf_Phdr,
89
+        pub dlpi_phnum: Elf_Half,
90
+        pub dlpi_adds: ::c_ulonglong,
91
+        pub dlpi_subs: ::c_ulonglong,
92
+        pub dlpi_tls_modid: usize,
93
+        pub dlpi_tls_data: *mut ::c_void,
94
+    }
95
 }
96
 
97
 s_no_extra_traits! {
98
@@ -1514,6 +1583,18 @@ extern "C" {
99
 
100
     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
101
     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
102
+
103
+    // #include <link.h>
104
+    pub fn dl_iterate_phdr(
105
+        callback: ::Option<
106
+            unsafe extern "C" fn(
107
+                info: *mut dl_phdr_info,
108
+                size: usize,
109
+                data: *mut ::c_void,
110
+            ) -> ::c_int,
111
+        >,
112
+        data: *mut ::c_void,
113
+    ) -> ::c_int;
114
 }
115
 
116
 #[link(name = "rt")]
117
--- vendor/libc-0.2.77/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
118
+++ vendor/libc-0.2.77/src/unix/bsd/netbsdlike/netbsd/mod.rs
119
@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
120
 pub type lwpid_t = ::c_uint;
121
 pub type shmatt_t = ::c_uint;
122
 
123
+// elf.h
124
+
125
+pub type Elf32_Addr = u32;
126
+pub type Elf32_Half = u16;
127
+pub type Elf32_Lword = u64;
128
+pub type Elf32_Off = u32;
129
+pub type Elf32_Sword = i32;
130
+pub type Elf32_Word = u32;
131
+
132
+pub type Elf64_Addr = u64;
133
+pub type Elf64_Half = u16;
134
+pub type Elf64_Lword = u64;
135
+pub type Elf64_Off = u64;
136
+pub type Elf64_Sword = i32;
137
+pub type Elf64_Sxword = i64;
138
+pub type Elf64_Word = u32;
139
+pub type Elf64_Xword = u64;
140
+
141
+cfg_if! {
142
+    if #[cfg(target_pointer_width = "64")] {
143
+        type Elf_Addr = Elf64_Addr;
144
+        type Elf_Half = Elf64_Half;
145
+        type Elf_Phdr = Elf64_Phdr;
146
+    } else if #[cfg(target_pointer_width = "32")] {
147
+        type Elf_Addr = Elf32_Addr;
148
+        type Elf_Half = Elf32_Half;
149
+        type Elf_Phdr = Elf32_Phdr;
150
+    }
151
+}
152
+
153
 impl siginfo_t {
154
     pub unsafe fn si_value(&self) -> ::sigval {
155
         #[repr(C)]
156
@@ -341,6 +371,42 @@ s! {
157
         pub time_state: ::c_int,
158
     }
159
 
160
+    // elf.h
161
+
162
+    pub struct Elf32_Phdr {
163
+        pub p_type: Elf32_Word,
164
+        pub p_offset: Elf32_Off,
165
+        pub p_vaddr: Elf32_Addr,
166
+        pub p_paddr: Elf32_Addr,
167
+        pub p_filesz: Elf32_Word,
168
+        pub p_memsz: Elf32_Word,
169
+        pub p_flags: Elf32_Word,
170
+        pub p_align: Elf32_Word,
171
+    }
172
+
173
+    pub struct Elf64_Phdr {
174
+        pub p_type: Elf64_Word,
175
+        pub p_flags: Elf64_Word,
176
+        pub p_offset: Elf64_Off,
177
+        pub p_vaddr: Elf64_Addr,
178
+        pub p_paddr: Elf64_Addr,
179
+        pub p_filesz: Elf64_Xword,
180
+        pub p_memsz: Elf64_Xword,
181
+        pub p_align: Elf64_Xword,
182
+    }
183
+
184
+    // link.h
185
+
186
+    pub struct dl_phdr_info {
187
+        pub dlpi_addr: Elf_Addr,
188
+        pub dlpi_name: *const ::c_char,
189
+        pub dlpi_phdr: *const Elf_Phdr,
190
+        pub dlpi_phnum: Elf_Half,
191
+        pub dlpi_adds: ::c_ulonglong,
192
+        pub dlpi_subs: ::c_ulonglong,
193
+        pub dlpi_tls_modid: usize,
194
+        pub dlpi_tls_data: *mut ::c_void,
195
+    }
196
 }
197
 
198
 s_no_extra_traits! {
199
@@ -1988,6 +2054,19 @@ extern "C" {
200
         needle: *const ::c_void,
201
         needlelen: ::size_t,
202
     ) -> *mut ::c_void;
203
+
204
+    // link.h
205
+
206
+    pub fn dl_iterate_phdr(
207
+        callback: ::Option<
208
+            unsafe extern "C" fn(
209
+                info: *mut dl_phdr_info,
210
+                size: usize,
211
+                data: *mut ::c_void,
212
+            ) -> ::c_int,
213
+        >,
214
+        data: *mut ::c_void,
215
+    ) -> ::c_int;
216
 }
217
 
218
 #[link(name = "util")]
219
--- vendor/libc-0.2.77/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
220
+++ vendor/libc-0.2.77/src/unix/bsd/netbsdlike/openbsd/mod.rs
221
@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
222
 pub type pthread_rwlockattr_t = *mut ::c_void;
223
 pub type caddr_t = *mut ::c_char;
224
 
225
+// elf.h
226
+
227
+pub type Elf32_Addr = u32;
228
+pub type Elf32_Half = u16;
229
+pub type Elf32_Lword = u64;
230
+pub type Elf32_Off = u32;
231
+pub type Elf32_Sword = i32;
232
+pub type Elf32_Word = u32;
233
+
234
+pub type Elf64_Addr = u64;
235
+pub type Elf64_Half = u16;
236
+pub type Elf64_Lword = u64;
237
+pub type Elf64_Off = u64;
238
+pub type Elf64_Sword = i32;
239
+pub type Elf64_Sxword = i64;
240
+pub type Elf64_Word = u32;
241
+pub type Elf64_Xword = u64;
242
+
243
+cfg_if! {
244
+    if #[cfg(target_pointer_width = "64")] {
245
+        type Elf_Addr = Elf64_Addr;
246
+        type Elf_Half = Elf64_Half;
247
+        type Elf_Phdr = Elf64_Phdr;
248
+    } else if #[cfg(target_pointer_width = "32")] {
249
+        type Elf_Addr = Elf32_Addr;
250
+        type Elf_Half = Elf32_Half;
251
+        type Elf_Phdr = Elf32_Phdr;
252
+    }
253
+}
254
+
255
 s! {
256
     pub struct glob_t {
257
         pub gl_pathc:   ::size_t,
258
@@ -321,6 +351,38 @@ s! {
259
         __shm_ctimensec: c_long,
260
         pub shm_internal: *mut ::c_void,
261
     }
262
+
263
+    // elf.h
264
+    pub struct Elf32_Phdr {
265
+        pub p_type: Elf32_Word,
266
+        pub p_offset: Elf32_Off,
267
+        pub p_vaddr: Elf32_Addr,
268
+        pub p_paddr: Elf32_Addr,
269
+        pub p_filesz: Elf32_Word,
270
+        pub p_memsz: Elf32_Word,
271
+        pub p_flags: Elf32_Word,
272
+        pub p_align: Elf32_Word,
273
+    }
274
+
275
+    pub struct Elf64_Phdr {
276
+        pub p_type: Elf64_Word,
277
+        pub p_flags: Elf64_Word,
278
+        pub p_offset: Elf64_Off,
279
+        pub p_vaddr: Elf64_Addr,
280
+        pub p_paddr: Elf64_Addr,
281
+        pub p_filesz: Elf64_Xword,
282
+        pub p_memsz: Elf64_Xword,
283
+        pub p_align: Elf64_Xword,
284
+    }
285
+
286
+    // link.h
287
+
288
+    pub struct dl_phdr_info {
289
+        pub dlpi_addr: Elf_Addr,
290
+        pub dlpi_name: *const ::c_char,
291
+        pub dlpi_phdr: *const Elf_Phdr,
292
+        pub dlpi_phnum: Elf_Half,
293
+    }
294
 }
295
 
296
 impl siginfo_t {
297
@@ -1480,6 +1542,17 @@ extern "C" {
298
         needle: *const ::c_void,
299
         needlelen: ::size_t,
300
     ) -> *mut ::c_void;
301
+    // #include <link.h>
302
+    pub fn dl_iterate_phdr(
303
+        callback: ::Option<
304
+            unsafe extern "C" fn(
305
+                info: *mut dl_phdr_info,
306
+                size: usize,
307
+                data: *mut ::c_void,
308
+            ) -> ::c_int,
309
+        >,
310
+        data: *mut ::c_void,
311
+    ) -> ::c_int;
312
 }
313
 
314
 cfg_if! {
315
--- vendor/libc-0.2.79/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
316
+++ vendor/libc-0.2.79/src/unix/bsd/freebsdlike/mod.rs
317
@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
318
 pub type id_t = i64;
319
 pub type vm_size_t = ::uintptr_t;
320
 
321
+// elf.h
322
+
323
+pub type Elf32_Addr = u32;
324
+pub type Elf32_Half = u16;
325
+pub type Elf32_Lword = u64;
326
+pub type Elf32_Off = u32;
327
+pub type Elf32_Sword = i32;
328
+pub type Elf32_Word = u32;
329
+
330
+pub type Elf64_Addr = u64;
331
+pub type Elf64_Half = u16;
332
+pub type Elf64_Lword = u64;
333
+pub type Elf64_Off = u64;
334
+pub type Elf64_Sword = i32;
335
+pub type Elf64_Sxword = i64;
336
+pub type Elf64_Word = u32;
337
+pub type Elf64_Xword = u64;
338
+
339
+cfg_if! {
340
+    if #[cfg(target_pointer_width = "64")] {
341
+        type Elf_Addr = Elf64_Addr;
342
+        type Elf_Half = Elf64_Half;
343
+        type Elf_Phdr = Elf64_Phdr;
344
+    } else if #[cfg(target_pointer_width = "32")] {
345
+        type Elf_Addr = Elf32_Addr;
346
+        type Elf_Half = Elf32_Half;
347
+        type Elf_Phdr = Elf32_Phdr;
348
+    }
349
+}
350
+
351
+// link.h
352
+
353
 #[cfg_attr(feature = "extra_traits", derive(Debug))]
354
 pub enum timezone {}
355
 impl ::Copy for timezone {}
356
@@ -233,6 +265,43 @@ s! {
357
         pub piod_addr: *mut ::c_void,
358
         pub piod_len: ::size_t,
359
     }
360
+
361
+    // elf.h
362
+
363
+    pub struct Elf32_Phdr {
364
+        pub p_type: Elf32_Word,
365
+        pub p_offset: Elf32_Off,
366
+        pub p_vaddr: Elf32_Addr,
367
+        pub p_paddr: Elf32_Addr,
368
+        pub p_filesz: Elf32_Word,
369
+        pub p_memsz: Elf32_Word,
370
+        pub p_flags: Elf32_Word,
371
+        pub p_align: Elf32_Word,
372
+    }
373
+
374
+    pub struct Elf64_Phdr {
375
+        pub p_type: Elf64_Word,
376
+        pub p_flags: Elf64_Word,
377
+        pub p_offset: Elf64_Off,
378
+        pub p_vaddr: Elf64_Addr,
379
+        pub p_paddr: Elf64_Addr,
380
+        pub p_filesz: Elf64_Xword,
381
+        pub p_memsz: Elf64_Xword,
382
+        pub p_align: Elf64_Xword,
383
+    }
384
+
385
+    // link.h
386
+
387
+    pub struct dl_phdr_info {
388
+        pub dlpi_addr: Elf_Addr,
389
+        pub dlpi_name: *const ::c_char,
390
+        pub dlpi_phdr: *const Elf_Phdr,
391
+        pub dlpi_phnum: Elf_Half,
392
+        pub dlpi_adds: ::c_ulonglong,
393
+        pub dlpi_subs: ::c_ulonglong,
394
+        pub dlpi_tls_modid: usize,
395
+        pub dlpi_tls_data: *mut ::c_void,
396
+    }
397
 }
398
 
399
 s_no_extra_traits! {
400
@@ -1514,6 +1583,18 @@ extern "C" {
401
 
402
     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
403
     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
404
+
405
+    // #include <link.h>
406
+    pub fn dl_iterate_phdr(
407
+        callback: ::Option<
408
+            unsafe extern "C" fn(
409
+                info: *mut dl_phdr_info,
410
+                size: usize,
411
+                data: *mut ::c_void,
412
+            ) -> ::c_int,
413
+        >,
414
+        data: *mut ::c_void,
415
+    ) -> ::c_int;
416
 }
417
 
418
 #[link(name = "rt")]
419
--- vendor/libc-0.2.79/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
420
+++ vendor/libc-0.2.79/src/unix/bsd/netbsdlike/netbsd/mod.rs
421
@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
422
 pub type lwpid_t = ::c_uint;
423
 pub type shmatt_t = ::c_uint;
424
 
425
+// elf.h
426
+
427
+pub type Elf32_Addr = u32;
428
+pub type Elf32_Half = u16;
429
+pub type Elf32_Lword = u64;
430
+pub type Elf32_Off = u32;
431
+pub type Elf32_Sword = i32;
432
+pub type Elf32_Word = u32;
433
+
434
+pub type Elf64_Addr = u64;
435
+pub type Elf64_Half = u16;
436
+pub type Elf64_Lword = u64;
437
+pub type Elf64_Off = u64;
438
+pub type Elf64_Sword = i32;
439
+pub type Elf64_Sxword = i64;
440
+pub type Elf64_Word = u32;
441
+pub type Elf64_Xword = u64;
442
+
443
+cfg_if! {
444
+    if #[cfg(target_pointer_width = "64")] {
445
+        type Elf_Addr = Elf64_Addr;
446
+        type Elf_Half = Elf64_Half;
447
+        type Elf_Phdr = Elf64_Phdr;
448
+    } else if #[cfg(target_pointer_width = "32")] {
449
+        type Elf_Addr = Elf32_Addr;
450
+        type Elf_Half = Elf32_Half;
451
+        type Elf_Phdr = Elf32_Phdr;
452
+    }
453
+}
454
+
455
 impl siginfo_t {
456
     pub unsafe fn si_value(&self) -> ::sigval {
457
         #[repr(C)]
458
@@ -341,6 +371,42 @@ s! {
459
         pub time_state: ::c_int,
460
     }
461
 
462
+    // elf.h
463
+
464
+    pub struct Elf32_Phdr {
465
+        pub p_type: Elf32_Word,
466
+        pub p_offset: Elf32_Off,
467
+        pub p_vaddr: Elf32_Addr,
468
+        pub p_paddr: Elf32_Addr,
469
+        pub p_filesz: Elf32_Word,
470
+        pub p_memsz: Elf32_Word,
471
+        pub p_flags: Elf32_Word,
472
+        pub p_align: Elf32_Word,
473
+    }
474
+
475
+    pub struct Elf64_Phdr {
476
+        pub p_type: Elf64_Word,
477
+        pub p_flags: Elf64_Word,
478
+        pub p_offset: Elf64_Off,
479
+        pub p_vaddr: Elf64_Addr,
480
+        pub p_paddr: Elf64_Addr,
481
+        pub p_filesz: Elf64_Xword,
482
+        pub p_memsz: Elf64_Xword,
483
+        pub p_align: Elf64_Xword,
484
+    }
485
+
486
+    // link.h
487
+
488
+    pub struct dl_phdr_info {
489
+        pub dlpi_addr: Elf_Addr,
490
+        pub dlpi_name: *const ::c_char,
491
+        pub dlpi_phdr: *const Elf_Phdr,
492
+        pub dlpi_phnum: Elf_Half,
493
+        pub dlpi_adds: ::c_ulonglong,
494
+        pub dlpi_subs: ::c_ulonglong,
495
+        pub dlpi_tls_modid: usize,
496
+        pub dlpi_tls_data: *mut ::c_void,
497
+    }
498
 }
499
 
500
 s_no_extra_traits! {
501
@@ -1990,6 +2056,19 @@ extern "C" {
502
         needle: *const ::c_void,
503
         needlelen: ::size_t,
504
     ) -> *mut ::c_void;
505
+
506
+    // link.h
507
+
508
+    pub fn dl_iterate_phdr(
509
+        callback: ::Option<
510
+            unsafe extern "C" fn(
511
+                info: *mut dl_phdr_info,
512
+                size: usize,
513
+                data: *mut ::c_void,
514
+            ) -> ::c_int,
515
+        >,
516
+        data: *mut ::c_void,
517
+    ) -> ::c_int;
518
 }
519
 
520
 #[link(name = "util")]
521
--- vendor/libc-0.2.79/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
522
+++ vendor/libc-0.2.79/src/unix/bsd/netbsdlike/openbsd/mod.rs
523
@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
524
 pub type pthread_rwlockattr_t = *mut ::c_void;
525
 pub type caddr_t = *mut ::c_char;
526
 
527
+// elf.h
528
+
529
+pub type Elf32_Addr = u32;
530
+pub type Elf32_Half = u16;
531
+pub type Elf32_Lword = u64;
532
+pub type Elf32_Off = u32;
533
+pub type Elf32_Sword = i32;
534
+pub type Elf32_Word = u32;
535
+
536
+pub type Elf64_Addr = u64;
537
+pub type Elf64_Half = u16;
538
+pub type Elf64_Lword = u64;
539
+pub type Elf64_Off = u64;
540
+pub type Elf64_Sword = i32;
541
+pub type Elf64_Sxword = i64;
542
+pub type Elf64_Word = u32;
543
+pub type Elf64_Xword = u64;
544
+
545
+cfg_if! {
546
+    if #[cfg(target_pointer_width = "64")] {
547
+        type Elf_Addr = Elf64_Addr;
548
+        type Elf_Half = Elf64_Half;
549
+        type Elf_Phdr = Elf64_Phdr;
550
+    } else if #[cfg(target_pointer_width = "32")] {
551
+        type Elf_Addr = Elf32_Addr;
552
+        type Elf_Half = Elf32_Half;
553
+        type Elf_Phdr = Elf32_Phdr;
554
+    }
555
+}
556
+
557
 s! {
558
     pub struct glob_t {
559
         pub gl_pathc:   ::size_t,
560
@@ -321,6 +351,38 @@ s! {
561
         __shm_ctimensec: c_long,
562
         pub shm_internal: *mut ::c_void,
563
     }
564
+
565
+    // elf.h
566
+    pub struct Elf32_Phdr {
567
+        pub p_type: Elf32_Word,
568
+        pub p_offset: Elf32_Off,
569
+        pub p_vaddr: Elf32_Addr,
570
+        pub p_paddr: Elf32_Addr,
571
+        pub p_filesz: Elf32_Word,
572
+        pub p_memsz: Elf32_Word,
573
+        pub p_flags: Elf32_Word,
574
+        pub p_align: Elf32_Word,
575
+    }
576
+
577
+    pub struct Elf64_Phdr {
578
+        pub p_type: Elf64_Word,
579
+        pub p_flags: Elf64_Word,
580
+        pub p_offset: Elf64_Off,
581
+        pub p_vaddr: Elf64_Addr,
582
+        pub p_paddr: Elf64_Addr,
583
+        pub p_filesz: Elf64_Xword,
584
+        pub p_memsz: Elf64_Xword,
585
+        pub p_align: Elf64_Xword,
586
+    }
587
+
588
+    // link.h
589
+
590
+    pub struct dl_phdr_info {
591
+        pub dlpi_addr: Elf_Addr,
592
+        pub dlpi_name: *const ::c_char,
593
+        pub dlpi_phdr: *const Elf_Phdr,
594
+        pub dlpi_phnum: Elf_Half,
595
+    }
596
 }
597
 
598
 impl siginfo_t {
599
@@ -1482,6 +1544,17 @@ extern "C" {
600
         needle: *const ::c_void,
601
         needlelen: ::size_t,
602
     ) -> *mut ::c_void;
603
+    // #include <link.h>
604
+    pub fn dl_iterate_phdr(
605
+        callback: ::Option<
606
+            unsafe extern "C" fn(
607
+                info: *mut dl_phdr_info,
608
+                size: usize,
609
+                data: *mut ::c_void,
610
+            ) -> ::c_int,
611
+        >,
612
+        data: *mut ::c_void,
613
+    ) -> ::c_int;
614
 }
615
 
616
 cfg_if! {
617
--- vendor/libc/src/unix/bsd/freebsdlike/mod.rs.orig	2021-02-10 18:18:38 UTC
618
+++ vendor/libc/src/unix/bsd/freebsdlike/mod.rs
619
@@ -14,6 +14,38 @@ pub type nl_item = ::c_int;
620
 pub type id_t = i64;
621
 pub type vm_size_t = ::uintptr_t;
622
 
623
+// elf.h
624
+
625
+pub type Elf32_Addr = u32;
626
+pub type Elf32_Half = u16;
627
+pub type Elf32_Lword = u64;
628
+pub type Elf32_Off = u32;
629
+pub type Elf32_Sword = i32;
630
+pub type Elf32_Word = u32;
631
+
632
+pub type Elf64_Addr = u64;
633
+pub type Elf64_Half = u16;
634
+pub type Elf64_Lword = u64;
635
+pub type Elf64_Off = u64;
636
+pub type Elf64_Sword = i32;
637
+pub type Elf64_Sxword = i64;
638
+pub type Elf64_Word = u32;
639
+pub type Elf64_Xword = u64;
640
+
641
+cfg_if! {
642
+    if #[cfg(target_pointer_width = "64")] {
643
+        type Elf_Addr = Elf64_Addr;
644
+        type Elf_Half = Elf64_Half;
645
+        type Elf_Phdr = Elf64_Phdr;
646
+    } else if #[cfg(target_pointer_width = "32")] {
647
+        type Elf_Addr = Elf32_Addr;
648
+        type Elf_Half = Elf32_Half;
649
+        type Elf_Phdr = Elf32_Phdr;
650
+    }
651
+}
652
+
653
+// link.h
654
+
655
 #[cfg_attr(feature = "extra_traits", derive(Debug))]
656
 pub enum timezone {}
657
 impl ::Copy for timezone {}
658
@@ -233,6 +265,43 @@ s! {
659
         pub piod_addr: *mut ::c_void,
660
         pub piod_len: ::size_t,
661
     }
662
+
663
+    // elf.h
664
+
665
+    pub struct Elf32_Phdr {
666
+        pub p_type: Elf32_Word,
667
+        pub p_offset: Elf32_Off,
668
+        pub p_vaddr: Elf32_Addr,
669
+        pub p_paddr: Elf32_Addr,
670
+        pub p_filesz: Elf32_Word,
671
+        pub p_memsz: Elf32_Word,
672
+        pub p_flags: Elf32_Word,
673
+        pub p_align: Elf32_Word,
674
+    }
675
+
676
+    pub struct Elf64_Phdr {
677
+        pub p_type: Elf64_Word,
678
+        pub p_flags: Elf64_Word,
679
+        pub p_offset: Elf64_Off,
680
+        pub p_vaddr: Elf64_Addr,
681
+        pub p_paddr: Elf64_Addr,
682
+        pub p_filesz: Elf64_Xword,
683
+        pub p_memsz: Elf64_Xword,
684
+        pub p_align: Elf64_Xword,
685
+    }
686
+
687
+    // link.h
688
+
689
+    pub struct dl_phdr_info {
690
+        pub dlpi_addr: Elf_Addr,
691
+        pub dlpi_name: *const ::c_char,
692
+        pub dlpi_phdr: *const Elf_Phdr,
693
+        pub dlpi_phnum: Elf_Half,
694
+        pub dlpi_adds: ::c_ulonglong,
695
+        pub dlpi_subs: ::c_ulonglong,
696
+        pub dlpi_tls_modid: usize,
697
+        pub dlpi_tls_data: *mut ::c_void,
698
+    }
699
 }
700
 
701
 s_no_extra_traits! {
702
@@ -1514,6 +1583,18 @@ extern "C" {
703
 
704
     pub fn ntp_adjtime(buf: *mut timex) -> ::c_int;
705
     pub fn ntp_gettime(buf: *mut ntptimeval) -> ::c_int;
706
+
707
+    // #include <link.h>
708
+    pub fn dl_iterate_phdr(
709
+        callback: ::Option<
710
+            unsafe extern "C" fn(
711
+                info: *mut dl_phdr_info,
712
+                size: usize,
713
+                data: *mut ::c_void,
714
+            ) -> ::c_int,
715
+        >,
716
+        data: *mut ::c_void,
717
+    ) -> ::c_int;
718
 }
719
 
720
 #[link(name = "rt")]
721
--- vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
722
+++ vendor/libc/src/unix/bsd/netbsdlike/netbsd/mod.rs
723
@@ -11,6 +11,36 @@ pub type vm_size_t = ::uintptr_t;
724
 pub type lwpid_t = ::c_uint;
725
 pub type shmatt_t = ::c_uint;
726
 
727
+// elf.h
728
+
729
+pub type Elf32_Addr = u32;
730
+pub type Elf32_Half = u16;
731
+pub type Elf32_Lword = u64;
732
+pub type Elf32_Off = u32;
733
+pub type Elf32_Sword = i32;
734
+pub type Elf32_Word = u32;
735
+
736
+pub type Elf64_Addr = u64;
737
+pub type Elf64_Half = u16;
738
+pub type Elf64_Lword = u64;
739
+pub type Elf64_Off = u64;
740
+pub type Elf64_Sword = i32;
741
+pub type Elf64_Sxword = i64;
742
+pub type Elf64_Word = u32;
743
+pub type Elf64_Xword = u64;
744
+
745
+cfg_if! {
746
+    if #[cfg(target_pointer_width = "64")] {
747
+        type Elf_Addr = Elf64_Addr;
748
+        type Elf_Half = Elf64_Half;
749
+        type Elf_Phdr = Elf64_Phdr;
750
+    } else if #[cfg(target_pointer_width = "32")] {
751
+        type Elf_Addr = Elf32_Addr;
752
+        type Elf_Half = Elf32_Half;
753
+        type Elf_Phdr = Elf32_Phdr;
754
+    }
755
+}
756
+
757
 impl siginfo_t {
758
     pub unsafe fn si_value(&self) -> ::sigval {
759
         #[repr(C)]
760
@@ -341,6 +371,42 @@ s! {
761
         pub time_state: ::c_int,
762
     }
763
 
764
+    // elf.h
765
+
766
+    pub struct Elf32_Phdr {
767
+        pub p_type: Elf32_Word,
768
+        pub p_offset: Elf32_Off,
769
+        pub p_vaddr: Elf32_Addr,
770
+        pub p_paddr: Elf32_Addr,
771
+        pub p_filesz: Elf32_Word,
772
+        pub p_memsz: Elf32_Word,
773
+        pub p_flags: Elf32_Word,
774
+        pub p_align: Elf32_Word,
775
+    }
776
+
777
+    pub struct Elf64_Phdr {
778
+        pub p_type: Elf64_Word,
779
+        pub p_flags: Elf64_Word,
780
+        pub p_offset: Elf64_Off,
781
+        pub p_vaddr: Elf64_Addr,
782
+        pub p_paddr: Elf64_Addr,
783
+        pub p_filesz: Elf64_Xword,
784
+        pub p_memsz: Elf64_Xword,
785
+        pub p_align: Elf64_Xword,
786
+    }
787
+
788
+    // link.h
789
+
790
+    pub struct dl_phdr_info {
791
+        pub dlpi_addr: Elf_Addr,
792
+        pub dlpi_name: *const ::c_char,
793
+        pub dlpi_phdr: *const Elf_Phdr,
794
+        pub dlpi_phnum: Elf_Half,
795
+        pub dlpi_adds: ::c_ulonglong,
796
+        pub dlpi_subs: ::c_ulonglong,
797
+        pub dlpi_tls_modid: usize,
798
+        pub dlpi_tls_data: *mut ::c_void,
799
+    }
800
 }
801
 
802
 s_no_extra_traits! {
803
@@ -2002,6 +2068,19 @@ extern "C" {
804
         needle: *const ::c_void,
805
         needlelen: ::size_t,
806
     ) -> *mut ::c_void;
807
+
808
+    // link.h
809
+
810
+    pub fn dl_iterate_phdr(
811
+        callback: ::Option<
812
+            unsafe extern "C" fn(
813
+                info: *mut dl_phdr_info,
814
+                size: usize,
815
+                data: *mut ::c_void,
816
+            ) -> ::c_int,
817
+        >,
818
+        data: *mut ::c_void,
819
+    ) -> ::c_int;
820
 }
821
 
822
 #[link(name = "util")]
823
--- vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs.orig	2021-02-10 18:18:38 UTC
824
+++ vendor/libc/src/unix/bsd/netbsdlike/openbsd/mod.rs
825
@@ -16,6 +16,36 @@ pub type pthread_rwlock_t = *mut ::c_void;
826
 pub type pthread_rwlockattr_t = *mut ::c_void;
827
 pub type caddr_t = *mut ::c_char;
828
 
829
+// elf.h
830
+
831
+pub type Elf32_Addr = u32;
832
+pub type Elf32_Half = u16;
833
+pub type Elf32_Lword = u64;
834
+pub type Elf32_Off = u32;
835
+pub type Elf32_Sword = i32;
836
+pub type Elf32_Word = u32;
837
+
838
+pub type Elf64_Addr = u64;
839
+pub type Elf64_Half = u16;
840
+pub type Elf64_Lword = u64;
841
+pub type Elf64_Off = u64;
842
+pub type Elf64_Sword = i32;
843
+pub type Elf64_Sxword = i64;
844
+pub type Elf64_Word = u32;
845
+pub type Elf64_Xword = u64;
846
+
847
+cfg_if! {
848
+    if #[cfg(target_pointer_width = "64")] {
849
+        type Elf_Addr = Elf64_Addr;
850
+        type Elf_Half = Elf64_Half;
851
+        type Elf_Phdr = Elf64_Phdr;
852
+    } else if #[cfg(target_pointer_width = "32")] {
853
+        type Elf_Addr = Elf32_Addr;
854
+        type Elf_Half = Elf32_Half;
855
+        type Elf_Phdr = Elf32_Phdr;
856
+    }
857
+}
858
+
859
 s! {
860
     pub struct glob_t {
861
         pub gl_pathc:   ::size_t,
862
@@ -321,6 +351,38 @@ s! {
863
         __shm_ctimensec: c_long,
864
         pub shm_internal: *mut ::c_void,
865
     }
866
+
867
+    // elf.h
868
+    pub struct Elf32_Phdr {
869
+        pub p_type: Elf32_Word,
870
+        pub p_offset: Elf32_Off,
871
+        pub p_vaddr: Elf32_Addr,
872
+        pub p_paddr: Elf32_Addr,
873
+        pub p_filesz: Elf32_Word,
874
+        pub p_memsz: Elf32_Word,
875
+        pub p_flags: Elf32_Word,
876
+        pub p_align: Elf32_Word,
877
+    }
878
+
879
+    pub struct Elf64_Phdr {
880
+        pub p_type: Elf64_Word,
881
+        pub p_flags: Elf64_Word,
882
+        pub p_offset: Elf64_Off,
883
+        pub p_vaddr: Elf64_Addr,
884
+        pub p_paddr: Elf64_Addr,
885
+        pub p_filesz: Elf64_Xword,
886
+        pub p_memsz: Elf64_Xword,
887
+        pub p_align: Elf64_Xword,
888
+    }
889
+
890
+    // link.h
891
+
892
+    pub struct dl_phdr_info {
893
+        pub dlpi_addr: Elf_Addr,
894
+        pub dlpi_name: *const ::c_char,
895
+        pub dlpi_phdr: *const Elf_Phdr,
896
+        pub dlpi_phnum: Elf_Half,
897
+    }
898
 }
899
 
900
 impl siginfo_t {
901
@@ -1482,6 +1544,17 @@ extern "C" {
902
         needle: *const ::c_void,
903
         needlelen: ::size_t,
904
     ) -> *mut ::c_void;
905
+    // #include <link.h>
906
+    pub fn dl_iterate_phdr(
907
+        callback: ::Option<
908
+            unsafe extern "C" fn(
909
+                info: *mut dl_phdr_info,
910
+                size: usize,
911
+                data: *mut ::c_void,
912
+            ) -> ::c_int,
913
+        >,
914
+        data: *mut ::c_void,
915
+    ) -> ::c_int;
916
 }
917
 
918
 cfg_if! {

Return to bug 253557