diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 48fbb4df2..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,84 +0,0 @@ -shallow_clone: true - -# We're currently only testing libffi built with Microsoft's -# tools. -# This matrix should be expanded to include at least: -# 32- and 64-bit gcc/cygwin -# 32- and 64-bit gcc/mingw -# 32- and 64-bit clang/mingw -# and perhaps more. - -image: Visual Studio 2017 -platform: - - x64 - - x86 - - arm - - arm64 - -configuration: - - Debug - - Release - -environment: - global: - CYG_ROOT: C:/cygwin64 - CYG_CACHE: C:/cygwin64/var/cache/setup - CYG_MIRROR: http://mirrors.kernel.org/sourceware/cygwin/ - VSVER: 15 - matrix: - - SHARED_ARG: "--enable-shared --disable-static" - - SHARED_ARG: "--enable-static --disable-shared" - -install: - - ps: >- - If ($env:Platform -Match "x86") { - $env:VCVARS_PLATFORM="x86" - $env:BUILD="i686-pc-cygwin" - $env:HOST="i686-pc-cygwin" - $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh" - $env:SRC_ARCHITECTURE="x86" - } ElseIf ($env:Platform -Match "arm64") { - $env:VCVARS_PLATFORM="x86_arm64" - $env:BUILD="i686-pc-cygwin" - $env:HOST="aarch64-w64-cygwin" - $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm64" - $env:SRC_ARCHITECTURE="aarch64" - } ElseIf ($env:Platform -Match "arm") { - $env:VCVARS_PLATFORM="x86_arm" - $env:BUILD="i686-pc-cygwin" - $env:HOST="arm-w32-cygwin" - $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -marm" - $env:SRC_ARCHITECTURE="arm" - } Else { - $env:VCVARS_PLATFORM="amd64" - $env:BUILD="x86_64-w64-cygwin" - $env:HOST="x86_64-w64-cygwin" - $env:MSVCC="/cygdrive/c/projects/libffi/msvcc.sh -m64" - $env:SRC_ARCHITECTURE="x86" - } - If ($env:Configuration -Match "Debug") { - $env:DEBUG_ARG="--enable-debug" - } Else { - $env:DEBUG_ARG="--disable-debug" - } - - 'appveyor DownloadFile https://cygwin.com/setup-x86_64.exe -FileName setup.exe' - - 'setup.exe -qgnNdO -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" -P dejagnu -P autoconf -P automake -P libtool' - - '%CYG_ROOT%/bin/bash -lc "cygcheck -dc cygwin"' - - echo call VsDevCmd to set VS150COMNTOOLS - - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" - - ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS")) - - echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%" - - call "%VSCOMNTOOLS%..\..\vc\Auxiliary\Build\vcvarsall.bat" %VCVARS_PLATFORM% - -build_script: - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; ./autogen.sh)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; ./configure CC='%MSVCC%' CXX='%MSVCC%' LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='/cygdrive/c/projects/libffi/.travis/ar-lib lib' NM='dumpbin -symbols' STRIP=':' --build=$BUILD --host=$HOST $DEBUG_ARG $SHARED_ARG)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp src/%SRC_ARCHITECTURE%/ffitarget.h include)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; make)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp $HOST/.libs/libffi.lib $HOST/testsuite/libffi-8.lib || true)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cp `find . -name 'libffi-?.dll'` $HOST/testsuite/ || true)" - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; TERM=none make check RUNTESTFLAGS='-v -v -v -v --target '$HOST DEJAGNU=$PWD/.appveyor/site.exp SITEDIR=$PWD/.appveyor)" - - -on_finish: - - c:\cygwin64\bin\sh -lc "(cd $OLDPWD; cat `find ./ -name libffi.log`)" diff --git a/.gitattributes b/.gitattributes index f7d3833e7..36ade649a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -* text=auto +* -text *.sln text eol=crlf *.vcxproj* text eol=crlf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 59c3a8425..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,479 +0,0 @@ -name: CI - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - build-warp: - name: ${{ matrix.HOST }} ${{ matrix.CONFIGURE_OPTIONS }} ${{ matrix.MEVAL }} ${{ matrix.LIBFFI_TEST_OPTIMIZATION }} - runs-on: warp-ubuntu-latest-arm64-2x - - strategy: - fail-fast: false - matrix: - include: - - HOST: "aarch64-linux-gnu" - - steps: - - uses: actions/checkout@v3 - - - env: - MEVAL: ${{ matrix.MEVAL }} - HOST: ${{ matrix.HOST }} - LDFLAGS: ${{ matrix.LDFLAGS }} - RUNTESTFLAGS: ${{ matrix.RUNTESTFLAGS }} - CONFIGURE_OPTIONS: ${{ matrix.CONFIGURE_OPTIONS }} - run: | - if test x"$MEVAL" != x; then eval ${MEVAL}; fi - ./.ci/install.sh - ./.ci/build.sh - - build-sim: - name: ${{ matrix.HOST }} ${{ matrix.CONFIGURE_OPTIONS }} ${{ matrix.MEVAL }} ${{ matrix.LIBFFI_TEST_OPTIMIZATION }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - include: - - HOST: "x86_64-pc-linux-gnu" - MEVAL: "export CC=clang CXX=clang" - - HOST: "i386-pc-linux-gnu" - MEVAL: 'export CC="gcc -m32" CXX="g++ -m32"' - - HOST: "x86_64-pc-linux-gnu" - CONFIGURE_OPTIONS: "--disable-shared" - - HOST: "x86_64-pc-linux-gnu" - CONFIGURE_OPTIONS: "--enable-shared" - - HOST: "m68k-linux-gnu" - MEVAL: 'export CC="m68k-linux-gnu-gcc-8 -mcpu=547x" CXX="m68k-linux-gnu-g++-8 -mcpu=547x"' - CONFIGURE_OPTIONS: '--disable-shared' - QEMU_LD_PREFIX: '/usr/m68k-linux-gnu' - QEMU_CPU: 'cfv4e' - - HOST: "sh4-linux-gnu" - CONFIGURE_OPTIONS: "--disable-shared" - QEMU_LD_PREFIX: "/usr/sh4-linux-gnu" - QEMU_CPU: 'sh7785' - - HOST: "alpha-linux-gnu" - CONFIGURE_OPTIONS: "--disable-shared" - QEMU_LD_PREFIX: "/usr/alpha-linux-gnu" - QEMU_CPU: 'ev4-alpha-cpu' - - HOST: "arm32v7-linux-gnu" - LIBFFI_TEST_OPTIMIZATION: "-O0" - QEMU_CPU: 'any' - - HOST: "arm32v7-linux-gnu" - LIBFFI_TEST_OPTIMIZATION: "-O2" - QEMU_CPU: 'any' - - HOST: "arm32v7-linux-gnu" - LIBFFI_TEST_OPTIMIZATION: "-O2 -fomit-frame-pointer" - QEMU_CPU: 'any' - - HOST: "powerpc-eabisim" - RUNTESTFLAGS: "--target_board powerpc-eabisim" - - HOST: "or1k-elf" - RUNTESTFLAGS: "--target_board or1k-sim" - - HOST: "m32r-elf" - RUNTESTFLAGS: "--target_board m32r-sim" - - HOST: "bfin-elf" - RUNTESTFLAGS: "--target_board bfin-sim" - - MEVAL: "export PATH=/opt/moxielogic/bin:$PATH CC=moxie-elf-gcc CXX=moxie-elf-g++" - HOST: "moxie-elf" - LDFLAGS: "-Tsim.ld" - RUNTESTFLAGS: "--target_board moxie-sim" - - steps: - - uses: actions/checkout@v3 - - - env: - MEVAL: ${{ matrix.MEVAL }} - HOST: ${{ matrix.HOST }} - LDFLAGS: ${{ matrix.LDFLAGS }} - RUNTESTFLAGS: ${{ matrix.RUNTESTFLAGS }} - CONFIGURE_OPTIONS: ${{ matrix.CONFIGURE_OPTIONS }} - QEMU_LD_PREFIX: ${{ matrix.QEMU_LD_PREFIX }} - QEMU_CPU: ${{ matrix.QEMU_CPU }} - run: | - if test x"$MEVAL" != x; then eval ${MEVAL}; fi - ./.ci/install.sh - ./.ci/build.sh - - build-cfarm: - name: ${{ matrix.CFARM_TRIPLE }} ${{ matrix.CFARM_CC }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - include: - - CFARM_HOST: cfarm185.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: aarch64-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm185.fsffrance.org - CFARM_PORT: 22 - CFARM_TRIPLE: aarch64-lto-linux-gnu - CFARM_CC: "gcc -flto" - CFARM_CXX: "g++ -flto" - - CFARM_HOST: cfarm400.cfarm.net - CFARM_PORT: 25465 - CFARM_TRIPLE: loongarch64-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm230.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: mips-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm211.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: sparc64-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm211.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: sparc64-linux-gnu - CFARM_CC: "gcc -m32" - CFARM_CXX: "g++ -m32" - - CFARM_HOST: cfarm91.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: riscv64-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm103.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: aarch64-m1-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm112.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: powerpc64le-linux-gnu - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - CFARM_HOST: cfarm111.cfarm.net - CFARM_PORT: 22 - CFARM_TRIPLE: powerpc-ibm-aix7.1.5.0 - CFARM_CC: "gcc" - CFARM_CXX: "g++" - - steps: - - - uses: actions/checkout@v3 - - - name: Run autogen - run: | - wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 -qO - https://ftpmirror.gnu.org/autoconf/autoconf-2.71.tar.gz | tar -xvzf - - mkdir -p ~/i - (cd autoconf-2.71; ./configure --prefix=$HOME/i; make; make install) - rm -rf autoconf-2.71 - PATH=$HOME/i/bin:$PATH ./autogen.sh - echo "${{ secrets.CFARM_KEY }}" > /tmp/cfk - chmod go-rw /tmp/cfk - - - name: Generate build dir name - run: | - echo BUILD_DIR=t/$GITHUB_RUN_NUMBER-$RANDOM >> $GITHUB_ENV - - - name: Check for host availability - id: check-host - run: | - set +e - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "mkdir -p ${{ env.BUILD_DIR }}" - if test $? -ne 0; then - echo "Remote host is unavailable." - echo "HOST_OK=NO" >> $GITHUB_OUTPUT - else - echo "Remote host is available." - echo "HOST_OK=YES" >> $GITHUB_OUTPUT - fi - set -e - - - name: Show host availability - run: | - echo ${{ steps.check-host.outputs.HOST_OK }} - - - name: Copy source to remote host - if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }} - run: | - echo ${{ steps.check-host.outputs.HOST_OK }} - scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} -r * ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }} - - - name: Run configure and make - if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }} - run: | - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "${{ matrix.CFARM_CC }} --version" - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; CC='${{ matrix.CFARM_CC }}' CXX='${{ matrix.CFARM_CXX }}' ./configure --host=${{ matrix.CFARM_TRIPLE }}) || true; exit 0" - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; make;) || true; exit 0" - - - name: Run tests - if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }} - run: | - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "(cd ${{ env.BUILD_DIR }}; if test -f ~/.profile; then source ~/.profile; fi; GCC_COLORS= make check & CHECKPID=\$!; while kill -0 \$CHECKPID 2>/dev/null; do echo 'Waiting for tests to finish'; sleep 5; done;)" - - - name: Copy results and clean up - if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }} - run: | - scp -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -P ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }}:${{ env.BUILD_DIR }}/*/testsuite/*.log . - ssh -o StrictHostKeyChecking=no -o ConnectTimeout=10 -o ConnectionAttempts=3 -i /tmp/cfk -p ${{ matrix.CFARM_PORT }} ${{ secrets.CFARM_USERNAME }}@${{ matrix.CFARM_HOST }} "rm -rf ${{ env.BUILD_DIR }}" - - - name: Install rlgl and run - if: ${{ steps.check-host.outputs.HOST_OK == 'YES' }} - run: | - wget -qO - https://rl.gl/cli/rlgl-linux-amd64.tgz | \ - tar --strip-components=2 -xvzf - ./rlgl/rlgl; - ./rlgl l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl e -l project=libffi -l sha=${GITHUB_SHA:0:7} -l CC='${{ matrix.CFARM_CC }}' -l build-host=${{ matrix.CFARM_TRIPLE }} --policy=https://github.com/libffi/rlgl-policy.git libffi.log - exit $? - - build: - name: Cygwin ${{ matrix.arch }} - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - include: - - host: i686-pc-cygwin - arch: x86 - - host: x86_64-pc-cygwin - arch: x64 - - steps: - - run: git config --global core.autocrlf input - - - uses: actions/checkout@v3 - - - name: Set up Cygwin - uses: egor-tensin/setup-cygwin@v3 - with: - platform: ${{ matrix.arch }} - packages: wget gcc-core make dejagnu automake autoconf libtool texinfo dos2unix unzip - - - run: | - set -x - cd $(cygpath $RUNNER_WORKSPACE)/libffi - wget https://rl.gl/cli/rlgl-windows-amd64.zip - unzip rlgl-windows-amd64.zip - autoreconf -f -v -i - ./configure - make -j 4 - TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true - ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl/rlgl.exe e \ - -l project=libffi \ - -l sha=${GITHUB_SHA:0:7} \ - -l CC=gcc \ - -l host=${{ matrix.host }} \ - --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log) - shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - build-msys2: - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - include: - - MSYSTEM: MINGW32 - MSYS2_ARCH: i686 - - MSYSTEM: MINGW64 - MSYS2_ARCH: x86_64 - name: ${{ matrix.MSYSTEM }} - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.MSYSTEM }} - update: true - install: >- - base-devel - autoconf-wrapper - autoconf - automake - libtool - make - dejagnu - mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc - mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc-libs - unzip - - - run: | - set -x - cd $(cygpath $RUNNER_WORKSPACE)/libffi - wget https://rl.gl/cli/rlgl-windows-amd64.zip - unzip rlgl-windows-amd64.zip - autoreconf -f -v -i - CC=${{ matrix.MSYS2_ARCH }}-w64-mingw32-gcc CXX=${{ matrix.MSYS2_ARCH }}-w64-mingw32-g++ ./configure - make - TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true - ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl/rlgl.exe e \ - -l project=libffi \ - -l sha=${GITHUB_SHA:0:7} \ - -l CC=${{ matrix.MSYS2_ARCH }}-w64-mingw32-gcc \ - -l host=x86_64-pc-cygwin \ - --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log) - shell: msys2 {0} - - build-msys2-clang: - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - include: - - MSYSTEM: MINGW32 - MSYS2_ARCH: i686 - - MSYSTEM: MINGW64 - MSYS2_ARCH: x86_64 - name: ${{ matrix.MSYSTEM }} - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - - uses: msys2/setup-msys2@v2 - with: - msystem: ${{ matrix.MSYSTEM }} - update: true - install: >- - base-devel - autoconf-wrapper - autoconf - automake - libtool - make - dejagnu - clang - mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc - mingw-w64-${{ matrix.MSYS2_ARCH }}-gcc-libs - unzip - - - run: | - set -x - cd $(cygpath $RUNNER_WORKSPACE)/libffi - wget https://rl.gl/cli/rlgl-windows-amd64.zip - unzip rlgl-windows-amd64.zip - autoreconf -f -v -i - CC=clang CXX=clang ./configure - make - TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci make check || true - ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl/rlgl.exe e \ - -l project=libffi \ - -l sha=${GITHUB_SHA:0:7} \ - -l CC=clang \ - -l host=x86_64-pc-cygwin \ - --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log) - shell: msys2 {0} - - build-macos: - runs-on: ${{ matrix.platform }} - - strategy: - fail-fast: false - matrix: - platform: [macos-11, macos-12] - compilers: [CC=gcc CXX=g++, CC=clang CXX=clang] - - name: ${{ matrix.platform }} ${{ matrix.compilers }} - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - run: ./.ci/install.sh - - run: ${{ matrix.compilers }} ./.ci/build.sh - - build-msvc: - name: Windows ${{ matrix.width }}-bit Visual C++ - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - include: - - host: i686-pc-cygwin - width: 32 - arch: x86 - tools: amd64_x86 - - host: x86_64-pc-cygwin - width: 64 - arch: x64 - tools: amd64 - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - uses: egor-tensin/setup-cygwin@v3 - with: - platform: x64 - packages: wget make dejagnu automake autoconf libtool texinfo unzip dos2unix - - uses: ilammy/msvc-dev-cmd@v1.12.0 - with: - arch: ${{ matrix.tools }} - - - name: Build and test - run: | - # export PATH=$PATH:"/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64" - cd $(cygpath $RUNNER_WORKSPACE)/libffi - wget https://rl.gl/cli/rlgl-windows-amd64.zip - unzip rlgl-windows-amd64.zip - autoreconf -f -v -i - ./configure --host=${{ matrix.host }} CC="$(pwd)/msvcc.sh -m${{ matrix.width }}" CXX="$(pwd)/msvcc.sh -m${{ matrix.width }}" LD='link' CPP='cl -nologo -EP' CXXCPP='cl -nologo -EP' CPPFLAGS='-DFFI_BUILDING_DLL' AR='$(pwd)/.ci/ar-lib lib' NM='dumpbin -symbols' STRIP=':' $DEBUG_ARG $SHARED_ARG || cat */config.log - make - cp $(find . -name 'libffi-?.dll') ${{ matrix.host }}/testsuite/ - TERM=none DEJAGNU=$(pwd)/.ci/site.exp BOARDSDIR=$(pwd)/.ci GCC_COLORS= make check || true - ./rlgl/rlgl.exe l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl/rlgl.exe e \ - -l project=libffi \ - -l sha=${GITHUB_SHA:0:7} \ - -l CC=msvcc.sh \ - -l host=${{ matrix.host }} \ - --policy=https://github.com/libffi/rlgl-policy.git $(find . -name libffi.log) - shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - - build-android: - name: Android ${{ matrix.host }} - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - host: [armv7a-linux-androideabi, aarch64-linux-android, i686-linux-android, x86_64-linux-android] - - steps: - - run: git config --global core.autocrlf input - - uses: actions/checkout@v3 - - run: ./.ci/install.sh - - env: - HOST: ${{ matrix.HOST }} - ANDROID_API_LEVEL: 23 - CONFIGURE_OPTIONS: "--disable-shared --disable-multi-os-directory" # fixes warning about unsupported -print-multi-os-directory with clang - run: | - # Relevant documentation: - # https://developer.android.com/ndk/guides/other_build_systems - # https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md - export TOOLCHAIN="${ANDROID_NDK_ROOT}"/toolchains/llvm/prebuilt/linux-x86_64 - export CC="${TOOLCHAIN}"/bin/${HOST}${ANDROID_API_LEVEL}-clang - export CXX="${TOOLCHAIN}"/bin/${HOST}${ANDROID_API_LEVEL}-clang++ - export LD="${TOOLCHAIN}"/bin/ld.lld - export AR="${TOOLCHAIN}"/bin/llvm-ar - export AS="${CC}" - export RANLIB="${TOOLCHAIN}"/bin/llvm-ranlib - export STRIP="${TOOLCHAIN}"/bin/llvm-strip - export NM="${TOOLCHAIN}"/bin/llvm-nm - export OBJDUMP="${TOOLCHAIN}"/bin/llvm-objdump - ./.ci/build.sh diff --git a/.github/workflows/emscripten.yml b/.github/workflows/emscripten.yml deleted file mode 100644 index 1e6265a3e..000000000 --- a/.github/workflows/emscripten.yml +++ /dev/null @@ -1,172 +0,0 @@ -name: CI emscripten - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ master ] - pull_request: - branches: [ master ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - - -env: - PYODIDE_VERSION: 0.52.1 - # PYTHON_VERSION and EMSCRIPTEN_VERSION are determined by PYODIDE_VERSION. - # The appropriate versions can be found in the Pyodide repodata.json - # "info" field, or in Makefile.envs: - # https://github.com/pyodide/pyodide/blob/main/Makefile.envs#L2 - PYTHON_VERSION: 3.10.7 - EMSCRIPTEN_VERSION: 3.1.27 - EM_CACHE_FOLDER: emsdk-cache - -jobs: - setup-emsdk-cache: - runs-on: ubuntu-22.04 - steps: - - name: Setup cache - id: cache-system-libraries - uses: actions/cache@v3 - with: - path: ${{env.EM_CACHE_FOLDER}} - key: ${{env.EMSCRIPTEN_VERSION}} - - - uses: mymindstorm/setup-emsdk@v12 - with: - version: ${{ env.EMSCRIPTEN_VERSION }} - actions-cache-folder: ${{env.EM_CACHE_FOLDER}} - - test-dejagnu: - strategy: - matrix: - bigint: ["--wasm-bigint", ""] - runs-on: ubuntu-22.04 - needs: [setup-emsdk-cache] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: set up python - id: setup-python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Setup cache - id: cache-system-libraries - uses: actions/cache@v3 - with: - path: ${{env.EM_CACHE_FOLDER}} - key: ${{env.EMSCRIPTEN_VERSION}} - - - uses: mymindstorm/setup-emsdk@v12 - with: - version: ${{ env.EMSCRIPTEN_VERSION }} - actions-cache-folder: ${{env.EM_CACHE_FOLDER}} - - - name: Install dejagnu - shell: bash -l {0} - run: | - sudo apt install -y dejagnu - - - name: run tests - run: | - testsuite/emscripten/node-tests.sh ${{ matrix.bigint }} - - - name: Install rlgl and run - run: | - wget -qO - https://rl.gl/cli/rlgl-linux-amd64.tgz | \ - tar --strip-components=2 -xvzf - ./rlgl/rlgl; - ./rlgl l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl e -l project=libffi -l sha=${GITHUB_SHA:0:7} -l CC='emcc' -l host=wasm32-unknown-linux --policy=https://github.com/libffi/rlgl-policy.git testsuite/libffi.log - exit $? - - build: - strategy: - matrix: - bigint: ["--wasm-bigint", ""] - env: - WASM_BIGINT: ${{ matrix.bigint }} - runs-on: ubuntu-22.04 - needs: [setup-emsdk-cache] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup cache - id: cache-system-libraries - uses: actions/cache@v3 - with: - path: ${{env.EM_CACHE_FOLDER}} - key: ${{env.EMSCRIPTEN_VERSION}} - - - uses: mymindstorm/setup-emsdk@v12 - with: - version: ${{ env.EMSCRIPTEN_VERSION }} - actions-cache-folder: ${{env.EM_CACHE_FOLDER}} - - - name: build - run: | - ./testsuite/emscripten/build.sh ${{ matrix.bigint }} - - - name: build tests - run: | - cp -r testsuite/libffi.call testsuite/libffi.call.test - cp -r testsuite/libffi.closures testsuite/libffi.closures.test - ./testsuite/emscripten/build-tests.sh testsuite/libffi.call.test ${{ matrix.bigint }} - ./testsuite/emscripten/build-tests.sh testsuite/libffi.closures.test ${{ matrix.bigint }} - - - name: Store artifacts - uses: actions/upload-artifact@v3 - with: - name: built-tests - path: | - ./testsuite/libffi.c*/ - - test: - strategy: - matrix: - bigint: ["--wasm-bigint", ""] - browser: ["chrome"] - # FIXME: selenium can't find gecko driver for "firefox" - runs-on: ubuntu-22.04 - needs: [build] - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Download build artifact - uses: actions/download-artifact@v3 - with: - name: built-tests - path: ./testsuite/ - - - uses: conda-incubator/setup-miniconda@v2 - with: - activate-environment: pyodide-env - python-version: ${{ env.PYTHON_VERSION }} - channels: conda-forge - - name: Install test dependencies - run: | - pip install pytest-pyodide==${{ env.PYODIDE_VERSION }} - - - name: - run: | - cd testsuite/emscripten/ - mkdir test-results - pytest \ - --junitxml=test-results/junit.xml \ - test_libffi.py \ - -k ${{ matrix.browser }} \ - -s - - - name: Install rlgl and run - if: success() || failure() - run: | - wget -qO - https://rl.gl/cli/rlgl-linux-amd64.tgz | \ - tar --strip-components=2 -xvzf - ./rlgl/rlgl; - ./rlgl l --key=0LIBFFI-0LIBFFI-0LIBFFI-0LIBFFI https://rl.gl - ./rlgl e -l project=libffi -l sha=${GITHUB_SHA:0:7} -l CC='emcc' -l host=${{ matrix.browser }} --policy=https://github.com/libffi/rlgl-policy.git testsuite/emscripten/test-results/junit.xml - exit $? diff --git a/.github/workflows/lwjgl.yml b/.github/workflows/lwjgl.yml new file mode 100644 index 000000000..bc39571d3 --- /dev/null +++ b/.github/workflows/lwjgl.yml @@ -0,0 +1,260 @@ +name: LWJGL Build + +on: + push: + branches: + - master + +env: + AWS_DEFAULT_REGION: us-east-1 + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0" + +jobs: + linux: + name: Linux + runs-on: ubuntu-latest + container: + image: centos:7 + strategy: + fail-fast: false + matrix: + ARCH: [x64] + include: + - ARCH: x64 + HOST: x86_64-pc-linux-gnu + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 3 + - name: Configure yum + run: | + yum -y install epel-release + yum -y update + - name: Install build dependencies + run: | + yum -y install centos-release-scl + yum -y install devtoolset-11-gcc-c++ + yum -y install awscli + - name: Install libffi dependencies + run: yum -y install autoconf automake libtool texinfo + - name: Install autoconf 2.71 + run: | + source scl_source enable devtoolset-11 || true + curl -L https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz | tar -xz + (cd autoconf-2.71; ./configure; make; make install) + - name: Configure build + run: | + source scl_source enable devtoolset-11 || true + ./autogen.sh + ./configure --disable-shared --with-pic --host=${{matrix.HOST}} || cat */config.log + - name: Build + run: | + source scl_source enable devtoolset-11 || true + make + - name: Upload artifact + run: aws s3 cp ${{matrix.HOST}}/.libs/libffi_convenience.a s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/core/libffi.a $S3_PARAMS + + linux-cross: + name: Linux Cross + runs-on: ubuntu-latest + container: + image: ${{matrix.CONTAINER}} + strategy: + fail-fast: false + matrix: + ARCH: [arm32, arm64, mips64, ppc64le, riscv64] + include: + # ----- + - ARCH: arm32 + CROSS_ARCH: armhf + CONTAINER: ubuntu:18.04 + TRIPLET: arm-linux-gnueabihf + HOST: arm-unknown-linux-gnueabihf + # ----- + - ARCH: arm64 + CROSS_ARCH: arm64 + CONTAINER: ubuntu:18.04 + TRIPLET: aarch64-linux-gnu + HOST: aarch64-unknown-linux-gnu + # ----- + - ARCH: mips64 + CROSS_ARCH: mips64el + CONTAINER: ubuntu:18.04 + TRIPLET: mips64el-linux-gnuabi64 + HOST: mips64el-unknown-linux-gnu + # ---- + - ARCH: ppc64le + CROSS_ARCH: ppc64el + CONTAINER: ubuntu:18.04 + TRIPLET: powerpc64le-linux-gnu + HOST: powerpc64le-unknown-linux-gnu + # ----- + - ARCH: riscv64 + CROSS_ARCH: riscv64 + CONTAINER: ubuntu:20.04 + TRIPLET: riscv64-linux-gnu + HOST: riscv64-unknown-linux-gnu + defaults: + run: + shell: bash + steps: + - name: Upgrade git + run: | + apt-get -y update + apt-get -y install software-properties-common wget + apt-get -y install --reinstall ca-certificates + apt-get -y update + apt-get -y upgrade + wget https://apt.kitware.com/keys/kitware-archive-latest.asc + apt-key add kitware-archive-latest.asc + add-apt-repository -y 'deb https://apt.kitware.com/ubuntu/ bionic main' + add-apt-repository -y ppa:git-core/ppa + apt-get -y update + DEBIAN_FRONTEND=noninteractive apt-get -yq install awscli git + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Install dependencies + run: apt-get install -yq m4 make automake libtool texinfo gcc-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross + - name: Install autoconf 2.71 + run: | + wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 -qO - https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.gz | tar -xvzf - + mkdir -p ~/i + (cd autoconf-2.71; ./configure --prefix=$HOME/i; make; make install) + rm -rf autoconf-2.71 + - name: Configure build + run: | + PATH=$HOME/i/bin:$PATH ./autogen.sh + ./configure --disable-shared --with-pic CC=${{matrix.TRIPLET}}-gcc --host=${{matrix.HOST}} || cat */config.log + - name: Build + run: make + - name: Upload artifact + run: aws s3 cp ${{matrix.HOST}}/.libs/libffi_convenience.a s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/core/libffi.a $S3_PARAMS + + freebsd-cross: + name: FreeBSD Cross + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Build + uses: cross-platform-actions/action@v0.24.0 + with: + operating_system: freebsd + architecture: x86-64 + version: '13.2' + memory: 4G + shell: bash + run: | + sudo pkg install -y m4 gmake automake libtool texinfo + ./autogen.sh + ./configure --disable-shared --with-pic || cat */config.log + make + - name: Upload artifact + run: aws s3 cp x86_64-unknown-freebsd13.2/.libs/libffi_convenience.a s3://lwjgl-build/nightly/freebsd/x64/core/libffi.a $S3_PARAMS + + macos: + name: macOS + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + ARCH: [x64, arm64] + include: + - ARCH: x64 + CC: MACOSX_DEPLOYMENT_TARGET=10.11 + CFLAGS: -target x64-apple-darwin -arch x86_64 -mmacosx-version-min=10.11 + LDFLAGS: -target x64-apple-darwin -arch x86_64 -mmacosx-version-min=10.11 + HOST: x86_64 + - ARCH: arm64 + #CC: SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) MACOSX_DEPLOYMENT_TARGET=11.0 + CC: MACOSX_DEPLOYMENT_TARGET=11.0 + CFLAGS: -target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0 + LDFLAGS: -target aarch64-apple-darwin -arch arm64 -mmacosx-version-min=11.0 + HOST: aarch64 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Install dependencies + run: brew install automake libtool texinfo + - name: Configure build + run: | + ./autogen.sh + ${{matrix.CC}} ./configure --disable-shared CC=clang CFLAGS='${{matrix.CFLAGS}}' LDFLAGS='${{matrix.LDFLAGS}}' --target ${{matrix.ARCH}}-apple-darwin20 --host=${{matrix.HOST}}-apple-darwin20 || cat */config.log + - name: Build + run: ${{matrix.CC}} make + - name: Upload artifact + run: aws s3 cp ${{matrix.HOST}}-apple-darwin20/.libs/libffi_convenience.a s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/core/libffi.a $S3_PARAMS + + windows: + name: Windows + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + ARCH: [x86, x64, arm64] + include: + # ----- + - ARCH: x86 + SOURCE_ARCH: x86 + MSVC_ARCH: amd64_x86 + MSVC_SH: msvcc.sh + HOST: i686-pc-cygwin + # ----- + - ARCH: x64 + SOURCE_ARCH: x86 + MSVC_ARCH: amd64 + MSVC_SH: msvcc.sh -m64 + HOST: x86_64-pc-cygwin + # ----- + - ARCH: arm64 + SOURCE_ARCH: aarch64 + MSVC_ARCH: amd64_arm64 + MSVC_SH: msvcc.sh -marm64 + HOST: aarch64-pc-cygwin + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Install dependencies + uses: egor-tensin/setup-cygwin@v3 + with: + platform: x64 + install-dir: C:\cygwin + packages: wget autoconf automake libtool + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.MSVC_ARCH }} + - name: Build + run: | + cd $(cygpath $RUNNER_WORKSPACE)/libffi + ./autogen.sh + ./configure \ + CC="$PWD/${{matrix.MSVC_SH}}" \ + CXX="$PWD/${{matrix.MSVC_SH}}" \ + LD='link' \ + CPP='cl -nologo -EP' \ + CXXCPP='cl -nologo -EP' \ + CPPFLAGS='-DFFI_BUILDING_DLL -DUSE_STATIC_RTL' \ + NM='dumpbin -symbols' \ + STRIP=':' \ + CONFIGURE_OPTIONS=--disable-shared \ + --host=${{matrix.HOST}} \ + || cat */config.log + cp src/${{matrix.SOURCE_ARCH}}/ffitarget.h include + make + shell: C:\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + - name: Upload artifact + run: aws s3 cp ${{matrix.HOST}}\.libs\libffi_convenience.lib s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/core/libffi.lib %S3_PARAMS% diff --git a/configure.ac b/configure.ac index 816bfd666..a53c3f53a 100644 --- a/configure.ac +++ b/configure.ac @@ -67,8 +67,8 @@ EOF AM_MAINTAINER_MODE -AC_CHECK_HEADERS(sys/memfd.h) -AC_CHECK_FUNCS([memfd_create]) +#AC_CHECK_HEADERS(sys/memfd.h) +#AC_CHECK_FUNCS([memfd_create]) dnl The -no-testsuite modules omit the test subdir. AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)