Skip to content

Commit 8a2aedc

Browse files
authored
Rollup merge of #97813 - antoyo:sync_from_cg_gcc, r=petrochenkov
Sync rustc_codegen_gcc
2 parents 07f1c16 + 80cbaa3 commit 8a2aedc

Some content is hidden

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

41 files changed

+7956
-618
lines changed

compiler/rustc_codegen_gcc/.github/workflows/ci.yml

+23-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so"]
14+
libgccjit_version: ["libgccjit.so", "libgccjit_without_int128.so", "libgccjit12.so"]
1515

1616
steps:
1717
- uses: actions/checkout@v2
@@ -78,12 +78,21 @@ jobs:
7878
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain') }}
7979

8080
- name: Build
81+
if: matrix.libgccjit_version != 'libgccjit12.so'
8182
run: |
8283
./prepare_build.sh
8384
./build.sh
8485
cargo test
8586
./clean_all.sh
8687
88+
- name: Build
89+
if: matrix.libgccjit_version == 'libgccjit12.so'
90+
run: |
91+
./prepare_build.sh
92+
./build.sh --no-default-features
93+
cargo test --no-default-features
94+
./clean_all.sh
95+
8796
- name: Prepare dependencies
8897
run: |
8998
git config --global user.email "user@example.com"
@@ -98,6 +107,7 @@ jobs:
98107
args: --release
99108

100109
- name: Test
110+
if: matrix.libgccjit_version != 'libgccjit12.so'
101111
run: |
102112
# Enable backtraces for easier debugging
103113
export RUST_BACKTRACE=1
@@ -107,3 +117,15 @@ jobs:
107117
export RUN_RUNS=2
108118
109119
./test.sh --release
120+
121+
- name: Test
122+
if: matrix.libgccjit_version == 'libgccjit12.so'
123+
run: |
124+
# Enable backtraces for easier debugging
125+
export RUST_BACKTRACE=1
126+
127+
# Reduce amount of benchmark runs as they are slow
128+
export COMPILE_RUNS=2
129+
export RUN_RUNS=2
130+
131+
./test.sh --release --no-default-features

compiler/rustc_codegen_gcc/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ perf.data.old
1313
/rust
1414
/simple-raytracer
1515
/regex
16+
/rand
1617
gimple*
1718
*asm
1819
res
1920
test-backend
2021
gcc_path
2122
benchmarks
23+
tools/llvm-project
24+
tools/llvmint
25+
tools/llvmint-2
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
disable_all_formatting = true

compiler/rustc_codegen_gcc/Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ dependencies = [
4141
[[package]]
4242
name = "gccjit"
4343
version = "1.0.0"
44-
source = "git+https://github.com/antoyo/gccjit.rs#bdecdecfb8a02ec861a39a350f990faa33bd31c3"
44+
source = "git+https://github.com/antoyo/gccjit.rs#bdb86fb5092895ff5589726b33250010c64d93f6"
4545
dependencies = [
4646
"gccjit_sys",
4747
]
4848

4949
[[package]]
5050
name = "gccjit_sys"
5151
version = "0.0.1"
52-
source = "git+https://github.com/antoyo/gccjit.rs#bdecdecfb8a02ec861a39a350f990faa33bd31c3"
52+
source = "git+https://github.com/antoyo/gccjit.rs#bdb86fb5092895ff5589726b33250010c64d93f6"
5353
dependencies = [
5454
"libc 0.1.12",
5555
]

compiler/rustc_codegen_gcc/Cargo.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,17 @@ license = "MIT OR Apache-2.0"
99
crate-type = ["dylib"]
1010

1111
[[test]]
12-
name = "lang_tests"
13-
path = "tests/lib.rs"
12+
name = "lang_tests_debug"
13+
path = "tests/lang_tests_debug.rs"
1414
harness = false
15+
[[test]]
16+
name = "lang_tests_release"
17+
path = "tests/lang_tests_release.rs"
18+
harness = false
19+
20+
[features]
21+
default = ["master"]
22+
master = ["gccjit/master"]
1523

1624
[dependencies]
1725
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }

compiler/rustc_codegen_gcc/build.sh

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
#set -x
44
set -e
55

66
codegen_channel=debug
77
sysroot_channel=debug
88

9+
flags=
10+
911
while [[ $# -gt 0 ]]; do
1012
case $1 in
1113
--release)
@@ -16,6 +18,15 @@ while [[ $# -gt 0 ]]; do
1618
sysroot_channel=release
1719
shift
1820
;;
21+
--no-default-features)
22+
flags="$flags --no-default-features"
23+
shift
24+
;;
25+
--features)
26+
shift
27+
flags="$flags --features $1"
28+
shift
29+
;;
1930
*)
2031
echo "Unknown option $1"
2132
exit 1
@@ -33,21 +44,13 @@ fi
3344
export LD_LIBRARY_PATH="$GCC_PATH"
3445
export LIBRARY_PATH="$GCC_PATH"
3546

36-
features=
37-
38-
if [[ "$1" == "--features" ]]; then
39-
shift
40-
features="--features $1"
41-
shift
42-
fi
43-
4447
if [[ "$codegen_channel" == "release" ]]; then
4548
export CHANNEL='release'
46-
CARGO_INCREMENTAL=1 cargo rustc --release $features
49+
CARGO_INCREMENTAL=1 cargo rustc --release $flags
4750
else
4851
echo $LD_LIBRARY_PATH
4952
export CHANNEL='debug'
50-
cargo rustc $features
53+
cargo rustc $flags
5154
fi
5255

5356
source config.sh

compiler/rustc_codegen_gcc/build_sysroot/build_sysroot.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Requires the CHANNEL env var to be set to `debug` or `release.`
44

compiler/rustc_codegen_gcc/build_sysroot/prepare_sysroot_src.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33
cd $(dirname "$0")
44

compiler/rustc_codegen_gcc/cargo.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
if [ -z $CHANNEL ]; then
44
export CHANNEL='debug'
@@ -20,4 +20,4 @@ fi
2020
cmd=$1
2121
shift
2222

23-
RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd --target $TARGET_TRIPLE $@
23+
RUSTDOCFLAGS="$RUSTFLAGS" cargo +${TOOLCHAIN} $cmd $@
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#!/bin/bash --verbose
1+
#!/usr/bin/env bash
22
set -e
3+
set -v
34

45
rm -rf target/ build_sysroot/{sysroot/,sysroot_src/,target/,Cargo.lock} perf.data{,.old}
56
rm -rf regex/ simple-raytracer/

compiler/rustc_codegen_gcc/config.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set -e
22

33
export CARGO_INCREMENTAL=0
44

5-
if [ -f ./gcc_path ]; then
5+
if [ -f ./gcc_path ]; then
66
export GCC_PATH=$(cat gcc_path)
77
else
88
echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
@@ -38,7 +38,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
3838
fi
3939
fi
4040

41-
export RUSTFLAGS="$linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
41+
export RUSTFLAGS="$CG_RUSTFLAGS $linker -Cpanic=abort -Csymbol-mangling-version=v0 -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
4242

4343
# FIXME(antoyo): remove once the atomic shim is gone
4444
if [[ `uname` == 'Darwin' ]]; then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
From a8fb97120d71252538b6b026695df40d02696bdb Mon Sep 17 00:00:00 2001
2+
From: bjorn3 <bjorn3@users.noreply.github.com>
3+
Date: Sat, 15 Aug 2020 20:04:38 +0200
4+
Subject: [PATCH] [rand] Disable failing test
5+
6+
---
7+
src/distributions/uniform.rs | 3 ++-
8+
1 file changed, 2 insertions(+), 1 deletion(-)
9+
10+
diff --git a/src/distributions/uniform.rs b/src/distributions/uniform.rs
11+
index 480b859..c80bb6f 100644
12+
--- a/src/distributions/uniform.rs
13+
+++ b/src/distributions/uniform.rs
14+
@@ -1085,7 +1085,7 @@ mod tests {
15+
_ => panic!("`UniformDurationMode` was not serialized/deserialized correctly")
16+
}
17+
}
18+
-
19+
+
20+
#[test]
21+
#[cfg(feature = "serde1")]
22+
fn test_uniform_serialization() {
23+
@@ -1314,6 +1314,7 @@ mod tests {
24+
not(target_arch = "wasm32"),
25+
not(target_arch = "asmjs")
26+
))]
27+
+ #[ignore] // FIXME
28+
fn test_float_assertions() {
29+
use super::SampleUniform;
30+
use std::panic::catch_unwind;
31+
--
32+
2.20.1

0 commit comments

Comments
 (0)