You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Ubuntu, I used NDK version 27 to compile fio version 3.38 and generated libfio.so. However, when using System.load("fio") in the app, it crashes with the following error:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "device_is_mounted" referenced by "/data/app/com.example.performance_check-HXHM-fAkeyw52mI75oDcVw==/lib/x86_64/libfio.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1041)
at java.lang.System.loadLibrary(System.java:1675)
When analyzing the exported methods of libfio.so, I found that some methods are marked as NOTYPE. The command and its output are as follows:
readelf -s libfio.so | grep NOTYPE
Output:
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
13: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND device_is_mounted
14: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND buf_output_init
15: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND buf_output_free
32: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __fio_memfree
35: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND fio_getrusage
45: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND __fio_memalign
55: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND logf
61: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND blktrace_lookup_[...]
64: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND unpack754
66: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND pack754
86: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND inflateInit_
87: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND inflate
88: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND inflateEnd
The text was updated successfully, but these errors were encountered:
I am not familiar with building/running fio on Android but I asked my colleague Jinyoung Choi to look at this and this is his assessment:
The reason why it appears as "NOTYPE" is that, of course, the device_is_mounted function is included in the lib/mountcheck.o object.
When doing CC, it was performed on "*.o", so the objects of the sub-folders were not included together.
$CC $CFLAGS $LDFLAGS *.o -o libfio.so --> $CC $CFLAGS $LDFLAGS *.o lib/*.o -o libfio.so (This is not enough....)
(the additional amount of objects will be reduced only when you build by giving disable hints about unnecessary contents in configuration.)
(I think to make fio a library, you need to modify header exposure (extern "c"{}) and Makefile well ...)
Anyway, in the case of fio, I have not seen the case of making it into a library and using it.
I want to know what it is for.
functions called in libfio.c do not expose functions in the form of below, so they must be added manually.
On Ubuntu, I used NDK version 27 to compile fio version 3.38 and generated libfio.so. However, when using System.load("fio") in the app, it crashes with the following error:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "device_is_mounted" referenced by "/data/app/com.example.performance_check-HXHM-fAkeyw52mI75oDcVw==/lib/x86_64/libfio.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1041)
at java.lang.System.loadLibrary(System.java:1675)
The build script is as follows:
NDK_PATH="/home/work/work-space/android-ndk-r27c"
CC="${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang"
AR="${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar"
export CC
export AR
CFLAGS="-fPIC -DANDROID -fvisibility=hidden"
LDFLAGS="-shared -Wl"
make clean
make CFLAGS="$CFLAGS"
$CC $CFLAGS $LDFLAGS *.o -o libfio.so
When analyzing the exported methods of libfio.so, I found that some methods are marked as NOTYPE. The command and its output are as follows:
readelf -s libfio.so | grep NOTYPE
Output:
The text was updated successfully, but these errors were encountered: