Closed maldiohead closed 4 years ago
I linked the libhwui.so, I don't know why still occur error
SkCodec::MakeFromStream(std::__1::unique_ptr<SkStream, std::__1::default_delete<SkStream> >, SkCodec::Result*, SkPngChunkReader*, SkCodec::SelectionPolicy)' loader.o: In function
SkImageInfo::bytesPerPixel() const':
loader.cc:(.text._ZNK11SkImageInfo13bytesPerPixelEv[_ZNK11SkImageInfo13bytesPerPixelEv]+0x14): undefined reference to `SkColorInfo::bytesPerPixel() const'
Hi, I ran into the same problem, did you solve it?
loader.o: In function
ProcessImage()':
loader.cc:(.text+0x370): undefined reference to SkCodec::MakeFromStream(std::__1::unique_ptr<SkStream, std::__1::default_delete<SkStream> >, SkCodec::Result*, SkPngChunkReader*, SkCodec::SelectionPolicy)' loader.o: In function
SkImageInfo::bytesPerPixel() const':
loader.cc:(.text._ZNK11SkImageInfo13bytesPerPixelEv[_ZNK11SkImageInfo13bytesPerPixelEv]+0x14): undefined reference to SkColorInfo::bytesPerPixel() const' /SkCodecFuzz/deps/capstone-4.0.2/libcapstone.a(AArch64BaseInfo.o): In function
A64NamedImmMapper_fromString':
AArch64BaseInfo.c:(.text+0xc8): undefined reference to __ctype_tolower_loc' clang++: error: linker command failed with exit code 1 (use -v to see invocation)
The MakeFromStream error happens because in libhwu.so MakeFromStream expects 3 arguments while the one in SkCodec.h defines MakeFromStream to have 4 arguments.
The ByteFromPixel error afaik was because libhwui.so expects it to be declared as a prototype inside SkCodec while in the newest version its completely declared. To fix these problems I just pulled this android-10 version instead: https://github.com/google/skia/tree/android/10-release
About the capstone A64NamedImmMapper_fromString error I just uncommented the A64NamedImmMapper_fromString function completely inside 4.0.1-capstone/AArch64/AArch64BaseInfo.c
The MakeFromStream error happens because in libhwu.so MakeFromStream expects 3 arguments while the one in SkCodec.h defines MakeFromStream to have 4 arguments.
The ByteFromPixel error afaik was because libhwui.so expects it to be declared as a prototype inside SkCodec while in the newest version its completely declared. To fix these problems I just pulled this android-10 version instead: https://github.com/google/skia/tree/android/10-release
About the capstone A64NamedImmMapper_fromString error I just uncommented the A64NamedImmMapper_fromString function completely inside 4.0.1-capstone/AArch64/AArch64BaseInfo.c
it's helpful.thank you very much~!
After I've done these three suggestions, I still have one issue.
make
/home/ubuntu/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ -c -o loader.o loader.cc -D_LIBCPP_ABI_NAMESPACE=__1 -I/home/ubuntu/disk1/SkCodecFuzzer/skia/include/core -I/home/ubuntu/disk1/SkCodecFuzzer/skia/include/codec -I/home/ubuntu/disk1/SkCodecFuzzer/skia/include/config -I/home/ubuntu/disk1/SkCodecFuzzer/skia/include/config/android -I/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/include -I/home/ubuntu/disk1/SkCodecFuzzer/libbacktrace/include
/home/ubuntu/Android/Sdk/ndk/android-ndk-r20b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android29-clang++ -o loader loader.o common.o tokenizer.o libdislocator.o -L/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1 -lcapstone -L/home/ubuntu/disk1/SkCodecFuzzer/system/lib64 -lhwui -ldl -lbacktrace -landroidicu -Wl,-rpath -Wl,/home/ubuntu/disk1/SkCodecFuzzer/system/lib64 -Wl,--dynamic-linker=/home/ubuntu/disk1/SkCodecFuzzer/system/bin/linker64
/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/libcapstone.a(M680XDisassembler.o): In function `loop_hdlr':
M680XDisassembler.c:(.text+0x490): undefined reference to `__fprintf_chk'
/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/libcapstone.a(M680XDisassembler.o): In function `reg_bits_hdlr':
M680XDisassembler.c:(.text+0x798): undefined reference to `__fprintf_chk'
/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/libcapstone.a(M680XDisassembler.o): In function `imm_rel_hdlr':
M680XDisassembler.c:(.text+0xbf8): undefined reference to `__fprintf_chk'
/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/libcapstone.a(M680XDisassembler.o): In function `immediate_hdlr':
M680XDisassembler.c:(.text+0x22c8): undefined reference to `__fprintf_chk'
/home/ubuntu/disk1/SkCodecFuzzer/capstone-4.0.1/libcapstone.a(M680XDisassembler.o): In function `M680X_getInstruction':
M680XDisassembler.c:(.text+0x39c4): undefined reference to `__fprintf_chk'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:23: recipe for target 'loader' failed
make: *** [loader] Error 1
@IHbib Mr. Big, any suggestions to this issue?
@wlya Build capstone for only the target arch. i.e for arm64 use: CAPSTONE_ARCHS=aarch64
Full commandline: CAPSTONE_ARCHS=aarch64 CAPSTONE_BUILD_CORE_ONLY=yes ./make.sh cross-android64