Commit Graph

21 Commits

Author SHA1 Message Date
Yuki Okushi 3fae7e9ce7 Fix style 2021-04-06 10:10:29 +09:00
Yuki Okushi 45e1681d90 Specify `cargo:rerun-if-changed=build.rs` to avoid re-building 2021-04-05 03:23:02 +09:00
Alexander Batischev 3e4d684dcd
Add bindings for iconv calls
FreeBSD-likes all implement iconv:
- DragonflyBSD: bbb35c81f7/include/iconv.h
- FreeBSD: a6dc68c0e0/include/iconv.h

NetBSD-likes:
- NetBSD: 81a39f6087/include/iconv.h
- OpenBSD doesn't implement it

macOS: apparently ships a conforming implementation as a separate
library:
https://stackoverflow.com/questions/57734434/libiconv-or-iconv-undefined-symbol-on-mac-osx/57734435#57734435

Linux:
- glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=iconv/iconv.h;h=fdddf53d99c3046ef9c280db01a425c2f499043e;hb=HEAD
- musl: https://git.musl-libc.org/cgit/musl/tree/include/iconv.h?id=455f96857f91d14e193219ca00969354a981c09c
2021-02-11 01:22:49 +03:00
Dark Kirb e9a1268320 Add DevkitPPC support
DevkitPPC does not support unix sockets natively, meaning that bindings
to these functions was removed for powerpc targets with "nintendo" as
vendor.

Suggested target json files:

Nintendo Gamecube:
```
{
  "arch": "powerpc",
  "data-layout": "E-m:e-p:32:32-i64:64-n32",
  "dynamic-linking": false,
  "env": "newlib",
  "executables": true,
  "has-elf-tls": false,
  "has-rpath": true,
  "linker-flavor": "gcc",
  "llvm-target": "powerpc-eabi",
  "max-atomic-width": 32,
  "os": "dolphin",
  "target-c-int-width": "32",
  "target-endian": "big",
  "target-family": "unix",
  "target-mcount": "_mcount",
  "target-pointer-width": "32",
  "vendor": "nintendo"
}
```

Nintendo Wii:
```
{
  "arch": "powerpc",
  "data-layout": "E-m:e-p:32:32-i64:64-n32",
  "dynamic-linking": false,
  "env": "newlib",
  "executables": true,
  "has-elf-tls": false,
  "has-rpath": true,
  "linker-flavor": "gcc",
  "llvm-target": "powerpc-eabi",
  "max-atomic-width": 32,
  "os": "revolution",
  "target-c-int-width": "32",
  "target-endian": "big",
  "target-family": "unix",
  "target-mcount": "_mcount",
  "target-pointer-width": "32",
  "vendor": "nintendo"
}
```
2020-08-05 08:19:48 +01:00
Aaron Hill f10ee11f70
Fix build.rs failing with a rustc built from a tarball
Fixes #1601
2019-11-20 13:08:27 -05:00
Aaron Hill ca2d53e281
Run 'cargo fmt' 2019-10-29 09:51:44 -04:00
Aaron Hill 476b675976
Panic if const-extern-fn is not used on nightly 2019-10-29 08:25:59 -04:00
Aaron Hill b0ba2de767
Add Linux test 2019-10-28 21:10:03 -04:00
gnzlbg 3843c7dba1 Add FreeBSD10 support
This adds libc-test support for Freebsd10 and a CI build job that tests
FreeBSD10 with LIBC_CI only.
2019-09-16 20:50:55 +02:00
gnzlbg 3241ec5808 Do not deny warnings by default.
libc currently denies all warnings by default. This commit denies
warnings only when libc is built in CI.
2019-08-16 15:47:00 +02:00
gnzlbg f0816947c9 Always pass freebsd11 - otherwise cross-compiling to FreeBSD fails 2019-08-15 06:55:13 +02:00
gnzlbg 4f1966f5c5 Fix FreeBSD build 2019-08-14 07:30:15 +02:00
Luca Pizzamiglio 64bc745405 Properly define freebsd11 attribute 2019-07-28 23:00:53 +02:00
Luca Pizzamiglio 4a74f1e0df Add support for FreeBSD CURRENT (aka freebsd13)
Currently, libc supports and detects freebsd11 and freebsd13
Unknown versions, like freebsd13, is treated as freebsd11.
This patch solve the issues, detecting freebsd13 and treating it like
freebsd12.
Inverting the logic not(freebsd12) -> freebsd11 where possible
2019-07-28 23:00:53 +02:00
Joe Richey df34d17bd9 Remove use of `unstable` feature 2019-07-14 22:10:05 -07:00
Joe Richey 3fa021d7ab Add libc_thread_local cfg and unstable feature 2019-07-10 19:47:40 -07:00
gnzlbg 7437d0a6f1 Add a FreeBSD 12 build job and test FreeBSD12 APIs
This commits adds a second FreeBSD 12 build job,
and splits the implementation of the FreeBSD module
into two modules, one for FreeBSD 11, and one for FreeBSD 12.

The FreeBSD 11 module is compiled always by default, and is
mostly forward compatible with FreeBSD 12 systems.

The FreeBSD 12 module is only built for now in libc's CI,
and uses FreeBSD 12 data types and APIs, linking to symbols
that are only available in FreeBSD 12.

Basically, when LIBC_CI env variable is defined, and the host
system is a FreeBSD 12 system, then the FreeBSD 12 module is
automatically built and tested. Conditional compilation is done
using a `cfg(freebsd12)` flag.

This commit also re-enables many tests, and documents why
some remain disabled.
2019-05-24 20:04:17 +02:00
gnzlbg 4ac26afa83 Deprecate `use_std` cargo feature: use `std` instead .
Related to #657 .
2019-05-24 13:22:03 +02:00
gnzlbg a17a91cdbf Fix build on all platforms
This PR fixes the build on all platforms and all Rust version down to the
minimum Rust version supported by libc: Rust 1.13.0.

The `build.rs` is extended with logic to detect the newer Rust features used by
`libc` since Rust 1.13.0:

* Rust 1.19.0: `untagged_unions`. APIs using untagged unions are gated on
  `cfg(libc_unions)` and not available on older Rust versions.

* Rust 1.25.0: `repr(align)`. Because `repr(align)` cannot be parsed by older
  Rust versions, all uses of `repr(align)` are split into `align.rs` and
  `no_align.rs` modules, which are gated on the `cfg(libc_align)` at the top
  level. These modules sometimes contain macros that are expanded at the top
  level to avoid privacy issues (`pub(crate)` is not available in older Rust
  versions). Closes #1242 .

* Rust : `const` `mem::size_of`. These uses are worked around with hardcoded
  constants on older Rust versions.

Also, `repr(packed)` structs cannot automatically `derive()` some traits like
`Debug`. These have been moved into `s_no_extra_traits!` and the lint of missing
`Debug` implementations on public items is silenced for these. We can manually
implement the `extra_traits` for these in a follow up PR. This is tracked
in #1243. Also, `extra_traits` does not enable `align` manually anymore.

Since `f64::to_bits` is not available in older Rust versions, its usage
has been replaced with a `transmute` to an `u64` which is what that method
does under the hood.

Closes #1232 .
2019-02-07 13:44:32 +01:00
Mike Hommey fdb9726d42 core::ffi::c_void is available since rustc 1.30 2018-11-21 16:43:24 +09:00
Isaac Woods 79c80c4ec4
Re-export core::ffi::c_void if supported 2018-09-18 19:50:36 +01:00