linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.28k stars 999 forks source link

How to compile LTP for Android #983

Open randytian opened 1 year ago

randytian commented 1 year ago

I want to cross compile LTP alone with android/platform/externel/ltp, but I don't know how to config. such as ./configure –prefix=/home/ltp_arm64 ./configure CC=aarch64-linux-gnu-gcc –host=sparc64

indumathiraju commented 1 year ago

Many tests which would otherwise work are currently not built because they share a directory with an incompatible test.

Lets try using these steps for porting: 1.Specify ANDROID=1 when calling make.

2.other variables is inspired by https://gist.githubusercontent.com/nddrylliog/4688209/raw/443e3db88bab4b8e5ed73f2bcf3be853029d68fd/android_configure.sh

3.First create standalone toolchain (with [make-standalone-toolchain.sh] then install it into /opt/android-standalone-toolchain.api-${API} Then build itself: make autotools ./configure --host=${HOST} --with-sysroot=${SYSROOT} make -j$(getconf _NPROCESSORS_ONLN) ANDROID=1 make install

But currently the build fails as many tests needs to be disabled (bionic doesn't support many required features see list of tests needed to be disabled: https://android.googlesource.com/platform/external/ltp/+/master/android/tools/disabled_tests.txt --> made by people from google.

pevik commented 1 year ago

You'd better to ask google folks. I tried to compile with SDK in the past, but not sure if it's still working. IMHO much easier is to download whole aosp and build LTP inside it.