Skip to content

Commit 1d2b874

Browse files
committed
Remove OVERWRITE_TARGET_TRIPLE env var now that config.sh is gone
1 parent 4b5c44b commit 1d2b874

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

.github/workflows/m68k.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ permissions:
1414
env:
1515
# Enable backtraces for easier debugging
1616
RUST_BACKTRACE: 1
17-
# TODO: remove when confish.sh is removed.
18-
OVERWRITE_TARGET_TRIPLE: m68k-unknown-linux-gnu
1917

2018
jobs:
2119
build:
@@ -106,7 +104,16 @@ jobs:
106104
107105
- name: Run tests
108106
run: |
109-
./y.sh test --release --clean --build-sysroot --sysroot-features compiler_builtins/no-f16-f128 ${{ matrix.commands }}
107+
./y.sh test--target-triple m68k-unknown-linux-gnu --release --clean --build-sysroot --sysroot-features compiler_builtins/no-f16-f128 ${{ matrix.commands }}
108+
109+
- name: Run Hello World!
110+
run: |
111+
./y.sh build --target-triple m68k-unknown-linux-gnu
112+
113+
cd tests/hello-world
114+
../../y.sh cargo build --target m68k-unknown-linux-gnu
115+
../../y.sh cargo run --target m68k-unknown-linux-gnu > hello_world_stdout
116+
test $(cat hello_world_stdout) == "Hello, world!" || exit 1
110117
111118
# Summary job for the merge queue.
112119
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!

build_system/src/config.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,14 @@ impl ConfigInfo {
352352
None => return Err("no host found".to_string()),
353353
};
354354

355-
if self.target_triple.is_empty()
356-
&& let Some(overwrite) = env.get("OVERWRITE_TARGET_TRIPLE")
357-
{
358-
self.target_triple = overwrite.clone();
355+
if self.target_triple.is_empty() {
356+
// TODO: set target triple.
357+
// TODO: why do we even need to set target_triple?
358+
// It seems to only be needed for the linker (we could add an environment variable to
359+
// remove this need) and the sysroot (perhaps we could find another way to find it).
360+
// TODO TODO: seems like we would still need OVERWRITE_TARGET_TRIPLE when using a
361+
// json spec file.
362+
// ====> maybe not since we specify both --target and --target-triple.
359363
}
360364
if self.target_triple.is_empty() {
361365
self.target_triple = self.host_triple.clone();

doc/tips.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ generate it in [gimple.md](./doc/gimple.md).
6363
* Run `./y.sh prepare --cross` so that the sysroot is patched for the cross-compiling case.
6464
* Set the path to the cross-compiling libgccjit in `gcc-path` (in `config.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`.
66-
* Build your project by specifying the target: `OVERWRITE_TARGET_TRIPLE=m68k-unknown-linux-gnu ../y.sh cargo build --target m68k-unknown-linux-gnu`.
66+
* Build your project by specifying the target: `../y.sh cargo build --target m68k-unknown-linux-gnu`.
6767

6868
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).
6969
Then, you can use it the following way:
7070

7171
* Add the target specification file using `--target` as an **absolute** path to build the sysroot: `./y.sh build --sysroot --target-triple m68k-unknown-linux-gnu --target $(pwd)/m68k-unknown-linux-gnu.json`
72-
* 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`.
72+
* Build your project by specifying the target specification file: `../y.sh cargo build --target path/to/m68k-unknown-linux-gnu.json`.
7373

7474
If you get the following error:
7575

0 commit comments

Comments
 (0)