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
I followed instructions for building Toybox with Android NDK.
The newest version I was able to build with NDK (21-25 with API 29-33) was 0.8.7.
Strangely 0.8.5 wouldn't build while 0.8.4 and 0.8.3 did just fine.
Anyone had better luck?
This what I used to build it:
#!/bin/sh -x
#unzip android-ndk-r25c-linux-x86_64.zip
NDK_TC_DIR=~/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin
NDK_TC=aarch64-linux-android-
cd ${NDK_TC_DIR}
test -f ${NDK_TC}cc || ln -s aarch64-linux-android33-clang ${NDK_TC}cc
test -f ${NDK_TC}strip || ln -s llvm-objcopy ${NDK_TC}strip
cd -
export PATH="${NDK_TC_DIR}:$PATH"
make distclean
make LDFLAGS=--static CROSS_COMPILE=${NDK_TC} defconfig toybox
Below is the failed build output of 0.8.9 (0.8.5+ fail with similar errors):
+ make distclean
cleaned
root cleaned
removed .config
+ make LDFLAGS=--static CROSS_COMPILE=aarch64-linux-android- defconfig toybox
cc -o kconfig/conf kconfig/conf.c kconfig/zconf.tab.c -DKBUILD_NO_NLS=1 \
-DPROJECT_NAME=\"ToyBox\"
In file included from kconfig/zconf.tab.c:2340:
kconfig/confdata.c: In function ‘conf_write’:
kconfig/confdata.c:435:34: warning: ‘.tmpconfig.’ directive writing 11 bytes into a region of size between 1 and 128 [-Wformat-overflow=]
435 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~
kconfig/confdata.c:435:17: note: ‘sprintf’ output between 13 and 150 bytes into a destination of size 128
435 | sprintf(tmpname, "%s.tmpconfig.%d", dirname, (int)getpid());
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scripts/genconfig.sh
kconfig/conf -D /dev/null Config.in > /dev/null
scripts/make.sh
Library probe
generated/{Config.in,newtoys.h,flags.h,globals.h,tags.h,help.h}
Compile toybox
..........................toys/lsb/passwd.c:71:45: error: implicit declaration of function 'getspnam' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
if (*(pass = pw->pw_passwd)=='x' && (sp = getspnam(name))) pass = sp->sp_pwdp;
^
toys/lsb/passwd.c:71:43: warning: incompatible integer to pointer conversion assigning to 'struct spwd *' from 'int' [-Wint-conversion]
if (*(pass = pw->pw_passwd)=='x' && (sp = getspnam(name))) pass = sp->sp_pwdp;
^ ~~~~~~~~~~~~~~
toys/lsb/passwd.c:71:71: error: incomplete definition of type 'struct spwd'
if (*(pass = pw->pw_passwd)=='x' && (sp = getspnam(name))) pass = sp->sp_pwdp;
~~^
toys/lsb/passwd.c:58:10: note: forward declaration of 'struct spwd'
struct spwd *sp;
^
toys/lsb/passwd.c:93:14: error: implicit declaration of function 'crypt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
pass = crypt(toybuf+2048, pw->pw_passwd);
^
toys/lsb/passwd.c:93:12: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
pass = crypt(toybuf+2048, pw->pw_passwd);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
toys/lsb/passwd.c:103:17: error: implicit declaration of function 'crypt' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
encrypted = crypt(toybuf, salt);
^
toys/lsb/passwd.c:103:15: warning: incompatible integer to pointer conversion assigning to 'char *' from 'int' [-Wint-conversion]
encrypted = crypt(toybuf, salt);
^ ~~~~~~~~~~~~~~~~~~~
3 warnings and 4 errors generated.
.make: *** [Makefile:17: toybox] Error 1
The text was updated successfully, but these errors were encountered:
eugenesan
changed the title
Unable to build Toybox with NDK after version 0.8.4
Unable to build Toybox with NDK
Jul 28, 2023
eugenesan
changed the title
Unable to build Toybox with NDK
Unable to build Toybox with Android NDK
Jul 28, 2023
Not make defconfig, make android_defconfig. Some commands don't build under the NDK.
The biggest chunk of them is the shadow password stuff, which I have a patch locally to rewrite (fixes ~5 commands I think) but I've bumped that until next release...
I followed instructions for building Toybox with Android NDK.
The newest version I was able to build with NDK (21-25 with API 29-33) was 0.8.7.
Strangely 0.8.5 wouldn't build while 0.8.4 and 0.8.3 did just fine.
Anyone had better luck?
This what I used to build it:
Below is the failed build output of 0.8.9 (0.8.5+ fail with similar errors):
The text was updated successfully, but these errors were encountered: