1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460
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-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: gcc117.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: aarch64-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc117.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: aarch64-linux-gnu
CFARM_CC: "/home/green/gcc12/bin/gcc"
CFARM_CXX: "/home/green/gcc12/bin/g++"
- CFARM_HOST: gcc117.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: aarch64-lto-linux-gnu
CFARM_CC: "gcc -flto"
CFARM_CXX: "g++ -flto"
- CFARM_HOST: gcc400.fsffrance.org
CFARM_PORT: 25465
CFARM_TRIPLE: loongarch64-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc230.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: mips-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc102.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: sparc64-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc102.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: sparc64-linux-gnu
CFARM_CC: "gcc -m32"
CFARM_CXX: "g++ -m32"
- CFARM_HOST: gcc91.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: riscv64-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc103.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: aarch64-m1-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc112.fsffrance.org
CFARM_PORT: 22
CFARM_TRIPLE: powerpc64le-linux-gnu
CFARM_CC: "gcc"
CFARM_CXX: "g++"
- CFARM_HOST: gcc111.fsffrance.org
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