Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Sep 28, 2023
1 parent a62dc39 commit ec71596
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/m68k.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

steps:
- name: Install packages
run: sudo apt-get install qemu
run: sudo apt-get install qemu qemu-user-static

- uses: actions/checkout@v3

Expand Down Expand Up @@ -67,6 +67,11 @@ jobs:
- name: Setup path to libgccjit
run: |
sudo dpkg -i gcc-m68k-13.deb
echo "*********************"
ls /usr/bin
echo "*********************"
ls /bin
echo "*********************"
ls /lib
echo "*********************"
ls /usr/lib
Expand Down Expand Up @@ -114,6 +119,19 @@ jobs:
#path: rust
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}

#- name: Test libgccjit build (TODO REMOVE)
#run: |
#export LD_LIBRARY_PATH=/usr/lib
#export LIBRARY_PATH=/usr/lib
#cd m68k-test
#cargo run
#cd ..
#mkdir vm
#sudo mount debian-m68k.img vm
#mv m68k-test/main-m68k vm/home/
#sudo chroot vm/ qemu-m68k-static /home/main-m68k

# TODO: reset cross-gcc config file (i.e. try to revert CT_BINUTILS_V_2_37 to CT_BINUTILS_V_2_38).
- name: Test build (TODO REMOVE)
run: |
cat > main.c <<EOF
Expand All @@ -123,7 +141,9 @@ jobs:
EOF
mkdir vm
sudo mount debian-m68k.img vm
m68k-unknown-linux-gnu-gcc main.c -o vm/home/main
m68k-unknown-linux-gnu-gcc main.c -o main
sudo cp main vm/home/main
sudo cp (which qemu-m68k-static) vm/usr/bin/
sudo chroot vm/ qemu-m68k-static /home/main
- name: Build
Expand Down
32 changes: 32 additions & 0 deletions m68k-test/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions m68k-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "m68k-test"
version = "0.1.0"
edition = "2021"

[dependencies]
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
10 changes: 10 additions & 0 deletions m68k-test/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use gccjit::{Context, FunctionType, OutputKind};

fn main() {
let context = Context::default();
let int_type = context.new_type::<i32>();
let function = context.new_function(None, FunctionType::Exported, int_type, &[], "main", false);
let block = function.new_block("block");
block.end_with_return(None, context.new_rvalue_from_int(int_type, 42));
context.compile_to_file(OutputKind::Executable, "main-m68k");
}

0 comments on commit ec71596

Please sign in to comment.