tavianator/bfs

Building for aarch

edshamis opened this issue · 2 comments

I'm trying to build from Termux on Android bad get this

src/pwcache.c:52:18: error: incompatible integer to pointer conversion initializing 'struct passwd *' with an expression of type 'int' [-Wint-conversion]
                struct passwd *ent = getpwent();

uname -a

Linux localhost 4.14.180-perf-ge2a1322887a5 #1 SMP PREEMPT Mon Mar 28 19:47:44 CST 2022 aarch64 Android

Any help would be appreciated

Android only defines getpwent() on API level 26 and above. statx() needs 30 or above. So since 84c672b, this works for me on Termux

~/code/bfs $ make EXTRA_CFLAGS="--target=aarch64-unknown-linux-android30"

statx() isn't absolutely necessary, so I could make it work on Android 26 if there's interest.

eb47b3c fixes the Android build for API level 26. The tests don't run yet because SELinux blocks hard links on recent Android versions.