From cf5d59cd4357d06f3e9c64f6ea652d5378ba5c35 Mon Sep 17 00:00:00 2001 From: wargio Date: Sat, 17 Sep 2022 16:22:54 +0200 Subject: [PATCH 1/2] Support portable build without intrinsics --- .github/workflows/ci.yml | 14 ++++++++++++++ c/blake3_dispatch.c | 2 +- c/blake3_impl.h | 1 - 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7d754fc..6b2bf71e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -233,3 +233,17 @@ jobs: - name: build b3sum run: cargo build --target aarch64-apple-darwin working-directory: ./b3sum + + build_tinycc: + name: build with the Tiny C Compiler + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: install TCC + run: apt-get install -y tcc + - name: compile + run: > + tcc -shared -O3 -o libblake3.so \ + -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512 \ + blake3.c blake3_dispatch.c blake3_portable.c + working-directory: ./c \ No newline at end of file diff --git a/c/blake3_dispatch.c b/c/blake3_dispatch.c index 95213dbd..0f348efa 100644 --- a/c/blake3_dispatch.c +++ b/c/blake3_dispatch.c @@ -10,7 +10,7 @@ #elif defined(__GNUC__) #include #else -#error "Unimplemented!" +#undef IS_X86 /* Unimplemented! */ #endif #endif diff --git a/c/blake3_impl.h b/c/blake3_impl.h index cc5672f2..46c8fd85 100644 --- a/c/blake3_impl.h +++ b/c/blake3_impl.h @@ -46,7 +46,6 @@ enum blake3_flags { #if defined(_MSC_VER) #include #endif -#include #endif #if !defined(BLAKE3_USE_NEON) From 9abc602848cea28c5d4a04b4d777b81f2196707b Mon Sep 17 00:00:00 2001 From: Giovanni <561184+wargio@users.noreply.github.com> Date: Wed, 12 Oct 2022 00:27:22 +0200 Subject: [PATCH 2/2] Add missing sudo in ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b2bf71e..2147cbdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -240,10 +240,10 @@ jobs: steps: - uses: actions/checkout@v1 - name: install TCC - run: apt-get install -y tcc + run: sudo apt-get install -y tcc - name: compile run: > tcc -shared -O3 -o libblake3.so \ -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512 \ blake3.c blake3_dispatch.c blake3_portable.c - working-directory: ./c \ No newline at end of file + working-directory: ./c