author | Chih-Wei Huang <cwhuang@linux.org.tw> | 2014-07-30 09:04:54 (GMT) |
---|---|---|
committer | Tanguy Pruvot <tanguy.pruvot@gmail.com> | 2014-08-06 11:44:13 (GMT) |
commit | 29cf8c21823d9d4a6a1f841d28de7f4dfa76788f (patch) | |
tree | 330cac82520e4e02b65a95ef04f8b2a904305e45 | |
parent | d8482dbecc75c8a94bd15a02fa8844cfea91e6d2 (diff) | |
download | busybox-29cf8c21823d9d4a6a1f841d28de7f4dfa76788f.zip busybox-29cf8c21823d9d4a6a1f841d28de7f4dfa76788f.tar.gz busybox-29cf8c21823d9d4a6a1f841d28de7f4dfa76788f.tar.bz2 |
android: fix building errors with Android L
Tested OK with Android L PDK LRW17D.
The asm files are regenerated by Android L gensyscalls.py.
syscalls: restore compatibilty with current branch
on arm __NR_stime constant is undefined in asm/unistd.h
add also BIONIC_L define for assembly files (syscalls)
tested on arm and x86 (not on mips)
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
Change-Id: If5b6a6d3f8b4c10339f8e7b0bf340d02c1cf26cb
-rw-r--r-- | Android.mk | 49 | ||||
-rw-r--r-- | android/libc/arch-arm/syscalls/adjtimex.S | 29 | ||||
-rw-r--r-- | android/libc/arch-arm/syscalls/stime.S | 32 | ||||
-rw-r--r-- | android/libc/arch-mips/syscalls/adjtimex.S | 35 | ||||
-rw-r--r-- | android/libc/arch-mips/syscalls/stime.S | 35 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/adjtimex.S | 22 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/getsid.S | 11 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/stime.S | 22 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/swapoff.S | 10 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/swapon.S | 11 | ||||
-rw-r--r-- | android/libc/arch-x86/syscalls/sysinfo.S | 10 | ||||
-rw-r--r-- | include/platform.h | 4 |
12 files changed, 154 insertions, 116 deletions
@@ -20,7 +20,7 @@ LOCAL_C_INCLUDES := $(BB_PATH)/android/librpc LOCAL_MODULE := libuclibcrpc LOCAL_CFLAGS += -fno-strict-aliasing ifeq ($(BIONIC_L),true) -LOCAL_CFLAGS += -DBIONIC_L +LOCAL_CFLAGS += -DBIONIC_ICS -DBIONIC_L endif include $(BUILD_STATIC_LIBRARY) @@ -89,34 +89,16 @@ BUSYBOX_SRC_FILES = \ android/libc/pty.c \ android/android.c -ifeq ($(TARGET_ARCH),arm) - BUSYBOX_SRC_FILES += \ - android/libc/arch-arm/syscalls/adjtimex.S \ - android/libc/arch-arm/syscalls/getsid.S \ - android/libc/arch-arm/syscalls/stime.S \ - android/libc/arch-arm/syscalls/swapon.S \ - android/libc/arch-arm/syscalls/swapoff.S \ - android/libc/arch-arm/syscalls/sysinfo.S -endif - -ifeq ($(TARGET_ARCH),x86) - BUSYBOX_SRC_FILES += \ - android/libc/arch-x86/syscalls/adjtimex.S \ - android/libc/arch-x86/syscalls/getsid.S \ - android/libc/arch-x86/syscalls/stime.S \ - android/libc/arch-x86/syscalls/swapon.S \ - android/libc/arch-x86/syscalls/swapoff.S \ - android/libc/arch-x86/syscalls/sysinfo.S +BUSYBOX_ASM_FILES := adjtimex.S stime.S +ifneq ($(BIONIC_L),true) + BUSYBOX_ASM_FILES += getsid.S swapon.S swapoff.S sysinfo.S endif -ifeq ($(TARGET_ARCH),mips) +ifneq ($(filter arm x86 mips,$(TARGET_ARCH)),) BUSYBOX_SRC_FILES += \ - android/libc/arch-mips/syscalls/adjtimex.S \ - android/libc/arch-mips/syscalls/getsid.S \ - android/libc/arch-mips/syscalls/stime.S \ - android/libc/arch-mips/syscalls/swapon.S \ - android/libc/arch-mips/syscalls/swapoff.S \ - android/libc/arch-mips/syscalls/sysinfo.S + $(addprefix android/libc/arch-$(TARGET_ARCH)/syscalls/,$(BUSYBOX_ASM_FILES)) +else + $(error $(TARGET_ARCH) is not supported) endif BUSYBOX_C_INCLUDES = \ @@ -141,13 +123,15 @@ BUSYBOX_CFLAGS = \ -D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \ -D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion)) $(BUSYBOX_SUFFIX)"' -DBB_BT=AUTOCONF_TIMESTAMP -# to handle differences in ICS/JB (ipv6) -ifeq ($(BIONIC_ICS),true) - BUSYBOX_CFLAGS += -DBIONIC_ICS -endif - ifeq ($(BIONIC_L),true) BUSYBOX_CFLAGS += -DBIONIC_L + BUSYBOX_AFLAGS += -DBIONIC_L + # include changes for ICS/JB/KK + BIONIC_ICS := true +endif + +ifeq ($(BIONIC_ICS),true) + BUSYBOX_CFLAGS += -DBIONIC_ICS endif @@ -166,6 +150,7 @@ LOCAL_CFLAGS += \ -Dgetmntent=busybox_getmntent \ -Dgetmntent_r=busybox_getmntent_r \ -Dgenerate_uuid=busybox_generate_uuid +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) LOCAL_MODULE := libbusybox LOCAL_MODULE_TAGS := eng debug LOCAL_STATIC_LIBRARIES := libcutils libc libm libselinux @@ -186,6 +171,7 @@ LOCAL_SRC_FILES += android/libc/__set_errno.c endif LOCAL_C_INCLUDES := $(bb_gen)/full/include $(BUSYBOX_C_INCLUDES) LOCAL_CFLAGS := $(BUSYBOX_CFLAGS) +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) LOCAL_MODULE := busybox LOCAL_MODULE_TAGS := eng debug LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) @@ -230,6 +216,7 @@ LOCAL_CFLAGS += \ -Dgetmntent=busybox_getmntent \ -Dgetmntent_r=busybox_getmntent_r \ -Dgenerate_uuid=busybox_generate_uuid +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_MODULE := static_busybox LOCAL_MODULE_STEM := busybox diff --git a/android/libc/arch-arm/syscalls/adjtimex.S b/android/libc/arch-arm/syscalls/adjtimex.S index dabdb90..18c04b0 100644 --- a/android/libc/arch-arm/syscalls/adjtimex.S +++ b/android/libc/arch-arm/syscalls/adjtimex.S @@ -1,19 +1,20 @@ -/* autogenerated by gensyscalls.py */ -#include <asm/unistd.h> +/* Generated by gensyscalls.py. Do not edit. */ - .text - .type adjtimex, #function - .globl adjtimex - .align 4 - .fnstart +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif -adjtimex: - .save {r4, r7} - stmfd sp!, {r4, r7} +ENTRY(adjtimex) + mov ip, r7 ldr r7, =__NR_adjtimex swi #0 - ldmfd sp!, {r4, r7} - movs r0, r0 - bxpl lr + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 b __set_errno - .fnend +END(adjtimex) diff --git a/android/libc/arch-arm/syscalls/stime.S b/android/libc/arch-arm/syscalls/stime.S index e53684c..f10a288 100644 --- a/android/libc/arch-arm/syscalls/stime.S +++ b/android/libc/arch-arm/syscalls/stime.S @@ -1,24 +1,24 @@ -/* autogenerated by gensyscalls.py */ -#define __KERNEL__ -#include <asm/unistd.h> +/* Generated by gensyscalls.py. Do not edit. */ + +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif #ifndef __NR_stime #define __NR_stime (__NR_SYSCALL_BASE + 25) #endif - .text - .type stime, #function - .globl stime - .align 4 - .fnstart - -stime: - .save {r4, r7} - stmfd sp!, {r4, r7} +ENTRY(stime) + mov ip, r7 ldr r7, =__NR_stime swi #0 - ldmfd sp!, {r4, r7} - movs r0, r0 - bxpl lr + mov r7, ip + cmn r0, #(MAX_ERRNO + 1) + bxls lr + neg r0, r0 b __set_errno - .fnend +END(stime) diff --git a/android/libc/arch-mips/syscalls/adjtimex.S b/android/libc/arch-mips/syscalls/adjtimex.S index 4779c43..f56a1f5 100644 --- a/android/libc/arch-mips/syscalls/adjtimex.S +++ b/android/libc/arch-mips/syscalls/adjtimex.S @@ -1,22 +1,23 @@ -/* autogenerated by gensyscalls.py */ +/* Generated by gensyscalls.py. Do not edit. */ + +#ifdef BIONIC_L +#include <private/bionic_asm.h> +#else #include <asm/unistd.h> - .text - .globl adjtimex - .align 4 - .ent adjtimex - -adjtimex: +#endif + +ENTRY(adjtimex) .set noreorder - .cpload $t9 - li $v0, (4000+124) + .cpload t9 + li v0, __NR_adjtimex syscall - bnez $a3, 1f - move $a0, $v0 - j $ra - nop + bnez a3, 1f + move a0, v0 + j ra + nop 1: - la $t9,__set_errno - j $t9 - nop + la t9,__set_errno + j t9 + nop .set reorder - .end adjtimex +END(adjtimex) diff --git a/android/libc/arch-mips/syscalls/stime.S b/android/libc/arch-mips/syscalls/stime.S index 141aef6..429f579 100644 --- a/android/libc/arch-mips/syscalls/stime.S +++ b/android/libc/arch-mips/syscalls/stime.S @@ -1,22 +1,23 @@ -/* autogenerated by gensyscalls.py */ +/* Generated by gensyscalls.py. Do not edit. */ + +#ifdef BIONIC_L +#include <private/bionic_asm.h> +#else #include <asm/unistd.h> - .text - .globl stime - .align 4 - .ent stime - -stime: +#endif + +ENTRY(stime) .set noreorder - .cpload $t9 - li $v0, (4000+25) + .cpload t9 + li v0, __NR_stime syscall - bnez $a3, 1f - move $a0, $v0 - j $ra - nop + bnez a3, 1f + move a0, v0 + j ra + nop 1: - la $t9,__set_errno - j $t9 - nop + la t9,__set_errno + j t9 + nop .set reorder - .end stime +END(stime) diff --git a/android/libc/arch-x86/syscalls/adjtimex.S b/android/libc/arch-x86/syscalls/adjtimex.S index 869baf0..0667b21b 100644 --- a/android/libc/arch-x86/syscalls/adjtimex.S +++ b/android/libc/arch-x86/syscalls/adjtimex.S @@ -1,15 +1,23 @@ -/* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> +/* Generated by gensyscalls.py. Do not edit. */ +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> .text .type adjtimex, @function .globl adjtimex .align 4 +#endif - -adjtimex: +ENTRY(adjtimex) pushl %ebx +#ifdef BIONIC_L + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 +#endif mov 8(%esp), %ebx movl $__NR_adjtimex, %eax int $0x80 @@ -19,8 +27,10 @@ adjtimex: pushl %eax call __set_errno addl $4, %esp +#ifndef BIONIC_L orl $-1, %eax +#endif 1: popl %ebx ret - +END(adjtimex) diff --git a/android/libc/arch-x86/syscalls/getsid.S b/android/libc/arch-x86/syscalls/getsid.S index 6fe39eb..e8e53f0 100644 --- a/android/libc/arch-x86/syscalls/getsid.S +++ b/android/libc/arch-x86/syscalls/getsid.S @@ -1,6 +1,13 @@ /* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> + +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif .text .type getsid, @function diff --git a/android/libc/arch-x86/syscalls/stime.S b/android/libc/arch-x86/syscalls/stime.S index 185e26f..b8a579b 100644 --- a/android/libc/arch-x86/syscalls/stime.S +++ b/android/libc/arch-x86/syscalls/stime.S @@ -1,15 +1,23 @@ -/* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> +/* Generated by gensyscalls.py. Do not edit. */ +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> .text .type stime, @function .globl stime .align 4 +#endif - -stime: +ENTRY(stime) pushl %ebx +#ifdef BIONIC_L + .cfi_def_cfa_offset 8 + .cfi_rel_offset ebx, 0 +#endif mov 8(%esp), %ebx movl $__NR_stime, %eax int $0x80 @@ -19,8 +27,10 @@ stime: pushl %eax call __set_errno addl $4, %esp +#ifndef BIONIC_L orl $-1, %eax +#endif 1: popl %ebx ret - +END(stime) diff --git a/android/libc/arch-x86/syscalls/swapoff.S b/android/libc/arch-x86/syscalls/swapoff.S index f13833c..5b4ee06 100644 --- a/android/libc/arch-x86/syscalls/swapoff.S +++ b/android/libc/arch-x86/syscalls/swapoff.S @@ -1,6 +1,12 @@ /* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> + +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif .text .type swapoff, @function diff --git a/android/libc/arch-x86/syscalls/swapon.S b/android/libc/arch-x86/syscalls/swapon.S index fe554a6..957173e 100644 --- a/android/libc/arch-x86/syscalls/swapon.S +++ b/android/libc/arch-x86/syscalls/swapon.S @@ -1,6 +1,13 @@ /* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> + +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif .text .type swapon, @function diff --git a/android/libc/arch-x86/syscalls/sysinfo.S b/android/libc/arch-x86/syscalls/sysinfo.S index bafe20d..ea73dc0 100644 --- a/android/libc/arch-x86/syscalls/sysinfo.S +++ b/android/libc/arch-x86/syscalls/sysinfo.S @@ -1,6 +1,12 @@ /* autogenerated by gensyscalls.py */ -#include <linux/err.h> -#include <asm/unistd.h> + +#ifdef BIONIC_L +# include <private/bionic_asm.h> +#else +# include <asm/unistd.h> +# include <linux/err.h> +# include <machine/asm.h> +#endif .text .type sysinfo, @function diff --git a/include/platform.h b/include/platform.h index 0c75e8d..c6789a5 100644 --- a/include/platform.h +++ b/include/platform.h @@ -454,11 +454,13 @@ typedef unsigned smalluint; #if defined(ANDROID) || defined(__ANDROID__) # undef HAVE_DPRINTF -# undef HAVE_STPCPY # undef HAVE_STRCHRNUL # undef HAVE_STRVERSCMP # undef HAVE_UNLOCKED_LINE_OPS # undef HAVE_NET_ETHERNET_H +# ifndef __i386__ +# undef HAVE_STPCPY +# endif #endif /* |