Skip to content

Commit

Permalink
Testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Sep 9, 2021
1 parent d9eba67 commit bf9ecad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/main.yml
Expand Up @@ -83,7 +83,6 @@ jobs:
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV
upcase=$(echo ${{ matrix.mustang_target }} | awk '{ print toupper($0) }' | sed 's/-/_/g')
echo CARGO_TARGET_${upcase}_LINKER=${{ matrix.gcc }} >> $GITHUB_ENV
echo CC_${{ matrix.mustang_target }}=${{ matrix.gcc }} >> $GITHUB_ENV
if: matrix.gcc_package != '' && matrix.os == 'ubuntu-latest'

- name: Install cross-compilation libraries
Expand Down
8 changes: 8 additions & 0 deletions initialize-c-runtime/build.rs
@@ -1,4 +1,12 @@
fn main() {
// If we're targeting mustang, tell the `cc` crate how to compile C.
let target = std::env::var("TARGET").unwrap();
if let Some(stripped) = target.strip_suffix("-mustang") {
let arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
let os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
std::env::set_var(format!("CC_{}-gnu", stripped), format!("{}-{}-gnu-gcc", arch, os));
}

cc::Build::new()
.flag("-ffreestanding")
.file("c/initialize-c-runtime.c")
Expand Down

0 comments on commit bf9ecad

Please sign in to comment.