Update for new NDK versions

This commit is contained in:
topjohnwu 2018-12-25 18:25:08 +08:00
parent b156fd269a
commit 588015da24
8 changed files with 114 additions and 498 deletions

1
.gitignore vendored
View File

@ -2,4 +2,3 @@ busybox
toybox
libs
obj
busybox_patches

View File

@ -1,380 +0,0 @@
From: topjohnwu <topjohnwu@gmail.com>
Date: Sat, 19 May 2018 15:43:47 +0800
Subject: [PATCH] Minor adjustments to support ndk-build
---
archival/libarchive/Kbuild.src | 11 +----------
include/libbb.h | 1 +
include/platform.h | 9 ++++++++-
libbb/getopt32.c | 2 +-
libbb/missing_syscalls.c | 2 +-
libbb/semctl.c | 4 ++--
networking/ether-wake.c | 1 +
networking/ether_aton_r.c | 1 +
networking/ether_ntoa_r.c | 1 +
networking/libiproute/libnetlink.h | 1 +
networking/traceroute.c | 3 ++-
networking/udhcp/common.h | 2 ++
networking/udhcp/dhcpd.c | 2 --
networking/zcip.c | 1 +
shell/glob.h | 6 +++---
util-linux/getopt.c | 2 +-
util-linux/ipcrm.c | 2 +-
util-linux/ipcs.c | 6 +++---
util-linux/setpriv.c | 3 ++-
util-linux/switch_root.c | 4 ++--
20 files changed, 35 insertions(+), 29 deletions(-)
diff --git a/archival/libarchive/Kbuild.src b/archival/libarchive/Kbuild.src
index e1a8a7529..1679e78bc 100644
--- a/archival/libarchive/Kbuild.src
+++ b/archival/libarchive/Kbuild.src
@@ -29,16 +29,7 @@ COMMON_FILES:= \
find_list_entry.o \
init_handle.o
-DPKG_FILES:= \
- unpack_ar_archive.o \
- filter_accept_list_reassign.o \
- unsafe_prefix.o \
- get_header_ar.o \
- get_header_tar.o \
- get_header_tar_gz.o \
- get_header_tar_bz2.o \
- get_header_tar_lzma.o \
- get_header_tar_xz.o \
+DPKG_FILES:=
INSERT
diff --git a/include/libbb.h b/include/libbb.h
index a28f49d3d..a3a40c5b2 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -10,6 +10,7 @@
#ifndef LIBBB_H
#define LIBBB_H 1
+#include "autoconf.h"
#include "platform.h"
#include <ctype.h>
diff --git a/include/platform.h b/include/platform.h
index 9e9ffa782..f813b956c 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -7,6 +7,13 @@
#ifndef BB_PLATFORM_H
#define BB_PLATFORM_H 1
+/* Check for NDK version */
+#ifdef __ANDROID__
+# include <android/api-level.h>
+# ifdef __ANDROID_NDK__
+# include <android/ndk-version.h>
+# endif
+#endif
/* Convenience macros to test the version of gcc. */
#undef __GNUC_PREREQ
@@ -120,7 +127,7 @@
* (-DFAST_FUNC= )
*/
#ifndef FAST_FUNC
-# if __GNUC_PREREQ(3,0) && defined(i386)
+# if !defined(__ANDROID__) && __GNUC_PREREQ(3,0) && defined(i386)
/* stdcall makes callee to pop arguments from stack, not caller */
# define FAST_FUNC __attribute__((regparm(3),stdcall))
/* #elif ... - add your favorite arch today! */
diff --git a/libbb/getopt32.c b/libbb/getopt32.c
index 378510063..b8ed3dba3 100644
--- a/libbb/getopt32.c
+++ b/libbb/getopt32.c
@@ -6,10 +6,10 @@
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
+#include "libbb.h"
#if ENABLE_LONG_OPTS
# include <getopt.h>
#endif
-#include "libbb.h"
//kbuild:lib-y += getopt32.o
diff --git a/libbb/missing_syscalls.c b/libbb/missing_syscalls.c
index 6e81a1729..a98efad23 100644
--- a/libbb/missing_syscalls.c
+++ b/libbb/missing_syscalls.c
@@ -142,7 +142,7 @@ int semop(int semid, struct sembuf *sops, unsigned nsops)
return syscall(__NR_semop, semid, sops, nsops);
}
-# if __ANDROID_API__ < 21
+# if __ANDROID_API__ < 21 && __NDK_MAJOR__ < 16
int tcdrain(int fd)
{
return ioctl(fd, TCSBRK, 1);
diff --git a/libbb/semctl.c b/libbb/semctl.c
index 5ddd07f3c..85183bb7b 100644
--- a/libbb/semctl.c
+++ b/libbb/semctl.c
@@ -22,10 +22,10 @@
// syscall used by syslogd, ipcrm, ipcs
//kbuild:lib-y += semctl.o
+#include "libbb.h"
#include <sys/syscall.h> /* For __NR_xxx definitions */
#include <stdarg.h>
-#include <linux/sem.h>
-#include "libbb.h"
+#include <sys/sem.h>
#ifndef __NR_semctl
#define __NR_semctl 66
diff --git a/networking/ether-wake.c b/networking/ether-wake.c
index 3b9ff730e..878c9d334 100644
--- a/networking/ether-wake.c
+++ b/networking/ether-wake.c
@@ -87,6 +87,7 @@
#include "libbb.h"
#include <netpacket/packet.h>
+#include <net/ethernet.h>
#include <netinet/ether.h>
#include <netinet/if_ether.h>
#include <linux/if.h>
diff --git a/networking/ether_aton_r.c b/networking/ether_aton_r.c
index 0215f16d4..c762b5775 100644
--- a/networking/ether_aton_r.c
+++ b/networking/ether_aton_r.c
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <sys/types.h>
+#include <net/ethernet.h>
#include <netinet/ether.h>
#include <netinet/if_ether.h>
diff --git a/networking/ether_ntoa_r.c b/networking/ether_ntoa_r.c
index cd5061434..0749129b2 100644
--- a/networking/ether_ntoa_r.c
+++ b/networking/ether_ntoa_r.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <stdio.h>
+#include <net/ethernet.h>
#include <netinet/ether.h>
#include <netinet/if_ether.h>
diff --git a/networking/libiproute/libnetlink.h b/networking/libiproute/libnetlink.h
index 51bee2d67..bb760fd5a 100644
--- a/networking/libiproute/libnetlink.h
+++ b/networking/libiproute/libnetlink.h
@@ -7,6 +7,7 @@
* in linux/[rt]netlink.h. 2.6.19 seems to be ok, though */
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
+#include <linux/if_ether.h>
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
diff --git a/networking/traceroute.c b/networking/traceroute.c
index a027b928a..1182cbfe2 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -299,6 +299,8 @@
#define TRACEROUTE_SO_DEBUG 0
+#include "libbb.h"
+
#include <net/if.h>
#include <arpa/inet.h>
#include <netinet/in.h>
@@ -316,7 +318,6 @@
# endif
#endif
-#include "libbb.h"
#include "inet_common.h"
#ifndef IPPROTO_ICMP
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index 50ea9199b..6119bde44 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -10,8 +10,10 @@
#include "libbb.h"
#include "common_bufsiz.h"
+#include <net/ethernet.h>
#include <netinet/udp.h>
#include <netinet/ip.h>
+#include <linux/if_ether.h>
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
diff --git a/networking/udhcp/dhcpd.c b/networking/udhcp/dhcpd.c
index 60950ffda..d169e1042 100644
--- a/networking/udhcp/dhcpd.c
+++ b/networking/udhcp/dhcpd.c
@@ -42,8 +42,6 @@
#include <netinet/ether.h>
#include <syslog.h>
-#include "../ether_port.h"
-
#include "common.h"
#include "dhcpc.h"
#include "dhcpd.h"
diff --git a/networking/zcip.c b/networking/zcip.c
index 748168472..c6e7c9393 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -57,6 +57,7 @@
#include "libbb.h"
#include "common_bufsiz.h"
#include <netinet/ether.h>
+#include <net/ethernet.h>
#include <net/if.h>
#include <net/if_arp.h>
#include <linux/sockios.h>
diff --git a/shell/glob.h b/shell/glob.h
index e8e65786d..c274a8f6a 100644
--- a/shell/glob.h
+++ b/shell/glob.h
@@ -47,7 +47,7 @@
#include <sys/cdefs.h>
//#include <sys/_types.h>
-#ifndef _SIZE_T_DECLARED
+#if !defined(_SIZE_T_DECLARED) && !defined(__ANDROID__)
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
@@ -74,7 +74,7 @@ typedef struct {
int (*gl_stat)(const char *, struct stat *);
} glob_t;
-#if __POSIX_VISIBLE >= 199209
+#if __POSIX_VISIBLE >= 199209 || defined(__ANDROID__)
/* Believed to have been introduced in 1003.2-1992 */
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
@@ -91,7 +91,7 @@ typedef struct {
#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
#endif /* __POSIX_VISIBLE >= 199209 */
-#if __BSD_VISIBLE
+#if __BSD_VISIBLE || defined(__ANDROID__)
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 4431a7e74..7c5689c99 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -105,10 +105,10 @@
//usage: " esac\n"
//usage: "done\n"
+#include "libbb.h"
#if ENABLE_FEATURE_GETOPT_LONG
# include <getopt.h>
#endif
-#include "libbb.h"
/* NON_OPT is the code that is returned when a non-option is found in '+'
mode */
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index a93ceee11..6335985e1 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -28,7 +28,7 @@
#include <sys/msg.h>
#include <sys/sem.h>
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__ANDROID__)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c
index 4863a5c29..a0e248874 100644
--- a/util-linux/ipcs.c
+++ b/util-linux/ipcs.c
@@ -19,6 +19,8 @@
//kbuild:lib-$(CONFIG_IPCS) += ipcs.o
+#include "libbb.h"
+
/* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */
/* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */
/* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */
@@ -28,8 +30,6 @@
#include <sys/msg.h>
#include <sys/shm.h>
-#include "libbb.h"
-
/*-------------------------------------------------------------------*/
/* SHM_DEST and SHM_LOCKED are defined in kernel headers,
but inside #ifdef __KERNEL__ ... #endif */
@@ -72,7 +72,7 @@ struct shm_info {
/* The last arg of semctl is a union semun, but where is it defined?
X/OPEN tells us to define it ourselves, but until recently
Linux include files would also define it. */
-#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)
+#if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) || defined(__ANDROID__)
/* union semun is defined by including <sys/sem.h> */
#else
/* according to X/OPEN we have to define it ourselves */
diff --git a/util-linux/setpriv.c b/util-linux/setpriv.c
index af079fae8..930b068c2 100644
--- a/util-linux/setpriv.c
+++ b/util-linux/setpriv.c
@@ -78,6 +78,8 @@
// --selinux-label <label> set SELinux label
// --apparmor-profile <pr> set AppArmor profile
+#include "libbb.h"
+
#if ENABLE_FEATURE_SETPRIV_CAPABILITIES
#include <linux/capability.h>
// #include <sys/capability.h>
@@ -90,7 +92,6 @@ extern int capget(cap_user_header_t header, const cap_user_data_t data);
// This way, libcap needs not be installed in build environment.
#endif
#include <sys/prctl.h>
-#include "libbb.h"
#ifndef PR_CAPBSET_READ
#define PR_CAPBSET_READ 23
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c
index 947dd0cdc..f6c61ecfc 100644
--- a/util-linux/switch_root.c
+++ b/util-linux/switch_root.c
@@ -35,6 +35,8 @@
//kbuild:lib-$(CONFIG_SWITCH_ROOT) += switch_root.o
//kbuild:lib-$(CONFIG_RUN_INIT) += switch_root.o
+#include "libbb.h"
+
#include <sys/vfs.h>
#include <sys/mount.h>
#if ENABLE_RUN_INIT
@@ -56,8 +58,6 @@ extern int capget(cap_user_header_t header, const cap_user_data_t data);
// This way, libcap needs not be installed in build environment.
#endif
-#include "libbb.h"
-
// Make up for header deficiencies
#ifndef RAMFS_MAGIC
# define RAMFS_MAGIC ((unsigned)0x858458f6)
--
2.17.1

View File

@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Busybox version: 1.29.2
# Sun Aug 12 17:35:38 2018
# Busybox version: 1.29.3
# Sun Nov 18 01:20:51 2018
#
CONFIG_HAVE_DOT_CONFIG=y
@ -48,7 +48,7 @@ CONFIG_STATIC=y
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
CONFIG_CROSS_COMPILER_PREFIX=""
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -Os -fno-short-enums -fgcse-after-reload -frename-registers -fno-builtin-stpcpy -fuse-ld=bfd"
CONFIG_EXTRA_CFLAGS="-DANDROID -D__ANDROID__ -D__ANDROID_API__=21 -DSK_RELEASE -Os -fno-short-enums -fgcse-after-reload -frename-registers -fno-builtin-stpcpy -fuse-ld=bfd"
CONFIG_EXTRA_LDFLAGS=""
CONFIG_EXTRA_LDLIBS=""
# CONFIG_USE_PORTABLE_CODE is not set
@ -208,7 +208,7 @@ CONFIG_FEATURE_CP_LONG_OPTIONS=y
CONFIG_CUT=y
CONFIG_DATE=y
CONFIG_FEATURE_DATE_ISOFMT=y
# CONFIG_FEATURE_DATE_NANO is not set
CONFIG_FEATURE_DATE_NANO=y
CONFIG_FEATURE_DATE_COMPAT=y
CONFIG_DD=y
CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
@ -271,7 +271,7 @@ CONFIG_MV=y
CONFIG_NICE=y
CONFIG_NL=y
CONFIG_NOHUP=y
# CONFIG_NPROC is not set
CONFIG_NPROC=y
CONFIG_OD=y
CONFIG_PASTE=y
CONFIG_PRINTENV=y
@ -360,14 +360,10 @@ CONFIG_DEALLOCVT=y
CONFIG_DUMPKMAP=y
CONFIG_FGCONSOLE=y
CONFIG_KBD_MODE=y
CONFIG_LOADFONT=y
CONFIG_SETFONT=y
CONFIG_FEATURE_SETFONT_TEXTUAL_MAP=y
# CONFIG_LOADFONT is not set
# CONFIG_SETFONT is not set
# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
CONFIG_DEFAULT_SETFONT_DIR=""
#
# Common options for loadfont and setfont
#
# CONFIG_FEATURE_LOADFONT_PSF2 is not set
# CONFIG_FEATURE_LOADFONT_RAW is not set
CONFIG_LOADKMAP=y
@ -469,7 +465,7 @@ CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y
CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y
CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y
CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
# CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set
CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
CONFIG_FEATURE_XARGS_SUPPORT_PARALLEL=y
CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y
@ -480,9 +476,9 @@ CONFIG_FEATURE_XARGS_SUPPORT_ARGS_FILE=y
# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
# CONFIG_HALT is not set
CONFIG_POWEROFF=y
CONFIG_REBOOT=y
CONFIG_FEATURE_WAIT_FOR_INIT=y
# CONFIG_POWEROFF is not set
# CONFIG_REBOOT is not set
# CONFIG_FEATURE_WAIT_FOR_INIT is not set
# CONFIG_FEATURE_CALL_TELINIT is not set
CONFIG_TELINIT_PATH=""
# CONFIG_INIT is not set
@ -609,7 +605,7 @@ CONFIG_FINDFS=y
CONFIG_FLOCK=y
CONFIG_FDFLUSH=y
CONFIG_FREERAMDISK=y
CONFIG_FSCK_MINIX=y
# CONFIG_FSCK_MINIX is not set
CONFIG_FSFREEZE=y
CONFIG_FSTRIM=y
CONFIG_GETOPT=y
@ -621,8 +617,8 @@ CONFIG_XXD=y
CONFIG_HWCLOCK=y
# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set
CONFIG_IONICE=y
CONFIG_IPCRM=y
CONFIG_IPCS=y
# CONFIG_IPCRM is not set
# CONFIG_IPCS is not set
# CONFIG_LAST is not set
# CONFIG_FEATURE_LAST_FANCY is not set
CONFIG_LOSETUP=y
@ -638,8 +634,8 @@ CONFIG_MESG=y
CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y
CONFIG_MKE2FS=y
CONFIG_MKFS_EXT2=y
CONFIG_MKFS_MINIX=y
CONFIG_FEATURE_MINIX2=y
# CONFIG_MKFS_MINIX is not set
# CONFIG_FEATURE_MINIX2 is not set
CONFIG_MKFS_REISER=y
CONFIG_MKDOSFS=y
CONFIG_MKFS_VFAT=y
@ -743,7 +739,7 @@ CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y
CONFIG_FEATURE_CHAT_SEND_ESCAPES=y
CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
CONFIG_FEATURE_CHAT_CLR_ABORT=y
CONFIG_CONSPY=y
# CONFIG_CONSPY is not set
CONFIG_CROND=y
CONFIG_FEATURE_CROND_D=y
CONFIG_FEATURE_CROND_CALL_SENDMAIL=y
@ -804,7 +800,7 @@ CONFIG_RAIDAUTORUN=y
CONFIG_RFKILL=y
# CONFIG_RUNLEVEL is not set
CONFIG_RX=y
# CONFIG_SETFATTR is not set
CONFIG_SETFATTR=y
CONFIG_SETSERIAL=y
CONFIG_STRINGS=y
CONFIG_TIME=y
@ -822,9 +818,9 @@ CONFIG_WATCHDOG=y
#
# Networking Utilities
#
CONFIG_FEATURE_IPV6=y
# CONFIG_FEATURE_IPV6 is not set
CONFIG_FEATURE_UNIX_LOCAL=y
CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set
CONFIG_VERBOSE_RESOLUTION_ERRORS=y
CONFIG_ARP=y
CONFIG_ARPING=y
@ -832,11 +828,11 @@ CONFIG_BRCTL=y
CONFIG_FEATURE_BRCTL_FANCY=y
CONFIG_FEATURE_BRCTL_SHOW=y
CONFIG_DNSD=y
CONFIG_ETHER_WAKE=y
CONFIG_FTPD=y
CONFIG_FEATURE_FTPD_WRITE=y
CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y
CONFIG_FEATURE_FTPD_AUTHENTICATION=y
# CONFIG_ETHER_WAKE is not set
# CONFIG_FTPD is not set
# CONFIG_FEATURE_FTPD_WRITE is not set
# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
# CONFIG_FEATURE_FTPD_AUTHENTICATION is not set
CONFIG_FTPGET=y
CONFIG_FTPPUT=y
CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS=y
@ -867,7 +863,7 @@ CONFIG_IFDOWN=y
CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
CONFIG_FEATURE_IFUPDOWN_IP=y
CONFIG_FEATURE_IFUPDOWN_IPV4=y
CONFIG_FEATURE_IFUPDOWN_IPV6=y
# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set
CONFIG_FEATURE_IFUPDOWN_MAPPING=y
CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
CONFIG_INETD=y
@ -907,14 +903,14 @@ CONFIG_NC_110_COMPAT=y
CONFIG_NETSTAT=y
CONFIG_FEATURE_NETSTAT_WIDE=y
CONFIG_FEATURE_NETSTAT_PRG=y
CONFIG_NSLOOKUP=y
CONFIG_FEATURE_NSLOOKUP_BIG=y
CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS=y
# CONFIG_NSLOOKUP is not set
# CONFIG_FEATURE_NSLOOKUP_BIG is not set
# CONFIG_FEATURE_NSLOOKUP_LONG_OPTIONS is not set
# CONFIG_NTPD is not set
# CONFIG_FEATURE_NTPD_SERVER is not set
# CONFIG_FEATURE_NTPD_CONF is not set
CONFIG_PING=y
CONFIG_PING6=y
# CONFIG_PING6 is not set
CONFIG_FEATURE_FANCY_PING=y
CONFIG_PSCAN=y
CONFIG_ROUTE=y
@ -944,7 +940,7 @@ CONFIG_FEATURE_TFTP_BLOCKSIZE=y
# CONFIG_TFTP_DEBUG is not set
CONFIG_TLS=y
CONFIG_TRACEROUTE=y
CONFIG_TRACEROUTE6=y
# CONFIG_TRACEROUTE6 is not set
CONFIG_FEATURE_TRACEROUTE_VERBOSE=y
CONFIG_FEATURE_TRACEROUTE_USE_ICMP=y
CONFIG_TUNCTL=y
@ -956,9 +952,9 @@ CONFIG_FEATURE_WGET_STATUSBAR=y
CONFIG_FEATURE_WGET_AUTHENTICATION=y
CONFIG_FEATURE_WGET_TIMEOUT=y
CONFIG_FEATURE_WGET_HTTPS=y
# CONFIG_FEATURE_WGET_OPENSSL is not set
CONFIG_FEATURE_WGET_OPENSSL=y
CONFIG_WHOIS=y
CONFIG_ZCIP=y
# CONFIG_ZCIP is not set
CONFIG_UDHCPD=y
CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC=y
CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y
@ -969,11 +965,11 @@ CONFIG_UDHCPC=y
CONFIG_FEATURE_UDHCPC_ARPING=y
CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
CONFIG_UDHCPC6=y
CONFIG_FEATURE_UDHCPC6_RFC3646=y
CONFIG_FEATURE_UDHCPC6_RFC4704=y
CONFIG_FEATURE_UDHCPC6_RFC4833=y
CONFIG_FEATURE_UDHCPC6_RFC5970=y
# CONFIG_UDHCPC6 is not set
# CONFIG_FEATURE_UDHCPC6_RFC3646 is not set
# CONFIG_FEATURE_UDHCPC6_RFC4704 is not set
# CONFIG_FEATURE_UDHCPC6_RFC4833 is not set
# CONFIG_FEATURE_UDHCPC6_RFC5970 is not set
#
# Common options for DHCP applets
@ -1104,41 +1100,41 @@ CONFIG_ASH_HELP=y
CONFIG_ASH_GETOPTS=y
CONFIG_ASH_CMDCMD=y
CONFIG_CTTYHACK=y
CONFIG_HUSH=y
CONFIG_HUSH_BASH_COMPAT=y
CONFIG_HUSH_BRACE_EXPANSION=y
CONFIG_HUSH_LINENO_VAR=y
# CONFIG_HUSH is not set
# CONFIG_HUSH_BASH_COMPAT is not set
# CONFIG_HUSH_BRACE_EXPANSION is not set
# CONFIG_HUSH_LINENO_VAR is not set
# CONFIG_HUSH_BASH_SOURCE_CURDIR is not set
CONFIG_HUSH_INTERACTIVE=y
# CONFIG_HUSH_INTERACTIVE is not set
# CONFIG_HUSH_SAVEHISTORY is not set
CONFIG_HUSH_JOB=y
CONFIG_HUSH_TICK=y
CONFIG_HUSH_IF=y
CONFIG_HUSH_LOOPS=y
CONFIG_HUSH_CASE=y
CONFIG_HUSH_FUNCTIONS=y
CONFIG_HUSH_LOCAL=y
CONFIG_HUSH_RANDOM_SUPPORT=y
CONFIG_HUSH_MODE_X=y
CONFIG_HUSH_ECHO=y
CONFIG_HUSH_PRINTF=y
CONFIG_HUSH_TEST=y
CONFIG_HUSH_HELP=y
CONFIG_HUSH_EXPORT=y
CONFIG_HUSH_EXPORT_N=y
CONFIG_HUSH_READONLY=y
CONFIG_HUSH_KILL=y
CONFIG_HUSH_WAIT=y
CONFIG_HUSH_COMMAND=y
CONFIG_HUSH_TRAP=y
CONFIG_HUSH_TYPE=y
CONFIG_HUSH_TIMES=y
CONFIG_HUSH_READ=y
CONFIG_HUSH_SET=y
CONFIG_HUSH_UNSET=y
CONFIG_HUSH_ULIMIT=y
CONFIG_HUSH_UMASK=y
CONFIG_HUSH_GETOPTS=y
# CONFIG_HUSH_JOB is not set
# CONFIG_HUSH_TICK is not set
# CONFIG_HUSH_IF is not set
# CONFIG_HUSH_LOOPS is not set
# CONFIG_HUSH_CASE is not set
# CONFIG_HUSH_FUNCTIONS is not set
# CONFIG_HUSH_LOCAL is not set
# CONFIG_HUSH_RANDOM_SUPPORT is not set
# CONFIG_HUSH_MODE_X is not set
# CONFIG_HUSH_ECHO is not set
# CONFIG_HUSH_PRINTF is not set
# CONFIG_HUSH_TEST is not set
# CONFIG_HUSH_HELP is not set
# CONFIG_HUSH_EXPORT is not set
# CONFIG_HUSH_EXPORT_N is not set
# CONFIG_HUSH_READONLY is not set
# CONFIG_HUSH_KILL is not set
# CONFIG_HUSH_WAIT is not set
# CONFIG_HUSH_COMMAND is not set
# CONFIG_HUSH_TRAP is not set
# CONFIG_HUSH_TYPE is not set
# CONFIG_HUSH_TIMES is not set
# CONFIG_HUSH_READ is not set
# CONFIG_HUSH_SET is not set
# CONFIG_HUSH_UNSET is not set
# CONFIG_HUSH_ULIMIT is not set
# CONFIG_HUSH_UMASK is not set
# CONFIG_HUSH_GETOPTS is not set
# CONFIG_HUSH_MEMLEAK is not set
#
@ -1155,21 +1151,17 @@ CONFIG_FEATURE_SH_HISTFILESIZE=y
#
# System Logging Utilities
#
CONFIG_KLOGD=y
#
# klogd should not be used together with syslog to kernel printk buffer
#
CONFIG_FEATURE_KLOGD_KLOGCTL=y
# CONFIG_KLOGD is not set
# CONFIG_FEATURE_KLOGD_KLOGCTL is not set
# CONFIG_LOGGER is not set
CONFIG_LOGREAD=y
CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
CONFIG_SYSLOGD=y
CONFIG_FEATURE_ROTATE_LOGFILE=y
CONFIG_FEATURE_REMOTE_LOG=y
CONFIG_FEATURE_SYSLOGD_DUP=y
CONFIG_FEATURE_SYSLOGD_CFG=y
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
CONFIG_FEATURE_IPC_SYSLOG=y
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=16
CONFIG_FEATURE_KMSG_SYSLOG=y
# CONFIG_LOGREAD is not set
# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set
# CONFIG_SYSLOGD is not set
# CONFIG_FEATURE_ROTATE_LOGFILE is not set
# CONFIG_FEATURE_REMOTE_LOG is not set
# CONFIG_FEATURE_SYSLOGD_DUP is not set
# CONFIG_FEATURE_SYSLOGD_CFG is not set
CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0
# CONFIG_FEATURE_IPC_SYSLOG is not set
CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0
# CONFIG_FEATURE_KMSG_SYSLOG is not set

View File

@ -3,13 +3,13 @@ BB_VER = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
include $(CLEAR_VARS)
LOCAL_MODULE := busybox
LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
LOCAL_DISABLE_FORMAT_STRING_CHECKS := true
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
include $(LOCAL_PATH)/Android_src.mk
LOCAL_LDFLAGS := -static
LOCAL_CFLAGS := -w -DBB_VER=\"$(BB_VER)\" -DBB_BT=AUTOCONF_TIMESTAMP
LOCAL_CFLAGS := \
-w -include include/autoconf.h -D__USE_BSD \
-DBB_VER=\"$(BB_VER)\" -DBB_BT=AUTOCONF_TIMESTAMP
include $(BUILD_EXECUTABLE)

21
busybox.sh Normal file → Executable file
View File

@ -57,27 +57,8 @@ generate_files() {
fi
}
# git clone https://github.com/osm0sis/android-busybox-ndk busybox_patches
apply_patches() {
if [ ! -d ../busybox_patches ]; then
progress "Please clone https://github.com/osm0sis/android-busybox-ndk to busybox_patches"
exit 1
fi
for p in ../busybox_patches/patches/* ../busybox-ndk.patch; do
case $p in
*000*|*001*|*002*|*017-d*|*020* )
# Skip several patches
continue
;;
* )
MSG="`cat $p | grep 'Subject' | sed 's/.*]\s//'`"
progress "[PATCH] $MSG"
patch -p1 < $p
git add .
git commit -m "$MSG" -m "Auto generated by ndk-box-kitchen"
;;
esac
done
git am ../busybox_patches/*
}
if [ ! -d busybox ]; then

View File

@ -0,0 +1,24 @@
From: osm0sis <osm0sis@outlook.com>
Date: Thu, 20 Jul 2017 09:16:07 -0300
Subject: [PATCH] fix tls: avoid problematic ASM code only triggered by x86 NDK builds
---
networking/tls.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/networking/tls.h b/networking/tls.h
index d487f3810..8399070ec 100644
--- a/networking/tls.h
+++ b/networking/tls.h
@@ -26,7 +26,7 @@
#undef USE_SEED
/* pstm: multiprecision numbers */
#undef DISABLE_PSTM
-#if defined(__GNUC__) && defined(__i386__)
+#if defined(__GNUC__) && defined(__i386__) && !defined(__ANDROID__)
/* PSTM_X86 works correctly. +25 bytes. */
# define PSTM_32BIT
# define PSTM_X86
--
2.12.3

View File

@ -1,4 +1,4 @@
APP_ABI := armeabi-v7a x86
APP_PLATFORM := android-14
APP_PLATFORM := android-21
APP_SHORT_COMMANDS := true
NDK_TOOLCHAIN_VERSION := 4.9

0
toybox.sh Normal file → Executable file
View File