Skip to content

Commit 2c33fb9

Browse files
committed
Remove OVERWRITE_TARGET_TRIPLE env var now that config.sh is gone
1 parent 8235b26 commit 2c33fb9

File tree

5 files changed

+27
-8
lines changed

5 files changed

+27
-8
lines changed

.github/workflows/m68k.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ permissions:
1212
env:
1313
# Enable backtraces for easier debugging
1414
RUST_BACKTRACE: 1
15-
# TODO: remove when confish.sh is removed.
16-
OVERWRITE_TARGET_TRIPLE: m68k-unknown-linux-gnu
1715

1816
jobs:
1917
build:
@@ -109,4 +107,10 @@ jobs:
109107
- name: Run tests
110108
run: |
111109
# TODO: remove --features master when it is back to the default.
112-
./y.sh test --release --features master --clean --build-sysroot ${{ matrix.commands }}
110+
./y.sh test --target-triple m68k-unknown-linux-gnu --release --features master --clean --build-sysroot ${{ matrix.commands }}
111+
112+
- name: Run Hello World!
113+
run: |
114+
cd projects/hello_world
115+
../../y.sh cargo run --target-triple m68k-unknown-linux-gnu > hello_world_stdout
116+
test $(cat hello_world_stdout) == "Hello, world!" || exit 1

Readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ generate it in [gimple.md](./doc/gimple.md).
324324
* Run `./y.sh prepare --cross` so that the sysroot is patched for the cross-compiling case.
325325
* Set the path to the cross-compiling libgccjit in `gcc_path`.
326326
* 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 --target-triple m68k-unknown-linux-gnu`.
327-
* Build your project by specifying the target: `OVERWRITE_TARGET_TRIPLE=m68k-unknown-linux-gnu ../y.sh cargo build --target m68k-unknown-linux-gnu`.
327+
* Build your project by specifying the target: `../y.sh cargo build --target m68k-unknown-linux-gnu`.
328328

329329
If the target is not yet supported by the Rust compiler, create a [target specification file](https://docs.rust-embedded.org/embedonomicon/custom-target.html) (note that the `arch` specified in this file must be supported by the rust compiler).
330330
Then, you can use it the following way:
331331

332332
* Add the target specification file using `--target` as an **absolute** path to build the sysroot: `./y.sh build --target-triple m68k-unknown-linux-gnu --target $(pwd)/m68k-unknown-linux-gnu.json`
333-
* Build your project by specifying the target specification file: `OVERWRITE_TARGET_TRIPLE=m68k-unknown-linux-gnu ../y.sh cargo build --target path/to/m68k-unknown-linux-gnu.json`.
333+
* Build your project by specifying the target specification file: `../y.sh cargo build --target path/to/m68k-unknown-linux-gnu.json`.
334334

335335
If you get the following error:
336336

build_system/src/config.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ impl ConfigInfo {
117117
};
118118

119119
if self.target_triple.is_empty() {
120-
if let Some(overwrite) = env.get("OVERWRITE_TARGET_TRIPLE") {
121-
self.target_triple = overwrite.clone();
122-
}
120+
// TODO: set target triple.
121+
// TODO: why do we even need to set target_triple?
122+
// It seems to only be needed for the linker (we could add an environment variable to
123+
// remove this need) and the sysroot (perhaps we could find another way to find it).
124+
// TODO TODO: seems like we would still need OVERWRITE_TARGET_TRIPLE when using a
125+
// json spec file.
126+
// ====> maybe not since we specify both --target and --target-triple.
123127
}
124128
if self.target_triple.is_empty() {
125129
self.target_triple = self.host_triple.clone();

projects/hello_world/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "hello_world"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

projects/hello_world/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)