Skip to content

Commit 15085c2

Browse files
authored
Merge branch 'master' into relibc
2 parents 660a4fe + 1844a77 commit 15085c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5216
-859
lines changed

.travis.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ env:
2222
secure: "e2/3QjgRN9atOuSHp22TrYG7QVKcYUWY48Hi9b60w+r1+BhPkTseIJLte7WefRhdXtqpjjUJTooKDhnurFOeHaCT+nmBgiv+FPU893sBl4bhesY4m0vgUJVbNZcs6lTImYekWVb+aqjGdgV/XAgCw7c3kPmrZV0MzGDWL64Xaps="
2323
matrix:
2424
include:
25-
# 1.0.0 compat
25+
# 1.13.0 compat
2626
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
27-
rust: 1.0.0
27+
rust: 1.13.0
2828
script: rm -f Cargo.lock && cargo build
2929
install:
3030

@@ -38,10 +38,10 @@ matrix:
3838
- env: TARGET=i686-unknown-linux-gnu
3939
- os: osx
4040
env: TARGET=x86_64-apple-darwin NO_ADD=1
41-
osx_image: xcode8.3
41+
osx_image: xcode9.4
4242
- os: osx
4343
env: TARGET=i686-apple-darwin
44-
osx_image: xcode8.3
44+
osx_image: xcode9.4
4545
- env: TARGET=arm-linux-androideabi
4646
- env: TARGET=aarch64-linux-android
4747
# FIXME(#826) should reenable
@@ -56,14 +56,14 @@ matrix:
5656
# FIXME(#856)
5757
rust: 1.22.1
5858
- os: osx
59-
osx_image: xcode8.2
59+
osx_image: xcode9.4
6060
env: TARGET=i386-apple-ios
6161
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
6262
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
6363
before_install:
6464
rustc ./ci/ios/deploy_and_run_on_ios_simulator.rs -o $HOME/runtest
6565
- os: osx
66-
osx_image: xcode8.2
66+
osx_image: xcode9.4
6767
env: TARGET=x86_64-apple-ios
6868
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
6969
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
@@ -88,15 +88,15 @@ matrix:
8888
rust: beta
8989
- os: osx
9090
env: TARGET=x86_64-apple-darwin NO_ADD=1
91-
osx_image: xcode8.3
91+
osx_image: xcode9.4
9292
rust: beta
9393

9494
# nightly
9595
- env: TARGET=x86_64-unknown-linux-gnu NO_ADD=1
9696
rust: nightly
9797
- os: osx
9898
env: TARGET=x86_64-apple-darwin NO_ADD=1
99-
osx_image: xcode8.3
99+
osx_image: xcode9.4
100100
rust: nightly
101101
# not available on stable
102102
# without --release the build fails
@@ -106,6 +106,13 @@ matrix:
106106

107107
# QEMU based targets that compile in an emulator
108108
- env: TARGET=x86_64-unknown-freebsd
109+
allow_failures:
110+
- env: TARGET=i386-apple-ios
111+
CARGO_TARGET_I386_APPLE_IOS_RUNNER=$HOME/runtest
112+
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
113+
- env: TARGET=x86_64-apple-ios
114+
CARGO_TARGET_X86_64_APPLE_IOS_RUNNER=$HOME/runtest
115+
RUSTFLAGS=-Clink-arg=-mios-simulator-version-min=7.0
109116

110117
notifications:
111118
email:

Cargo.lock

Lines changed: 70 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "libc"
4-
version = "0.2.40"
4+
version = "0.2.43"
55
authors = ["The Rust Project Developers"]
66
license = "MIT/Apache-2.0"
77
readme = "README.md"
@@ -20,6 +20,7 @@ appveyor = { repository = "rust-lang/libc", project_name = "rust-lang-libs/libc"
2020
[features]
2121
default = ["use_std"]
2222
use_std = []
23+
align = []
2324

2425
[workspace]
2526
members = ["libc-test"]

README.md

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ various systems, including libc.
66

77
[![Build Status](https://travis-ci.org/rust-lang/libc.svg?branch=master)](https://travis-ci.org/rust-lang/libc)
88
[![Build status](https://ci.appveyor.com/api/projects/status/github/rust-lang/libc?svg=true)](https://ci.appveyor.com/project/rust-lang-libs/libc)
9+
[![Latest version](https://img.shields.io/crates/v/libc.svg)](https://crates.io/crates/libc)
10+
[![Documentation](https://docs.rs/libc/badge.svg)](https://docs.rs/libc)
11+
![License](https://img.shields.io/crates/l/libc.svg)
912

10-
[Documentation](#platforms-and-documentation)
1113

1214
## Usage
1315

@@ -33,6 +35,16 @@ this via:
3335
libc = { version = "0.2", default-features = false }
3436
```
3537

38+
By default libc uses private fields in structs in order to enforce a certain
39+
memory alignment on them. These structs can be hard to instantiate outside of
40+
libc. To make libc use `#[repr(align(x))]`, instead of the private fields,
41+
activate the *align* feature. This requires Rust 1.25 or newer:
42+
43+
```toml
44+
[dependencies]
45+
libc = { version = "0.2", features = ["align"] }
46+
```
47+
3648
## What is libc?
3749

3850
The primary purpose of this crate is to provide all of the definitions necessary
@@ -122,41 +134,41 @@ it. If you'd like to get a release out ASAP you can follow these steps:
122134
The following platforms are currently tested and have documentation available:
123135

124136
Tested:
125-
* [`i686-pc-windows-msvc`](https://doc.rust-lang.org/libc/i686-pc-windows-msvc/libc/)
126-
* [`x86_64-pc-windows-msvc`](https://doc.rust-lang.org/libc/x86_64-pc-windows-msvc/libc/)
137+
* [`i686-pc-windows-msvc`](https://rust-lang.github.io/libc/i686-pc-windows-msvc/libc/)
138+
* [`x86_64-pc-windows-msvc`](https://rust-lang.github.io/libc/x86_64-pc-windows-msvc/libc/)
127139
(Windows)
128-
* [`i686-pc-windows-gnu`](https://doc.rust-lang.org/libc/i686-pc-windows-gnu/libc/)
129-
* [`x86_64-pc-windows-gnu`](https://doc.rust-lang.org/libc/x86_64-pc-windows-gnu/libc/)
130-
* [`i686-apple-darwin`](https://doc.rust-lang.org/libc/i686-apple-darwin/libc/)
131-
* [`x86_64-apple-darwin`](https://doc.rust-lang.org/libc/x86_64-apple-darwin/libc/)
140+
* [`i686-pc-windows-gnu`](https://rust-lang.github.io/libc/i686-pc-windows-gnu/libc/)
141+
* [`x86_64-pc-windows-gnu`](https://rust-lang.github.io/libc/x86_64-pc-windows-gnu/libc/)
142+
* [`i686-apple-darwin`](https://rust-lang.github.io/libc/i686-apple-darwin/libc/)
143+
* [`x86_64-apple-darwin`](https://rust-lang.github.io/libc/x86_64-apple-darwin/libc/)
132144
(OSX)
133145
* `i386-apple-ios`
134146
* `x86_64-apple-ios`
135-
* [`i686-unknown-linux-gnu`](https://doc.rust-lang.org/libc/i686-unknown-linux-gnu/libc/)
136-
* [`x86_64-unknown-linux-gnu`](https://doc.rust-lang.org/libc/x86_64-unknown-linux-gnu/libc/)
147+
* [`i686-unknown-linux-gnu`](https://rust-lang.github.io/libc/i686-unknown-linux-gnu/libc/)
148+
* [`x86_64-unknown-linux-gnu`](https://rust-lang.github.io/libc/x86_64-unknown-linux-gnu/libc/)
137149
(Linux)
138-
* [`x86_64-unknown-linux-musl`](https://doc.rust-lang.org/libc/x86_64-unknown-linux-musl/libc/)
150+
* [`x86_64-unknown-linux-musl`](https://rust-lang.github.io/libc/x86_64-unknown-linux-musl/libc/)
139151
(Linux MUSL)
140-
* [`aarch64-unknown-linux-gnu`](https://doc.rust-lang.org/libc/aarch64-unknown-linux-gnu/libc/)
152+
* [`aarch64-unknown-linux-gnu`](https://rust-lang.github.io/libc/aarch64-unknown-linux-gnu/libc/)
141153
(Linux)
142154
* `aarch64-unknown-linux-musl`
143155
(Linux MUSL)
144-
* [`sparc64-unknown-linux-gnu`](https://doc.rust-lang.org/libc/sparc64-unknown-linux-gnu/libc/)
156+
* [`sparc64-unknown-linux-gnu`](https://rust-lang.github.io/libc/sparc64-unknown-linux-gnu/libc/)
145157
(Linux)
146-
* [`mips-unknown-linux-gnu`](https://doc.rust-lang.org/libc/mips-unknown-linux-gnu/libc/)
147-
* [`arm-unknown-linux-gnueabihf`](https://doc.rust-lang.org/libc/arm-unknown-linux-gnueabihf/libc/)
148-
* [`arm-linux-androideabi`](https://doc.rust-lang.org/libc/arm-linux-androideabi/libc/)
158+
* [`mips-unknown-linux-gnu`](https://rust-lang.github.io/libc/mips-unknown-linux-gnu/libc/)
159+
* [`arm-unknown-linux-gnueabihf`](https://rust-lang.github.io/libc/arm-unknown-linux-gnueabihf/libc/)
160+
* [`arm-linux-androideabi`](https://rust-lang.github.io/libc/arm-linux-androideabi/libc/)
149161
(Android)
150-
* [`x86_64-unknown-freebsd`](https://doc.rust-lang.org/libc/x86_64-unknown-freebsd/libc/)
151-
* [`x86_64-unknown-openbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-openbsd/libc/)
152-
* [`x86_64-rumprun-netbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-netbsd/libc/)
162+
* [`x86_64-unknown-freebsd`](https://rust-lang.github.io/libc/x86_64-unknown-freebsd/libc/)
163+
* [`x86_64-unknown-openbsd`](https://rust-lang.github.io/libc/x86_64-unknown-openbsd/libc/)
164+
* [`x86_64-rumprun-netbsd`](https://rust-lang.github.io/libc/x86_64-unknown-netbsd/libc/)
153165

154166
The following may be supported, but are not guaranteed to always work:
155167

156168
* `i686-unknown-freebsd`
157-
* [`x86_64-unknown-bitrig`](https://doc.rust-lang.org/libc/x86_64-unknown-bitrig/libc/)
158-
* [`x86_64-unknown-dragonfly`](https://doc.rust-lang.org/libc/x86_64-unknown-dragonfly/libc/)
169+
* [`x86_64-unknown-bitrig`](https://rust-lang.github.io/libc/x86_64-unknown-bitrig/libc/)
170+
* [`x86_64-unknown-dragonfly`](https://rust-lang.github.io/libc/x86_64-unknown-dragonfly/libc/)
159171
* `i686-unknown-haiku`
160172
* `x86_64-unknown-haiku`
161-
* [`x86_64-unknown-netbsd`](https://doc.rust-lang.org/libc/x86_64-unknown-netbsd/libc/)
162-
* [`x86_64-sun-solaris`](https://doc.rust-lang.org/libc/x86_64-sun-solaris/libc/)
173+
* [`x86_64-unknown-netbsd`](https://rust-lang.github.io/libc/x86_64-unknown-netbsd/libc/)
174+
* [`x86_64-sun-solaris`](https://rust-lang.github.io/libc/x86_64-sun-solaris/libc/)

ci/docker/aarch64-unknown-linux-musl/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ FROM ubuntu:17.10
33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
gcc make libc6-dev git curl ca-certificates \
55
gcc-aarch64-linux-gnu qemu-user
6-
RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | \
6+
RUN curl https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
77
tar xzf - && \
8-
cd musl-1.1.16 && \
8+
cd musl-1.1.19 && \
99
CC=aarch64-linux-gnu-gcc \
1010
./configure --prefix=/musl-aarch64 --enable-wrapper=yes && \
1111
make install -j4 && \
1212
cd .. && \
13-
rm -rf musl-1.1.16 && \
13+
rm -rf musl-1.1.19
1414
# Install linux kernel headers sanitized for use with musl
15-
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
15+
RUN curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
1616
tar xzf - && \
17-
cd kernel-headers-3.12.6-5 && \
17+
cd kernel-headers-3.12.6-6 && \
1818
make ARCH=arm64 prefix=/musl-aarch64 install -j4 && \
1919
cd .. && \
20-
rm -rf kernel-headers-3.12.6-5
20+
rm -rf kernel-headers-3.12.6-6
2121

2222
# FIXME: shouldn't need the `-lgcc` here, shouldn't that be in libstd?
2323
ENV PATH=$PATH:/musl-aarch64/bin:/rust/bin \

ci/docker/arm-unknown-linux-musleabihf/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
44
gcc make libc6-dev git curl ca-certificates \
55
gcc-arm-linux-gnueabihf qemu-user
66

7-
RUN curl https://www.musl-libc.org/releases/musl-1.1.16.tar.gz | tar xzf -
8-
WORKDIR /musl-1.1.16
7+
RUN curl https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | tar xzf -
8+
WORKDIR /musl-1.1.19
99
RUN CC=arm-linux-gnueabihf-gcc \
1010
CFLAGS="-march=armv6 -marm" \
1111
./configure --prefix=/musl-arm --enable-wrapper=yes
1212
RUN make install -j4
1313

1414
# Install linux kernel headers sanitized for use with musl
15-
RUN \
16-
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
15+
RUN curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
1716
tar xzf - && \
18-
cd kernel-headers-3.12.6-5 && \
17+
cd kernel-headers-3.12.6-6 && \
1918
make ARCH=arm prefix=/musl-arm install -j4 && \
2019
cd .. && \
21-
rm -rf kernel-headers-3.12.6-5
20+
rm -rf kernel-headers-3.12.6-6
21+
2222
ENV PATH=$PATH:/musl-arm/bin:/rust/bin \
2323
CC_arm_unknown_linux_musleabihf=musl-gcc \
2424
CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \

ci/docker/i686-unknown-linux-musl/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ RUN apt-get install -y --no-install-recommends \
1212
# since otherwise the script will fail to find a compiler.
1313
# * We manually unset CROSS_COMPILE when running make; otherwise the makefile
1414
# will call the non-existent binary 'i686-ar'.
15-
RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
15+
RUN curl https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
1616
tar xzf - && \
17-
cd musl-1.1.15 && \
17+
cd musl-1.1.19 && \
1818
CC=gcc CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
1919
make CROSS_COMPILE= install -j4 && \
2020
cd .. && \
21-
rm -rf musl-1.1.15 && \
21+
rm -rf musl-1.1.19
2222
# Install linux kernel headers sanitized for use with musl
23-
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
23+
RUN curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
2424
tar xzf - && \
25-
cd kernel-headers-3.12.6-5 && \
25+
cd kernel-headers-3.12.6-6 && \
2626
make ARCH=i386 prefix=/musl-i686 install -j4 && \
2727
cd .. && \
28-
rm -rf kernel-headers-3.12.6-5
28+
rm -rf kernel-headers-3.12.6-6
29+
2930
ENV PATH=$PATH:/musl-i686/bin:/rust/bin \
3031
CC_i686_unknown_linux_musl=musl-gcc

ci/docker/sparc64-unknown-linux-gnu/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
55
gcc libc6-dev \
66
gcc-sparc64-linux-gnu libc6-dev-sparc64-cross \
77
qemu-system-sparc64 openbios-sparc seabios ipxe-qemu \
8-
p7zip-full cpio
8+
p7zip-full cpio linux-libc-dev-sparc64-cross linux-headers-4.9.0-3-common
9+
10+
# Put linux/module.h into the right spot as it is not shipped by debian
11+
RUN cp /usr/src/linux-headers-4.9.0-3-common/include/uapi/linux/module.h /usr/sparc64-linux-gnu/include/linux/
912

1013
COPY linux-sparc64.sh /
1114
RUN bash /linux-sparc64.sh

ci/docker/x86_64-unknown-linux-musl/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ FROM ubuntu:17.10
33
RUN apt-get update
44
RUN apt-get install -y --no-install-recommends \
55
gcc make libc6-dev git curl ca-certificates
6-
RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
6+
RUN curl https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
77
tar xzf - && \
8-
cd musl-1.1.15 && \
8+
cd musl-1.1.19 && \
99
./configure --prefix=/musl-x86_64 && \
1010
make install -j4 && \
1111
cd .. && \
12-
rm -rf musl-1.1.15 && \
12+
rm -rf musl-1.1.19
1313
# Install linux kernel headers sanitized for use with musl
14-
curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-5.tar.gz | \
14+
RUN curl -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
1515
tar xzf - && \
16-
cd kernel-headers-3.12.6-5 && \
16+
cd kernel-headers-3.12.6-6 && \
1717
make ARCH=x86_64 prefix=/musl-x86_64 install -j4 && \
1818
cd .. && \
19-
rm -rf kernel-headers-3.12.6-5
19+
rm -rf kernel-headers-3.12.6-6
2020
ENV PATH=$PATH:/musl-x86_64/bin:/rust/bin

ci/ios/deploy_and_run_on_ios_simulator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ fn run_app_on_simulator() {
123123
.arg("com.rust.unittests")
124124
.output());
125125

126+
println!("status: {}", output.status);
126127
println!("stdout --\n{}\n", String::from_utf8_lossy(&output.stdout));
127128
println!("stderr --\n{}\n", String::from_utf8_lossy(&output.stderr));
128129

0 commit comments

Comments
 (0)