Skip to content

Commit 8877ec1

Browse files
committed
replace config.toml to bootstrap.toml in compiler:cg_gcc submodule
1 parent 7705a88 commit 8877ec1

File tree

15 files changed

+30
-21
lines changed

15 files changed

+30
-21
lines changed

compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ git submodule update --quiet --init src/tools/cargo library/backtrace library/st
2222
git -c user.name=Dummy -c [email protected] -c commit.gpgSign=false \
2323
am ../patches/*-stdlib-*.patch
2424

25-
cat > config.toml <<EOF
25+
cat > bootstrap.toml <<EOF
2626
change-id = 999999
2727
2828
[llvm]

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup path to libgccjit
5858
run: |
5959
sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}
60-
echo 'gcc-path = "/usr/lib/"' > config.toml
60+
echo 'gcc-path = "/usr/lib/"' > bootstrap.toml
6161
6262
- name: Set env
6363
run: |

compiler/rustc_codegen_gcc/.github/workflows/failures.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Setup path to libgccjit
5151
if: matrix.libgccjit_version.gcc == 'libgccjit12.so'
5252
run: |
53-
echo 'gcc-path = "/usr/lib/gcc/x86_64-linux-gnu/12"' > config.toml
53+
echo 'gcc-path = "/usr/lib/gcc/x86_64-linux-gnu/12"' > bootstrap.toml
5454
echo "LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12" >> $GITHUB_ENV
5555
echo "LD_LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12" >> $GITHUB_ENV
5656
@@ -62,7 +62,7 @@ jobs:
6262
if: matrix.libgccjit_version.gcc != 'libgccjit12.so'
6363
run: |
6464
sudo dpkg --force-overwrite -i gcc-15.deb
65-
echo 'gcc-path = "/usr/lib"' > config.toml
65+
echo 'gcc-path = "/usr/lib"' > bootstrap.toml
6666
echo "LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
6767
echo "LD_LIBRARY_PATH=/usr/lib" >> $GITHUB_ENV
6868

compiler/rustc_codegen_gcc/.github/workflows/gcc12.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: sudo apt-get install ninja-build ripgrep llvm-14-tools libgccjit-12-dev
4848

4949
- name: Setup path to libgccjit
50-
run: echo 'gcc-path = "/usr/lib/gcc/x86_64-linux-gnu/12"' > config.toml
50+
run: echo 'gcc-path = "/usr/lib/gcc/x86_64-linux-gnu/12"' > bootstrap.toml
5151

5252
- name: Set env
5353
run: |

compiler/rustc_codegen_gcc/.github/workflows/m68k.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Setup path to libgccjit
5959
run: |
6060
sudo dpkg -i gcc-m68k-15.deb
61-
echo 'gcc-path = "/usr/lib/"' > config.toml
61+
echo 'gcc-path = "/usr/lib/"' > bootstrap.toml
6262
6363
- name: Set env
6464
run: |

compiler/rustc_codegen_gcc/.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Setup path to libgccjit
4343
run: |
4444
sudo dpkg --force-overwrite -i gcc-15.deb
45-
echo 'gcc-path = "/usr/lib/"' > config.toml
45+
echo 'gcc-path = "/usr/lib/"' > bootstrap.toml
4646
4747
- name: Set env
4848
run: |

compiler/rustc_codegen_gcc/.github/workflows/stdarch.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Set env
6161
run: |
6262
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
63-
echo 'download-gccjit = true' > config.toml
63+
echo 'download-gccjit = true' > bootstrap.toml
6464
6565
- name: Build
6666
run: |

compiler/rustc_codegen_gcc/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ tools/llvmint-2
1919
llvm
2020
build_system/target
2121
config.toml
22+
bootstrap.toml
2223
build

compiler/rustc_codegen_gcc/.ignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
!*asm*
1010
!.github
1111
!config.toml
12+
!bootstrap.toml

compiler/rustc_codegen_gcc/Readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A secondary goal is to check if using the gcc backend will provide any run-time
2626
You need to use my [fork of gcc](https://github.com/antoyo/gcc) which already includes these patches.**
2727

2828
```bash
29-
$ cp config.example.toml config.toml
29+
$ cp bootstrap.example.toml bootstrap.toml
3030
```
3131

3232
If don't need to test GCC patches you wrote in our GCC fork, then the default configuration should
@@ -69,9 +69,9 @@ $ make check-jit
6969
$ make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc"
7070
```
7171

72-
**Put the path to your custom build of libgccjit in the file `config.toml`.**
72+
**Put the path to your custom build of libgccjit in the file `bootstrap.toml`.**
7373

74-
You now need to set the `gcc-path` value in `config.toml` with the result of this command:
74+
You now need to set the `gcc-path` value in `bootstrap.toml` with the result of this command:
7575

7676
```bash
7777
$ dirname $(readlink -f `find . -name libgccjit.so`)

compiler/rustc_codegen_gcc/build_system/src/config.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ pub struct ConfigInfo {
116116
config_file: Option<String>,
117117
// This is used in particular in rust compiler bootstrap because it doesn't run at the root
118118
// of the `cg_gcc` folder, making it complicated for us to get access to local files we need
119-
// like `libgccjit.version` or `config.toml`.
119+
// like `libgccjit.version` or `bootstrap.toml`.
120120
cg_gcc_path: Option<PathBuf>,
121121
// Needed for the `info` command which doesn't want to actually download the lib if needed,
122122
// just to set the `gcc_path` field to display it.
@@ -282,7 +282,7 @@ impl ConfigInfo {
282282
}
283283

284284
pub fn setup_gcc_path(&mut self) -> Result<(), String> {
285-
// If the user used the `--gcc-path` option, no need to look at `config.toml` content
285+
// If the user used the `--gcc-path` option, no need to look at `bootstrap.toml` content
286286
// since we already have everything we need.
287287
if let Some(gcc_path) = &self.gcc_path {
288288
println!(
@@ -293,7 +293,14 @@ impl ConfigInfo {
293293
}
294294
let config_file = match self.config_file.as_deref() {
295295
Some(config_file) => config_file.into(),
296-
None => self.compute_path("config.toml"),
296+
None => {
297+
let mut config_file = self.compute_path("bootstrap.toml");
298+
if !config_file.as_path().exists() {
299+
// for backward compatibility.
300+
config_file = self.compute_path("config.toml");
301+
}
302+
config_file
303+
}
297304
};
298305
let ConfigFile { gcc_path, download_gccjit } = ConfigFile::new(&config_file)?;
299306

@@ -510,7 +517,7 @@ fn download_gccjit(
510517
eprintln!(
511518
"\
512519
Pre-compiled libgccjit.so not available for this os or architecture.
513-
Please compile it yourself and update the `config.toml` file
520+
Please compile it yourself and update the `bootstrap.toml` file
514521
to `download-gccjit = false` and set `gcc-path` to the appropriate directory."
515522
);
516523
return Err(String::from(

compiler/rustc_codegen_gcc/build_system/src/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
490490
String::new()
491491
}
492492
};
493-
let file_path = rust_dir_path.join("config.toml");
493+
let file_path = rust_dir_path.join("bootstrap.toml");
494494
std::fs::write(
495495
&file_path,
496496
&format!(

compiler/rustc_codegen_gcc/doc/tips.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ generate it in [gimple.md](./doc/gimple.md).
6161
#### Configuring rustc_codegen_gcc
6262

6363
* Run `./y.sh prepare --cross` so that the sysroot is patched for the cross-compiling case.
64-
* Set the path to the cross-compiling libgccjit in `gcc-path` (in `config.toml`).
64+
* Set the path to the cross-compiling libgccjit in `gcc-path` (in `bootstrap.toml`).
6565
* Make sure you have the linker for your target (for instance `m68k-unknown-linux-gnu-gcc`) in your `$PATH`. Currently, the linker name is hardcoded as being `$TARGET-gcc`. Specify the target when building the sysroot: `./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu`.
6666
* Build your project by specifying the target: `OVERWRITE_TARGET_TRIPLE=m68k-unknown-linux-gnu ../y.sh cargo build --target m68k-unknown-linux-gnu`.
6767

@@ -77,4 +77,4 @@ If you get the following error:
7777
/usr/bin/ld: unrecognised emulation mode: m68kelf
7878
```
7979

80-
Make sure you set `gcc-path` (in `config.toml`) to the install directory.
80+
Make sure you set `gcc-path` (in `bootstrap.toml`) to the install directory.

compiler/rustc_codegen_gcc/tests/lang_tests_common.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ pub fn main_inner(profile: Profile) {
2323

2424
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
2525

26-
let gcc_path = std::fs::read_to_string(manifest_dir.join("config.toml"))
26+
let gcc_path = std::fs::read_to_string(manifest_dir.join("bootstrap.toml"))
2727
.ok()
2828
.and_then(|v| {
29-
let toml = Toml::parse(&v).expect("Failed to parse `config.toml`");
29+
let toml = Toml::parse(&v).expect("Failed to parse `bootstrap.toml`");
3030
toml.get_string("gcc-path").map(PathBuf::from).ok()
3131
})
3232
.unwrap_or_else(|| {

compiler/rustc_session/src/options.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ top_level_options!(
389389
///
390390
/// This directory is what the virtual `/rustc/$hash` is translated back to,
391391
/// if Rust was built with path remapping to `/rustc/$hash` enabled
392-
/// (the `rust.remap-debuginfo` option in `config.toml`).
392+
/// (the `rust.remap-debuginfo` option in `bootstrap.toml`).
393393
real_rust_source_base_dir: Option<PathBuf> [TRACKED_NO_CRATE_HASH],
394394

395395
edition: Edition [TRACKED],

0 commit comments

Comments
 (0)