diff --git a/.github/env/bootstrap.sh b/.github/env/bootstrap.sh deleted file mode 100755 index fe3056cc88..0000000000 --- a/.github/env/bootstrap.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -build_os_arch=$1 -host_os_arch=$2 - -build_arch=$(echo $build_os_arch | cut -d"-" -f2) -host_arch=$(echo $host_os_arch | cut -d"-" -f2) - -envdir=`dirname $0` -outdir=/tmp - -set -ex - -mkdir -p $outdir/toolchain $outdir/native-sdk $outdir/cross-sdk -deps_url=https://build.frida.re/deps/20240118 -curl $deps_url/toolchain-$build_os_arch.tar.bz2 | tar -C $outdir/toolchain -xjf - -curl $deps_url/sdk-$build_os_arch.tar.bz2 | tar -C $outdir/native-sdk -xjf - -curl $deps_url/sdk-$host_os_arch.tar.bz2 | tar -C $outdir/cross-sdk -xjf - - -for machine in native cross; do - ( - echo "#!/bin/sh" - echo "export PKG_CONFIG_PATH=$outdir/$machine-sdk/lib/pkgconfig" - echo "exec $outdir/toolchain/bin/pkg-config --define-variable=frida_sdk_prefix=$outdir/$machine-sdk --static \"\$@\"" - ) > $outdir/$machine-pkg-config - chmod +x $outdir/$machine-pkg-config -done - -case ${build_arch}__${host_arch} in - x86_64__x86) - needs_exe_wrapper=false - ;; - *) - needs_exe_wrapper=true - ;; -esac - -$envdir/emit-$build_os_arch.sh $outdir/native-pkg-config false > $outdir/native.txt -$envdir/emit-$host_os_arch.sh $outdir/cross-pkg-config $needs_exe_wrapper > $outdir/cross.txt diff --git a/.github/env/emit-android-arm.sh b/.github/env/emit-android-arm.sh deleted file mode 100755 index bd237b6ac3..0000000000 --- a/.github/env/emit-android-arm.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-march=armv7-a', '-mfloat-abi=softfp', '-mfpu=vfpv3-d16', '-mthumb', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/armv7a-linux-androideabi19-clang' -cpp = '$bindir/armv7a-linux-androideabi19-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7eabi' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-arm64.sh b/.github/env/emit-android-arm64.sh deleted file mode 100755 index 0bfd5f3f42..0000000000 --- a/.github/env/emit-android-arm64.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/aarch64-linux-android21-clang' -cpp = '$bindir/aarch64-linux-android21-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-x86.sh b/.github/env/emit-android-x86.sh deleted file mode 100755 index 6f380e3263..0000000000 --- a/.github/env/emit-android-x86.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-march=pentium4', '-mfpmath=sse', '-mstackrealign', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/i686-linux-android19-clang' -cpp = '$bindir/i686-linux-android19-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'android' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-android-x86_64.sh b/.github/env/emit-android-x86_64.sh deleted file mode 100755 index d7fb58c3ae..0000000000 --- a/.github/env/emit-android-x86_64.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -bindir=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/$(uname -s | tr '[A-Z]' '[a-z]')-$(uname -m)/bin - -cat << EOF -[constants] -c_like_flags = ['-DANDROID', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = '$bindir/x86_64-linux-android21-clang' -cpp = '$bindir/x86_64-linux-android21-clang++' -ar = '$bindir/llvm-ar' -nm = '$bindir/llvm-nm' -readelf = '$bindir/llvm-readelf' -strip = '$bindir/llvm-strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'android' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-ios-arm64.sh b/.github/env/emit-ios-arm64.sh deleted file mode 100755 index a391dd94c6..0000000000 --- a/.github/env/emit-ios-arm64.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -sdk=iphoneos - -cat << EOF -[constants] -common_flags = ['-target', 'arm64-apple-ios8.0', '-isysroot', '$(xcrun --sdk $sdk --show-sdk-path)'] -linker_flags = ['-Wl,-dead_strip'] - -[binaries] -c = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -cpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -objc = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -objcpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -ar = '$(xcrun --sdk $sdk -f ar)' -nm = '$(xcrun --sdk $sdk -f nm)' -strip = '$(xcrun --sdk $sdk -f strip)' -pkgconfig = '$pkgconfig' - -[built-in options] -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'darwin' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips.sh b/.github/env/emit-linux-mips.sh deleted file mode 100755 index a1ad4b0b7b..0000000000 --- a/.github/env/emit-linux-mips.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips-linux-gnu- - -cat << EOF -[constants] -base_flags = ['-march=mips1', '-mfp32'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips' -cpu = 'mips1' -endian = 'big' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips64.sh b/.github/env/emit-linux-mips64.sh deleted file mode 100755 index c85ad289e5..0000000000 --- a/.github/env/emit-linux-mips64.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips64-linux-gnuabi64- - -cat << EOF -[constants] -base_flags = ['-march=mips64r2', '-mabi=64'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips64' -cpu = 'mips64r2' -endian = 'big' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mips64el.sh b/.github/env/emit-linux-mips64el.sh deleted file mode 100755 index 2bfde88506..0000000000 --- a/.github/env/emit-linux-mips64el.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mips64el-linux-gnuabi64- - -cat << EOF -[constants] -base_flags = ['-march=mips64r2', '-mabi=64'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips64' -cpu = 'mips64r2' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-mipsel.sh b/.github/env/emit-linux-mipsel.sh deleted file mode 100755 index d4950ef3e3..0000000000 --- a/.github/env/emit-linux-mipsel.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=mipsel-linux-gnu- - -cat << EOF -[constants] -base_flags = ['-march=mips1', '-mfp32'] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections', '-Wl,-z,noexecstack'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'linux' -cpu_family = 'mips' -cpu = 'mips1' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-x86.sh b/.github/env/emit-linux-x86.sh deleted file mode 100755 index 0e2f3bf1be..0000000000 --- a/.github/env/emit-linux-x86.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -cat << EOF -[constants] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = ['gcc', '-m32'] -cpp = ['g++', '-m32'] -ar = 'ar' -nm = 'nm' -readelf = 'readelf' -strip = 'strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'linux' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-linux-x86_64.sh b/.github/env/emit-linux-x86_64.sh deleted file mode 100755 index b28c9bb0f5..0000000000 --- a/.github/env/emit-linux-x86_64.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -cat << EOF -[constants] -c_like_flags = ['-ffunction-sections', '-fdata-sections'] -linker_flags = ['-Wl,--gc-sections', '-Wl,-z,noexecstack', '-Wl,-z,relro', '-Wl,-z,now'] - -[binaries] -c = 'gcc' -cpp = 'g++' -ar = 'ar' -nm = 'nm' -readelf = 'readelf' -strip = 'strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = c_like_flags -cpp_args = c_like_flags -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'linux' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-macos-x86_64.sh b/.github/env/emit-macos-x86_64.sh deleted file mode 100755 index 4fff84c862..0000000000 --- a/.github/env/emit-macos-x86_64.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -sdk=macosx - -cat << EOF -[constants] -common_flags = ['-target', 'x86_64-apple-macos10.9', '-isysroot', '$(xcrun --sdk $sdk --show-sdk-path)'] -linker_flags = ['-Wl,-dead_strip'] - -[binaries] -c = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -cpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -objc = ['$(xcrun --sdk $sdk -f clang)'] + common_flags -objcpp = ['$(xcrun --sdk $sdk -f clang++)'] + common_flags -ar = '$(xcrun --sdk $sdk -f ar)' -nm = '$(xcrun --sdk $sdk -f nm)' -strip = '$(xcrun --sdk $sdk -f strip)' -pkgconfig = '$pkgconfig' - -[built-in options] -c_link_args = linker_flags -cpp_link_args = linker_flags - -[host_machine] -system = 'darwin' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/env/emit-qnx-armeabi.sh b/.github/env/emit-qnx-armeabi.sh deleted file mode 100755 index 203e5144ab..0000000000 --- a/.github/env/emit-qnx-armeabi.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -pkgconfig=$1 -needs_exe_wrapper=$2 - -toolpfx=$QNX_HOST/usr/bin/arm-unknown-nto-qnx6.5.0eabi- -sysroot=$QNX_TARGET/armle-v7 - -cat << EOF -[constants] -base_flags = ['--sysroot=$sysroot', '-march=armv7-a'] -c_like_flags = ['-mno-unaligned-access', '-ffunction-sections', '-fdata-sections'] -linker_flags = ['-static-libgcc', '-Wl,--gc-sections'] - -[binaries] -c = '${toolpfx}gcc' -cpp = '${toolpfx}g++' -ar = '${toolpfx}ar' -nm = '${toolpfx}nm' -readelf = '${toolpfx}readelf' -strip = '${toolpfx}strip' -pkgconfig = '$pkgconfig' - -[built-in options] -c_args = base_flags + c_like_flags -cpp_args = base_flags + c_like_flags -c_link_args = base_flags + linker_flags -cpp_link_args = base_flags + linker_flags + ['-static-libstdc++'] - -[host_machine] -system = 'qnx' -cpu_family = 'arm' -cpu = 'armv7' -endian = 'little' - -[properties] -needs_exe_wrapper = $needs_exe_wrapper -EOF diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76f7ebd659..830d721f62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,77 +9,46 @@ on: - main env: - PYTHON_VERSION: 3.11 - MESON_VERSION: 0.64.0 + GUM_OPTIONS: '--enable-gumpp --enable-gumjs --with-devkits=gum,gumjs --enable-tests' jobs: gir: - if: false - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' + submodules: recursive - name: Install dependencies run: | - sudo apt-get update sudo apt-get install \ - gobject-introspection \ - libdwarf-dev \ - libelf-dev \ - libgirepository1.0-dev \ - libglib2.0-dev \ - libjson-glib-dev \ - libsoup-3.0-dev \ - libsqlite3-dev \ - libunwind-dev \ - ninja-build - pip install meson==${{ env.MESON_VERSION }} + gobject-introspection \ + libdwarf-dev \ + libelf-dev \ + libgirepository1.0-dev \ + libglib2.0-dev \ + libjson-glib-dev \ + libsoup-3.0-dev \ + libsqlite3-dev \ + libunwind-dev \ + meson - name: Build run: | - meson setup \ - -Doptimization=s \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - build - meson compile -C build + ./configure --without-prebuilds=toolchain,sdk ${{ env.GUM_OPTIONS }} + make - desktop: + native: strategy: matrix: - name: - - windows-x86_64 - - windows-x86 - - macos-x86_64 - - linux-x86_64 include: - - name: windows-x86_64 - os: windows - arch: x86_64 - runner: windows-latest - - name: windows-x86 - os: windows - arch: x86 - runner: windows-latest - - name: macos-x86_64 - os: macos - arch: x86_64 - runner: macos-latest - - name: macos-arm64 - os: macos - arch: arm64 - runner: macos-12-arm64 - - name: linux-x86_64 - os: linux - arch: x86_64 - runner: ubuntu-latest + - { name: windows-x86_64, os: windows, arch: x86_64, runner: windows-latest } + - { name: windows-x86, os: windows, arch: x86, runner: windows-latest } + - { name: macos-x86_64, os: macos, arch: x86_64, runner: macos-latest } + - { name: macos-arm64, os: macos, arch: arm64, runner: macos-12-arm64 } + - { name: linux-x86_64, os: linux, arch: x86_64, runner: ubuntu-latest } + - { name: freebsd-arm64, os: freebsd, arch: arm64, runner: '[self-hosted, freebsd, arm64]' } fail-fast: false runs-on: ${{ matrix.runner }} - env: - FRIDA_MESON_OPTIONS: "-Dgumpp=enabled -Dgumjs=enabled -Ddevkits=gum,gumjs" steps: - name: Check out repo uses: actions/checkout@v4 @@ -93,12 +62,12 @@ jobs: - name: Build if: ${{ matrix.os == 'windows' }} run: | - .\configure -- ${Env:FRIDA_MESON_OPTIONS}.Split(' ') + .\configure ${{ env.GUM_OPTIONS }} .\make - name: Build if: ${{ matrix.os != 'windows' }} run: | - ./configure -- $FRIDA_MESON_OPTIONS + ./configure ${{ env.GUM_OPTIONS }} make - name: Upload Gum devkit uses: actions/upload-artifact@v4 @@ -113,131 +82,89 @@ jobs: - name: Test run: make test - linux-x86: - if: false + cross: + strategy: + matrix: + include: + - { id: windows-x86_64-mingw, pkg: g++-mingw-w64-x86-64, opts: '--host=x86_64-w64-mingw32 --without-prebuilds=sdk:host' } + - { id: windows-x86-mingw, pkg: g++-mingw-w64-i686, opts: '--host=i686-w64-mingw32 --without-prebuilds=sdk:host' } + - { os: linux-mips, pkg: g++-mips-linux-gnu, opts: '--host=mips-linux-gnu' } + - { os: linux-mipsel, pkg: g++-mipsel-linux-gnu, opts: '--host=mipsel-linux-gnu' } + - { os: linux-mips64, pkg: g++-mips64-linux-gnuabi64, opts: '--host=mips64-linux-gnuabi64' } + - { os: linux-mips64el, pkg: g++-mips64el-linux-gnuabi64, opts: '--host=mips64el-linux-gnuabi64' } + fail-fast: false runs-on: ubuntu-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install gcc-multilib lib32stdc++-11-dev - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 linux-x86 + submodules: recursive + - name: Install cross compilers + run: sudo apt-get install ${{ matrix.pkg }} - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - --force-fallback-for=glib \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - build - meson compile -C build - - name: Test - run: ./build/tests/gum-tests + ./configure ${{ matrix.opts }} ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-${{ matrix.id }} + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-${{ matrix.id }} + path: build/bindings/gumjs/devkit/ - linux-mips: + linux-x86: runs-on: ubuntu-latest - if: false - strategy: - matrix: - arch: - - id: mips - pkg: g++-mips-linux-gnu - - id: mipsel - pkg: g++-mipsel-linux-gnu - - id: mips64 - pkg: g++-mips64-linux-gnuabi64 - - id: mips64el - pkg: g++-mips64el-linux-gnuabi64 steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Install Python - uses: actions/setup-python@v3 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install ${{ matrix.arch.pkg }} - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 linux-${{ matrix.arch.id }} - - name: Build - run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - freebsd-arm64: - if: false - runs-on: [self-hosted, freebsd, arm64] - steps: - - name: Checkout monorepo - uses: actions/checkout@v3 + submodules: recursive - name: Install dependencies - run: pip install meson==${{ env.MESON_VERSION }} + run: sudo apt-get install gcc-multilib lib32stdc++-11-dev - name: Build run: | - meson setup \ - --default-library static \ - -Doptimization=s \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Db_lundef=false \ - build - meson compile -C build + CC="gcc -m32" CXX="g++ -m32" STRIP="strip" \ + ./configure --host=linux-x86 ${{ env.GUM_OPTIONS }} + make - name: Test - run: ./build/tests/gum-tests + run: make test + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-linux-x86 + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-linux-x86 + path: build/bindings/gumjs/devkit/ ios-arm64: - if: false runs-on: macos-latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh macos-x86_64 ios-arm64 + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - name: Package + ./configure --host=ios-arm64 ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-ios-arm64 + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-ios-arm64 + path: build/bindings/gumjs/devkit/ + - name: Package tests run: tar -C build/tests -czf /tmp/runner.tar.gz gum-tests data/ - name: Test uses: frida/corellium-action@v3 @@ -256,7 +183,6 @@ jobs: android-intel: runs-on: ubuntu-latest - if: false strategy: matrix: arch: [x86, x86_64] @@ -268,29 +194,23 @@ jobs: sudo udevadm control --reload-rules sudo udevadm trigger --name-match=kvm - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 android-${{ matrix.arch }} + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build + ./configure --host=android-${{ matrix.arch }} ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-android-${{ matrix.arch }} + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-android-${{ matrix.arch }} + path: build/bindings/gumjs/devkit/ - name: AVD cache uses: actions/cache@v2 id: avd-cache @@ -308,7 +228,7 @@ jobs: force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: false - script: echo "Generated AVD snapshot for caching." + script: echo 'Generated AVD snapshot for caching.' - name: Test uses: reactivecircus/android-emulator-runner@v2 with: @@ -323,7 +243,6 @@ jobs: adb shell "su root sh -c 'set -ex; cd /data/local/tmp; tar xf runner.tar.gz; TMPDIR=/data/local/tmp ./gum-tests'" android-arm: - if: false runs-on: ubuntu-latest strategy: matrix: @@ -331,30 +250,24 @@ jobs: fail-fast: false steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/checkout@v4 with: - python-version: '${{ env.PYTHON_VERSION }}' - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 android-${{ matrix.arch }} + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build - - name: Package + ./configure --host=android-${{ matrix.arch }} ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-android-${{ matrix.arch }} + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-android-${{ matrix.arch }} + path: build/bindings/gumjs/devkit/ + - name: Package tests run: tar -C build/tests -czf /tmp/runner.tar.gz gum-tests data/ - name: Test uses: frida/corellium-action@v3 @@ -369,31 +282,35 @@ jobs: ./gum-tests qnx-armeabi: - if: false runs-on: ubuntu-latest container: fridadotre/qnx:latest steps: - name: Check out repo - uses: actions/checkout@v3 - - name: Install dependencies - run: | - pip install meson==${{ env.MESON_VERSION }} - .github/env/bootstrap.sh linux-x86_64 qnx-armeabi + uses: actions/checkout@v4 + with: + submodules: recursive - name: Build run: | - export PATH="/tmp/toolchain/bin:$PATH" - meson setup \ - --native-file /tmp/native.txt \ - --cross-file /tmp/cross.txt \ - --default-library static \ - -Doptimization=s \ - -Dwerror=true \ - -Dgumpp=enabled \ - -Dgumjs=enabled \ - -Dtests=enabled \ - build - meson compile -C build + CFLAGS="--sysroot=$QNX_TARGET/armle-v7" \ + ./configure --host=arm-unknown-nto-qnx6.5.0eabi ${{ env.GUM_OPTIONS }} + make + - name: Upload Gum devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gum-devkit-qnx-armeabi + path: build/gum/devkit/ + - name: Upload GumJS devkit + uses: actions/upload-artifact@v4 + with: + name: frida-gumjs-devkit-qnx-armeabi + path: build/bindings/gumjs/devkit/ - name: Test run: | tar -C build/tests -cf /tmp/runner.tar gum-tests data/ /opt/sabrelite/run.sh /tmp/runner.tar /opt/frida/gum-tests + - name: Upload build directory for troubleshooting + if: failure() + uses: actions/upload-artifact@v4 + with: + name: builddir-qnx-armeabi + path: build/