Compile the adbd-linux project to run on milkv-duo

Hello everyone,

I am a graduate student from National Cheng Kung University. Currently, I am trying to run adbd (Android Debug Bridge Daemon) on the milkv-duo, but I have encountered several issues during the compilation process. The toolchain I am using is the riscv64-linux-musl-x86_64 provided in the duo-sdk.

During the process, I faced numerous issues with header file inclusion. Even though I specified the directory paths for linking during compilation (for example, using the -I option to specify sysroot/usr/include and referencing <sys/cdefs.h>), I still encounter the error: fatal error: sys/cdefs.h: No such file or directory. I would like to understand why this error is occurring and what resources I can refer to for better understanding cross-platform compilation on milkv-duo.

Note: I later discovered that the <sys/cdefs.h> file is not provided under the usr/include directory in duo-sdk, but the compilation issues still persist. What should I be aware of moving forward?

Attachment: adbd-linux

Error Message log:

~/Downloads/adbd-linux-main$ X=/home/ubuntu/Downloads/adbd-linux-main/duo-sdk/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-

~/Downloads/adbd-linux-main$ CROSS_PREFIX=$X make
make -C libcutils
make[1]: Entering directory '/home/ubuntu/Downloads/adbd-linux-main/libcutils'
/home/ubuntu/Downloads/adbd-linux-main/duo-sdk/riscv64-linux-musl-x86_64/bin/riscv64-unknown-linux-musl-gcc -c -fPIC -O2 -g -DANDROID_SMP=1 -I../include -I../libcutils -DHAVE_PTHREADS=1 -DADB_NON_ANDROID=1 -DPROP_NAME_MAX=32 -DPROP_VALUE_MAX=92 -DPROP_ENTRY_MAX=200  properties_nonandroid.c -o properties_nonandroid.o

In file included from properties_nonandroid.c:28:
../include/cutils/properties.h:20:10: fatal error: sys/cdefs.h: No such file or directory
   20 | #include <sys/cdefs.h>
      |          ^~~~~~~~~~~~~
compilation terminated.

make[1]: *** [Makefile:65: properties_nonandroid.o] Error 1
make[1]: Leaving directory '/home/ubuntu/Downloads/adbd-linux-main/libcutils'
make: *** [Makefile:29: libcutils/libcutils.a] Error 2

Thank you.