Skip to content

Commit

Permalink
Auto merge of rust-lang#2461 - rtzoeller:dfly_headers, r=JohnTitor
Browse files Browse the repository at this point in the history
Fix most libc-test compile warnings and errors for DragonFly

libc-test is failing on my DragonFly BSD system with a large number of errors, most of which are just a result of headers not being included.

```
[root@ ~/libc/libc-test]# uname -a
DragonFly  6.0-RELEASE DragonFly v6.0.1-RELEASE #0: Wed Oct 13 21:06:17 CDT 2021     root@:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64

[root@ ~/libc/libc-test]# cargo test 2>&1 >/dev/null | wc -l
    6015
```

Including a few additional headers, most of these warnings and errors are fixed:
```
[root@ ~/libc/libc-test]# cargo test 2>&1 >/dev/null | wc -l
    561
```
  • Loading branch information
bors committed Oct 17, 2021
2 parents 133aeb8 + 0c4b6ed commit 4aaba6c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1176,8 +1176,10 @@ fn test_dragonflybsd(target: &str) {
"ifaddrs.h",
"langinfo.h",
"limits.h",
"link.h",
"locale.h",
"mqueue.h",
"net/bpf.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
Expand Down Expand Up @@ -1206,8 +1208,10 @@ fn test_dragonflybsd(target: &str) {
"sys/ioctl.h",
"sys/ipc.h",
"sys/ktrace.h",
"sys/malloc.h",
"sys/mman.h",
"sys/mount.h",
"sys/procctl.h",
"sys/ptrace.h",
"sys/resource.h",
"sys/rtprio.h",
Expand All @@ -1219,6 +1223,7 @@ fn test_dragonflybsd(target: &str) {
"sys/sysctl.h",
"sys/time.h",
"sys/times.h",
"sys/timex.h",
"sys/types.h",
"sys/uio.h",
"sys/un.h",
Expand Down Expand Up @@ -1251,6 +1256,9 @@ fn test_dragonflybsd(target: &str) {

t if t.ends_with("_t") => t.to_string(),

// sigval is a struct in Rust, but a union in C:
"sigval" => format!("union sigval"),

// put `struct` in front of all structs:.
t if is_struct => format!("struct {}", t),

Expand Down Expand Up @@ -1284,9 +1292,6 @@ fn test_dragonflybsd(target: &str) {

cfg.skip_struct(move |ty| {
match ty {
// This is actually a union, not a struct
"sigval" => true,

// FIXME: These are tested as part of the linux_fcntl tests since
// there are header conflicts when including them with all the other
// structs.
Expand Down

0 comments on commit 4aaba6c

Please sign in to comment.