Skip to content

Commit df48731

Browse files
committed
Merge commit '48d60ab7c505c6c1ebb042eacaafd8dc9f7a9267' into libgccjit-codegen
2 parents 87f8525 + 48d60ab commit df48731

File tree

24 files changed

+735
-348
lines changed

24 files changed

+735
-348
lines changed

compiler/rustc_codegen_gcc/.github/FUNDING.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

compiler/rustc_codegen_gcc/.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131
ln gcc-build/libgccjit.so gcc-build/libgccjit.so.0
3232
3333
- name: Set LIBRARY_PATH
34-
run: echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
34+
run: |
35+
echo "LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
36+
echo "LD_LIBRARY_PATH=$(cat gcc_path)" >> $GITHUB_ENV
3537
3638
# https://github.com/actions/cache/issues/133
3739
- name: Fixup owner of ~/.cargo/
@@ -66,6 +68,7 @@ jobs:
6668
run: |
6769
./prepare_build.sh
6870
./build.sh
71+
cargo test
6972
./clean_all.sh
7073
7174
- name: Prepare dependencies

compiler/rustc_codegen_gcc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ perf.data.old
77
*.events
88
*.string*
99
/build_sysroot/sysroot
10+
/build_sysroot/sysroot_src
1011
/build_sysroot/Cargo.lock
1112
/build_sysroot/test_target/Cargo.lock
1213
/rust
14+
/simple-raytracer
1315
/regex
1416
gimple*
1517
*asm
1618
res
1719
test-backend
20+
gcc_path

compiler/rustc_codegen_gcc/Cargo.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ dependencies = [
5656
[[package]]
5757
name = "gccjit"
5858
version = "1.0.0"
59-
source = "git+https://github.com/antoyo/gccjit.rs#0572117c7ffdfcb0e6c6526d45266c3f34796bea"
59+
source = "git+https://github.com/antoyo/gccjit.rs#54be27e41fff7b6ab532e2e21a82df50a12b9ad3"
6060
dependencies = [
6161
"gccjit_sys",
6262
]
6363

6464
[[package]]
6565
name = "gccjit_sys"
6666
version = "0.0.1"
67-
source = "git+https://github.com/antoyo/gccjit.rs#0572117c7ffdfcb0e6c6526d45266c3f34796bea"
67+
source = "git+https://github.com/antoyo/gccjit.rs#54be27e41fff7b6ab532e2e21a82df50a12b9ad3"
6868
dependencies = [
6969
"libc 0.1.12",
7070
]

compiler/rustc_codegen_gcc/Readme.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can also use my [fork of gcc](https://github.com/antoyo/gcc) which already i
1919
**Put the path to your custom build of libgccjit in the file `gcc_path`.**
2020

2121
```bash
22-
$ git clone https://github.com/antoyo/rustc_codegen_gcc.git
22+
$ git clone https://github.com/rust-lang/rustc_codegen_gcc.git
2323
$ cd rustc_codegen_gcc
2424
$ ./prepare_build.sh # download and patch sysroot src
2525
$ ./build.sh --release
@@ -113,6 +113,5 @@ p loc->m_line
113113
114114
### How to use a custom-build rustc
115115
116-
* Build the stage1 compiler (`rustup toolchain link debug-current stage2 build/x86_64-unknown-linux-gnu/stage1`).
116+
* Build the stage2 compiler (`rustup toolchain link debug-current build/x86_64-unknown-linux-gnu/stage2`).
117117
* Clean and rebuild the codegen with `debug-current` in the file `rust-toolchain`.
118-
* Add `~/.rustup/toolchains/debug-current/lib/rustlib/x86_64-unknown-linux-gnu/lib` to `LD_LIBRARY_PATH`.

compiler/rustc_codegen_gcc/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
#set -x
44
set -e
55

6-
export GCC_PATH=$(cat gcc_path)
6+
if [ -f ./gcc_path ]; then
7+
export GCC_PATH=$(cat gcc_path)
8+
else
9+
echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
10+
exit 1
11+
fi
712

813
export LD_LIBRARY_PATH="$GCC_PATH"
914
export LIBRARY_PATH="$GCC_PATH"

compiler/rustc_codegen_gcc/cargo.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 --target $TARGET_TRIPLE $@

compiler/rustc_codegen_gcc/config.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ set -e
22

33
export CARGO_INCREMENTAL=0
44

5-
export GCC_PATH=$(cat gcc_path)
5+
if [ -f ./gcc_path ]; then
6+
export GCC_PATH=$(cat gcc_path)
7+
else
8+
echo 'Please put the path to your custom build of libgccjit in the file `gcc_path`, see Readme.md for details'
9+
exit 1
10+
fi
611

712
unamestr=`uname`
813
if [[ "$unamestr" == 'Linux' ]]; then
@@ -30,7 +35,7 @@ if [[ "$HOST_TRIPLE" != "$TARGET_TRIPLE" ]]; then
3035
fi
3136
fi
3237

33-
export RUSTFLAGS=$linker' -Cpanic=abort -Cdebuginfo=2 -Zpanic-abort-tests -Zcodegen-backend='$(pwd)'/target/'$CHANNEL'/librustc_codegen_gcc.'$dylib_ext' --sysroot '$(pwd)'/build_sysroot/sysroot'
38+
export RUSTFLAGS="$linker -Cpanic=abort -Cdebuginfo=2 -Clto=off -Zpanic-abort-tests -Zcodegen-backend=$(pwd)/target/${CHANNEL:-debug}/librustc_codegen_gcc.$dylib_ext --sysroot $(pwd)/build_sysroot/sysroot"
3439

3540
# FIXME(antoyo): remove once the atomic shim is gone
3641
if [[ `uname` == 'Darwin' ]]; then

compiler/rustc_codegen_gcc/gcc_path

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2021-08-12
1+
nightly-2021-09-17

0 commit comments

Comments
 (0)