Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix i686 builds #110

Merged
merged 4 commits into from
Oct 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,26 @@ jobs:
run: ./test/ci/test.sh

cmake-test:
name: cmake-${{ matrix.runner }}
name: cmake-${{ matrix.runner }}-${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner: ["ubuntu-20.04", "macos-11", "windows-2019"]
platform: ["x86_64", "i686"]
exclude:
- runner: "macos-11"
platform: "i686"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Ubuntu i686 support
if: runner.os == 'Linux' && matrix.platform == 'i686'
run: |
sudo apt-get update
sudo apt-get install -y libc6-dev-i386
echo "CFLAGS=-m32" >> $GITHUB_ENV
echo "LDFLAGS=-m32" >> $GITHUB_ENV
- name: CMake Configure
run: >
cmake
Expand All @@ -45,6 +56,7 @@ jobs:
-DBASE64_BUILD_TESTS=ON
${{ runner.os != 'Windows' && '-DCMAKE_BUILD_TYPE=Release' || '' }}
${{ runner.os == 'macOS' && '-DBASE64_WITH_AVX2=OFF' || '' }}
${{ runner.os == 'Windows' && matrix.platform == 'i686' && '-A Win32' || '' }}
-DBASE64_WITH_AVX512=OFF
- name: CMake Build
run: cmake --build out --config Release --verbose
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ add_feature_info(AVX BASE64_WITH_AVX "add AVX codepath")
cmake_dependent_option(BASE64_WITH_AVX2 "add AVX 2 codepath" ON ${_IS_X86} OFF)
add_feature_info(AVX2 BASE64_WITH_AVX2 "add AVX2 codepath")
cmake_dependent_option(BASE64_WITH_AVX512 "add AVX 512 codepath" ON ${_IS_X86} OFF)
add_feature_info(AVX2 BASE64_WITH_AVX512 "add AVX512 codepath")
add_feature_info(AVX512 BASE64_WITH_AVX512 "add AVX512 codepath")

cmake_dependent_option(BASE64_WITH_NEON32 "add NEON32 codepath" OFF _TARGET_ARCH_arm OFF)
add_feature_info(NEON32 BASE64_WITH_NEON32 "add NEON32 codepath")
Expand Down
4 changes: 2 additions & 2 deletions lib/arch/avx/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#if HAVE_AVX
#include <immintrin.h>

// Only enable inline assembly on supported compilers.
// Only enable inline assembly on supported compilers and on 64-bit CPUs.
#ifndef BASE64_AVX_USE_ASM
# if defined(__GNUC__) || defined(__clang__)
# if (defined(__GNUC__) || defined(__clang__)) && BASE64_WORDSIZE == 64
# define BASE64_AVX_USE_ASM 1
# else
# define BASE64_AVX_USE_ASM 0
Expand Down
4 changes: 2 additions & 2 deletions lib/arch/avx2/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#if HAVE_AVX2
#include <immintrin.h>

// Only enable inline assembly on supported compilers.
// Only enable inline assembly on supported compilers and on 64-bit CPUs.
#ifndef BASE64_AVX2_USE_ASM
# if defined(__GNUC__) || defined(__clang__)
# if (defined(__GNUC__) || defined(__clang__)) && BASE64_WORDSIZE == 64
# define BASE64_AVX2_USE_ASM 1
# else
# define BASE64_AVX2_USE_ASM 0
Expand Down