[Bug 8351] New: android_ndk_defconfig fails to compile with Android NDK r10e

bugzilla at busybox.net bugzilla at busybox.net
Fri Sep 18 19:49:14 UTC 2015


https://bugs.busybox.net/show_bug.cgi?id=8351

           Summary: android_ndk_defconfig fails to compile with Android
                    NDK r10e
           Product: Busybox
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: nathan.renniewaldock at gmail.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Created attachment 6166
  --> https://bugs.busybox.net/attachment.cgi?id=6166
Updated android_ndk_defconfig

busybox now fails to compile with the Android NDK using the provided config
(mostly due to changes in busybox's default options).


~/android/apps/busybox/busybox-git$ git log -1 --oneline
8752973 modprobe: handle module arguments containing spaces
~/android/apps/busybox/busybox-git$ export
PATH=/opt/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:$PATH
~/android/apps/busybox/busybox-git$ make android_ndk_defconfig
~/android/apps/busybox/busybox-git$ make -j1
  CC      coreutils/touch.o
coreutils/touch.c: In function 'touch_main':
coreutils/touch.c:171:21: error: 'lutimes' undeclared (first use in this
function)
    (opts & OPT_h) ? lutimes :
                     ^
coreutils/touch.c:171:21: note: each undeclared identifier is reported only
once for each function it appears in
make[1]: *** [coreutils/touch.o] Error 1
make: *** [coreutils] Error 2

FEATURE_TOUCH_NODEREF=n fixes that one.

Next failure:

  CC      networking/udhcp/dhcpc.o
In file included from
/opt/android-ndk/platforms/android-19/arch-arm/usr/include/sys/socket.h:33:0,
                 from
/opt/android-ndk/platforms/android-19/arch-arm/usr/include/netdb.h:66,
                 from include/libbb.h:20,
                 from networking/udhcp/common.h:11,
                 from networking/udhcp/dhcpc.c:24:
networking/udhcp/dhcpc.c: In function 'udhcp_recv_raw_packet':
networking/udhcp/dhcpc.c:848:40: error: invalid application of 'sizeof' to
incomplete type 'struct tpacket_auxdata'
  unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
                                        ^
networking/udhcp/dhcpc.c:911:26: error: 'PACKET_AUXDATA' undeclared (first use
in this function)
    && cmsg->cmsg_type == PACKET_AUXDATA
                          ^
networking/udhcp/dhcpc.c:911:26: note: each undeclared identifier is reported
only once for each function it appears in
networking/udhcp/dhcpc.c:918:11: error: dereferencing pointer to incomplete
type
    if (aux->tp_status & TP_STATUS_CSUMNOTREADY)
           ^
networking/udhcp/dhcpc.c:848:16: warning: unused variable 'cmsgbuf'
[-Wunused-variable]
  unsigned char cmsgbuf[CMSG_LEN(sizeof(struct tpacket_auxdata))];
                ^
networking/udhcp/dhcpc.c: In function 'udhcp_raw_socket':
networking/udhcp/dhcpc.c:1046:35: error: 'PACKET_AUXDATA' undeclared (first use
in this function)
  if (setsockopt_1(fd, SOL_PACKET, PACKET_AUXDATA) != 0) {
                                   ^
make[1]: *** [networking/udhcp/dhcpc.o] Error 1
make: *** [networking/udhcp] Error 2


Adding the patch from #6362 to networking/udhcp/dhcpc.h fixes that.


And finally fails on linking:

  LINK    busybox_unstripped
Trying libraries: c dl gcc m
Failed: -Wl,--start-group  -lc -ldl -lgcc -lm  -Wl,--end-group
Output of:
arm-linux-androideabi-gcc -Wall -Wshadow -Wwrite-strings -Wundef
-Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function
-Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security
-Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen
-finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections
-fno-guess-branch-probability -funsigned-char -static-libgcc
-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1
-fno-unwind-tables -fno-asynchronous-unwind-tables -Os -DANDROID -D__ANDROID__
-DSK_RELEASE -nostdlib -march=armv7-a -msoft-float -mfloat-abi=softfp
-mfpu=neon -mthumb -mthumb-interwork -fpic -fno-short-enums -fgcse-after-reload
-frename-registers --sysroot=/opt/android-ndk/platforms/android-9/arch-arm
-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -dynamic-linker
-Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker
--no-undefined
/opt/android-ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o
/opt/android-ndk/platforms/android-9/arch-arm/usr/lib/crtend_android.o -o
busybox_unstripped -Wl,--start-group applets/built-in.o archival/lib.a
archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a
coreutils/libcoreutils/lib.a debianutils/lib.a e2fsprogs/lib.a editors/lib.a
findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a
mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a
networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a
procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a
util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o
archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o
coreutils/libcoreutils/built-in.o debianutils/built-in.o e2fsprogs/built-in.o
editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o
libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o
miscutils/built-in.o modutils/built-in.o networking/built-in.o
networking/libiproute/built-in.o networking/udhcp/built-in.o
printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o
shell/built-in.o sysklogd/built-in.o util-linux/built-in.o
util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lc -ldl
-lgcc -lm -Wl,--end-group
==========
util-linux/lib.a(mdev.o):mdev.c:function mdev_main: error: undefined reference
to 'sigtimedwait'
coreutils/lib.a(sync.o):sync.c:function sync_main: error: undefined reference
to 'syncfs'
libbb/lib.a(pw_encrypt.o):pw_encrypt.c:function pw_encrypt: error: undefined
reference to 'crypt'
collect2: error: ld returned 1 exit status
make: *** [busybox_unstripped] Error 1


MDEV=n, FEATURE_SYNC_FANCY=n, USE_BB_CRYPT=y

Fixes these errors.

Then it dies with "ld: internal error in do_print_to_mapfile, at
/s/ndk-toolchain/src/build/../binutils/binutils-2.25/gold/output.h:395" due to
Google changing it to use gold linker by default.
Fixed by appending -fuse-ld=bfd to CFLAGS

Updated android_ndk_defconfig and patch for udhcpc attached.

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list