polygraphene/DirtyPipe-Android

There are error when make the code

Opened this issue · 3 comments

└─$ make
aarch64-linux-android31-clang -Os -nostdlib -c -o stage2-c.o stage2-c.c
aarch64-linux-android31-clang -nostdlib -c -o stage2.o stage2.S
aarch64-linux-android31-clang -T stage2.lds -nostdlib -nostartfiles -static -o stage2 stage2-c.o stage2.o
echo -n "unsigned long stage2_libname_addr = 0x" > stage2-symbol.h
(nm stage2 | grep -e ' T libname'| cut -f 1 -d " " | tr -d $'\n'; echo "UL - 0x2000UL;") >> stage2-symbol.h || (rm stage2-symbol.h; false)
echo -n "unsigned long stage2_root_cmd_addr = 0x" >> stage2-symbol.h
(nm stage2 | grep -e ' T root_cmd'| cut -f 1 -d " " | tr -d $'\n'; echo "UL - 0x2000UL;") >> stage2-symbol.h || (rm stage2-symbol.h; false)
aarch64-linux-android31-clang -O2 -Os -c -o dirtypipe-android.o dirtypipe-android.c
aarch64-linux-android31-clang -O2 -Os -c -o elf-parser.o elf-parser.c
aarch64-linux-android31-clang -c -o stage1.o stage1.S
aarch64-linux-gnu-objcopy -O binary -j .text stage2 stage2.text
aarch64-linux-android31-clang -Os -nostartfiles -o modprobe-payload modprobe-payload.c -llog
modprobe-payload.c:49:24: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
LOGV("Parse: %d %d", root_cmd - cmdline, r - 1);
~~ ^~~~~~~~~~~~~~~~~~
%ld
modprobe-payload.c:24:79: note: expanded from macro 'LOGV'
#define LOGV(...) { __android_log_print(ANDROID_LOG_INFO, "modprobe-payload", VA_ARGS); }
^~~~~~~~~~~
1 warning generated.
llvm-strip modprobe-payload
make: *** No rule to make target '../../p6/kernel/out/android-gs-pixel-5.10/dist/mymod.ko', needed by 'mymod.ko'. Stop.


how to solve the problem tanks!

You can ignore this error.
Remove following 2 lines, then re-run make.

mymod.ko: $(MYMOD_COPY)
cp $(MYMOD_COPY) mymod.ko

I alse came across a error:

clang-14: error: no input files
make: *** [Makefile:29: stage2-c.o] Error 1

I used android-ndk-r25b, how to sovle this problem? Thanks

How to build this code for x86_64 Android 12 emulator