Skip to content

Commit

Permalink
no lto!
Browse files Browse the repository at this point in the history
  • Loading branch information
fuqiuluo committed Jan 24, 2025
1 parent 29dbbb8 commit 51b1b5b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ on:
jobs:
build:
name: GKI Kernel Module Build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
needs: upload-artifact
env:
CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
CCACHE_NOHASHDIR: "true"
CCACHE_HARDLINK: "true"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -53,12 +57,13 @@ jobs:
with:
arch: ${{ matrix.arch }}
tag: ${{ matrix.tag }}
lto: false
module-name: ovo
module-path: ovo

upload-artifact:
name: Upload LKM Source Code
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down
34 changes: 33 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
module-name:
description: 'Specify the name of the kernel module.'
required: true
lto:
description: 'Enable LTO build.'
type: boolean
required: true

runs:
using: "composite"
Expand Down Expand Up @@ -143,7 +147,8 @@ runs:
cd common/ && git add -A && git commit -a -m "Add Kernel Module"
repo status
- name: Build Kernel
- name: Build Kernel(LTO)
if: ${{ inputs.lto == true }}
shell: bash
working-directory: android-kernel
run: |
Expand All @@ -169,6 +174,33 @@ runs:
fi
fi
- name: Build Kernel(NoLTO)
if: ${{ inputs.lto == false }}
shell: bash
working-directory: android-kernel
run: |
if [[ "${{ inputs.tag }}" == "android16-6.12" ]]; then
if [ "${{ inputs.arch }}" = "aarch64" ]; then
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_aarch64_dist
elif [ "${{ inputs.arch }}" = "x86_64" ]; then
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_x86_64_dist
fi
else
if [ "${{ inputs.arch }}" = "aarch64" ]; then
if [ -e build/build.sh ]; then
LTO=None BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh CC="/usr/bin/ccache clang"
else
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_aarch64_dist -- --dist_dir=dist
fi
elif [ "${{ inputs.arch }}" = "x86_64" ]; then
if [ -e build/build.sh ]; then
LTO=None BUILD_CONFIG=common/build.config.gki.x86_64 build/build.sh CC="/usr/bin/ccache clang"
else
tools/bazel run --disk_cache=/home/runner/.cache/bazel --config=fast --lto=none //common:kernel_x86_64_dist -- --dist_dir=dist
fi
fi
fi
- name: Prepare Artifacts
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion ovo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(MODULE)-objs += kkit.o
$(MODULE)-objs += peekaboo.o
$(MODULE)-objs += memory.o

EXTRA_CFLAGS = -fno-pic
EXTRA_CFLAGS += -fno-pic
EXTRA_CFLAGS += -DHIDE_SELF_MODULE=0 # 是否在模块表中移除自己
EXTRA_CFLAGS += -DBUILD_REMAP=0 # 是否编译内存重映射API(不稳定)
EXTRA_CFLAGS += -DINJECT_SYSCALLS=0 # 是否注入SYSCALL实现反检测
Expand Down
2 changes: 1 addition & 1 deletion ovo/peekaboo.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ void cuteBabyPleaseDontCry(void) {
#endif

#if INJECT_SYSCALLS == 1

#endif
}

0 comments on commit 51b1b5b

Please sign in to comment.