external/busybox
Revision | 29cf8c21823d9d4a6a1f841d28de7f4dfa76788f (tree) |
---|---|
Time | 2014-08-06 20:44:13 |
Author | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Tanguy Pruvot |
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
@@ -20,7 +20,7 @@ LOCAL_C_INCLUDES := $(BB_PATH)/android/librpc | ||
20 | 20 | LOCAL_MODULE := libuclibcrpc |
21 | 21 | LOCAL_CFLAGS += -fno-strict-aliasing |
22 | 22 | ifeq ($(BIONIC_L),true) |
23 | -LOCAL_CFLAGS += -DBIONIC_L | |
23 | +LOCAL_CFLAGS += -DBIONIC_ICS -DBIONIC_L | |
24 | 24 | endif |
25 | 25 | include $(BUILD_STATIC_LIBRARY) |
26 | 26 |
@@ -89,34 +89,16 @@ BUSYBOX_SRC_FILES = \ | ||
89 | 89 | android/libc/pty.c \ |
90 | 90 | android/android.c |
91 | 91 | |
92 | -ifeq ($(TARGET_ARCH),arm) | |
93 | - BUSYBOX_SRC_FILES += \ | |
94 | - android/libc/arch-arm/syscalls/adjtimex.S \ | |
95 | - android/libc/arch-arm/syscalls/getsid.S \ | |
96 | - android/libc/arch-arm/syscalls/stime.S \ | |
97 | - android/libc/arch-arm/syscalls/swapon.S \ | |
98 | - android/libc/arch-arm/syscalls/swapoff.S \ | |
99 | - android/libc/arch-arm/syscalls/sysinfo.S | |
100 | -endif | |
101 | - | |
102 | -ifeq ($(TARGET_ARCH),x86) | |
103 | - BUSYBOX_SRC_FILES += \ | |
104 | - android/libc/arch-x86/syscalls/adjtimex.S \ | |
105 | - android/libc/arch-x86/syscalls/getsid.S \ | |
106 | - android/libc/arch-x86/syscalls/stime.S \ | |
107 | - android/libc/arch-x86/syscalls/swapon.S \ | |
108 | - android/libc/arch-x86/syscalls/swapoff.S \ | |
109 | - android/libc/arch-x86/syscalls/sysinfo.S | |
92 | +BUSYBOX_ASM_FILES := adjtimex.S stime.S | |
93 | +ifneq ($(BIONIC_L),true) | |
94 | + BUSYBOX_ASM_FILES += getsid.S swapon.S swapoff.S sysinfo.S | |
110 | 95 | endif |
111 | 96 | |
112 | -ifeq ($(TARGET_ARCH),mips) | |
97 | +ifneq ($(filter arm x86 mips,$(TARGET_ARCH)),) | |
113 | 98 | BUSYBOX_SRC_FILES += \ |
114 | - android/libc/arch-mips/syscalls/adjtimex.S \ | |
115 | - android/libc/arch-mips/syscalls/getsid.S \ | |
116 | - android/libc/arch-mips/syscalls/stime.S \ | |
117 | - android/libc/arch-mips/syscalls/swapon.S \ | |
118 | - android/libc/arch-mips/syscalls/swapoff.S \ | |
119 | - android/libc/arch-mips/syscalls/sysinfo.S | |
99 | + $(addprefix android/libc/arch-$(TARGET_ARCH)/syscalls/,$(BUSYBOX_ASM_FILES)) | |
100 | +else | |
101 | + $(error $(TARGET_ARCH) is not supported) | |
120 | 102 | endif |
121 | 103 | |
122 | 104 | BUSYBOX_C_INCLUDES = \ |
@@ -141,13 +123,15 @@ BUSYBOX_CFLAGS = \ | ||
141 | 123 | -D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \ |
142 | 124 | -D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion)) $(BUSYBOX_SUFFIX)"' -DBB_BT=AUTOCONF_TIMESTAMP |
143 | 125 | |
144 | -# to handle differences in ICS/JB (ipv6) | |
145 | -ifeq ($(BIONIC_ICS),true) | |
146 | - BUSYBOX_CFLAGS += -DBIONIC_ICS | |
147 | -endif | |
148 | - | |
149 | 126 | ifeq ($(BIONIC_L),true) |
150 | 127 | BUSYBOX_CFLAGS += -DBIONIC_L |
128 | + BUSYBOX_AFLAGS += -DBIONIC_L | |
129 | + # include changes for ICS/JB/KK | |
130 | + BIONIC_ICS := true | |
131 | +endif | |
132 | + | |
133 | +ifeq ($(BIONIC_ICS),true) | |
134 | + BUSYBOX_CFLAGS += -DBIONIC_ICS | |
151 | 135 | endif |
152 | 136 | |
153 | 137 |
@@ -166,6 +150,7 @@ LOCAL_CFLAGS += \ | ||
166 | 150 | -Dgetmntent=busybox_getmntent \ |
167 | 151 | -Dgetmntent_r=busybox_getmntent_r \ |
168 | 152 | -Dgenerate_uuid=busybox_generate_uuid |
153 | +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) | |
169 | 154 | LOCAL_MODULE := libbusybox |
170 | 155 | LOCAL_MODULE_TAGS := eng debug |
171 | 156 | LOCAL_STATIC_LIBRARIES := libcutils libc libm libselinux |
@@ -186,6 +171,7 @@ LOCAL_SRC_FILES += android/libc/__set_errno.c | ||
186 | 171 | endif |
187 | 172 | LOCAL_C_INCLUDES := $(bb_gen)/full/include $(BUSYBOX_C_INCLUDES) |
188 | 173 | LOCAL_CFLAGS := $(BUSYBOX_CFLAGS) |
174 | +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) | |
189 | 175 | LOCAL_MODULE := busybox |
190 | 176 | LOCAL_MODULE_TAGS := eng debug |
191 | 177 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
@@ -230,6 +216,7 @@ LOCAL_CFLAGS += \ | ||
230 | 216 | -Dgetmntent=busybox_getmntent \ |
231 | 217 | -Dgetmntent_r=busybox_getmntent_r \ |
232 | 218 | -Dgenerate_uuid=busybox_generate_uuid |
219 | +LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS) | |
233 | 220 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
234 | 221 | LOCAL_MODULE := static_busybox |
235 | 222 | LOCAL_MODULE_STEM := busybox |
@@ -1,19 +1,20 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
2 | -#include <asm/unistd.h> | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
3 | 2 | |
4 | - .text | |
5 | - .type adjtimex, #function | |
6 | - .globl adjtimex | |
7 | - .align 4 | |
8 | - .fnstart | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
9 | +#endif | |
9 | 10 | |
10 | -adjtimex: | |
11 | - .save {r4, r7} | |
12 | - stmfd sp!, {r4, r7} | |
11 | +ENTRY(adjtimex) | |
12 | + mov ip, r7 | |
13 | 13 | ldr r7, =__NR_adjtimex |
14 | 14 | swi #0 |
15 | - ldmfd sp!, {r4, r7} | |
16 | - movs r0, r0 | |
17 | - bxpl lr | |
15 | + mov r7, ip | |
16 | + cmn r0, #(MAX_ERRNO + 1) | |
17 | + bxls lr | |
18 | + neg r0, r0 | |
18 | 19 | b __set_errno |
19 | - .fnend | |
20 | +END(adjtimex) |
@@ -1,24 +1,24 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
2 | -#define __KERNEL__ | |
3 | -#include <asm/unistd.h> | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
9 | +#endif | |
4 | 10 | |
5 | 11 | #ifndef __NR_stime |
6 | 12 | #define __NR_stime (__NR_SYSCALL_BASE + 25) |
7 | 13 | #endif |
8 | 14 | |
9 | - .text | |
10 | - .type stime, #function | |
11 | - .globl stime | |
12 | - .align 4 | |
13 | - .fnstart | |
14 | - | |
15 | -stime: | |
16 | - .save {r4, r7} | |
17 | - stmfd sp!, {r4, r7} | |
15 | +ENTRY(stime) | |
16 | + mov ip, r7 | |
18 | 17 | ldr r7, =__NR_stime |
19 | 18 | swi #0 |
20 | - ldmfd sp!, {r4, r7} | |
21 | - movs r0, r0 | |
22 | - bxpl lr | |
19 | + mov r7, ip | |
20 | + cmn r0, #(MAX_ERRNO + 1) | |
21 | + bxls lr | |
22 | + neg r0, r0 | |
23 | 23 | b __set_errno |
24 | - .fnend | |
24 | +END(stime) |
@@ -1,22 +1,23 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +#include <private/bionic_asm.h> | |
5 | +#else | |
2 | 6 | #include <asm/unistd.h> |
3 | - .text | |
4 | - .globl adjtimex | |
5 | - .align 4 | |
6 | - .ent adjtimex | |
7 | - | |
8 | -adjtimex: | |
7 | +#endif | |
8 | + | |
9 | +ENTRY(adjtimex) | |
9 | 10 | .set noreorder |
10 | - .cpload $t9 | |
11 | - li $v0, (4000+124) | |
11 | + .cpload t9 | |
12 | + li v0, __NR_adjtimex | |
12 | 13 | syscall |
13 | - bnez $a3, 1f | |
14 | - move $a0, $v0 | |
15 | - j $ra | |
16 | - nop | |
14 | + bnez a3, 1f | |
15 | + move a0, v0 | |
16 | + j ra | |
17 | + nop | |
17 | 18 | 1: |
18 | - la $t9,__set_errno | |
19 | - j $t9 | |
20 | - nop | |
19 | + la t9,__set_errno | |
20 | + j t9 | |
21 | + nop | |
21 | 22 | .set reorder |
22 | - .end adjtimex | |
23 | +END(adjtimex) |
@@ -1,22 +1,23 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +#include <private/bionic_asm.h> | |
5 | +#else | |
2 | 6 | #include <asm/unistd.h> |
3 | - .text | |
4 | - .globl stime | |
5 | - .align 4 | |
6 | - .ent stime | |
7 | - | |
8 | -stime: | |
7 | +#endif | |
8 | + | |
9 | +ENTRY(stime) | |
9 | 10 | .set noreorder |
10 | - .cpload $t9 | |
11 | - li $v0, (4000+25) | |
11 | + .cpload t9 | |
12 | + li v0, __NR_stime | |
12 | 13 | syscall |
13 | - bnez $a3, 1f | |
14 | - move $a0, $v0 | |
15 | - j $ra | |
16 | - nop | |
14 | + bnez a3, 1f | |
15 | + move a0, v0 | |
16 | + j ra | |
17 | + nop | |
17 | 18 | 1: |
18 | - la $t9,__set_errno | |
19 | - j $t9 | |
20 | - nop | |
19 | + la t9,__set_errno | |
20 | + j t9 | |
21 | + nop | |
21 | 22 | .set reorder |
22 | - .end stime | |
23 | +END(stime) |
@@ -1,15 +1,23 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
4 | 2 | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
5 | 9 | .text |
6 | 10 | .type adjtimex, @function |
7 | 11 | .globl adjtimex |
8 | 12 | .align 4 |
13 | +#endif | |
9 | 14 | |
10 | - | |
11 | -adjtimex: | |
15 | +ENTRY(adjtimex) | |
12 | 16 | pushl %ebx |
17 | +#ifdef BIONIC_L | |
18 | + .cfi_def_cfa_offset 8 | |
19 | + .cfi_rel_offset ebx, 0 | |
20 | +#endif | |
13 | 21 | mov 8(%esp), %ebx |
14 | 22 | movl $__NR_adjtimex, %eax |
15 | 23 | int $0x80 |
@@ -19,8 +27,10 @@ adjtimex: | ||
19 | 27 | pushl %eax |
20 | 28 | call __set_errno |
21 | 29 | addl $4, %esp |
30 | +#ifndef BIONIC_L | |
22 | 31 | orl $-1, %eax |
32 | +#endif | |
23 | 33 | 1: |
24 | 34 | popl %ebx |
25 | 35 | ret |
26 | - | |
36 | +END(adjtimex) |
@@ -1,6 +1,13 @@ | ||
1 | 1 | /* autogenerated by gensyscalls.py */ |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <asm/unistd.h> | |
8 | +# include <linux/err.h> | |
9 | +# include <machine/asm.h> | |
10 | +#endif | |
4 | 11 | |
5 | 12 | .text |
6 | 13 | .type getsid, @function |
@@ -1,15 +1,23 @@ | ||
1 | -/* autogenerated by gensyscalls.py */ | |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
1 | +/* Generated by gensyscalls.py. Do not edit. */ | |
4 | 2 | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
5 | 9 | .text |
6 | 10 | .type stime, @function |
7 | 11 | .globl stime |
8 | 12 | .align 4 |
13 | +#endif | |
9 | 14 | |
10 | - | |
11 | -stime: | |
15 | +ENTRY(stime) | |
12 | 16 | pushl %ebx |
17 | +#ifdef BIONIC_L | |
18 | + .cfi_def_cfa_offset 8 | |
19 | + .cfi_rel_offset ebx, 0 | |
20 | +#endif | |
13 | 21 | mov 8(%esp), %ebx |
14 | 22 | movl $__NR_stime, %eax |
15 | 23 | int $0x80 |
@@ -19,8 +27,10 @@ stime: | ||
19 | 27 | pushl %eax |
20 | 28 | call __set_errno |
21 | 29 | addl $4, %esp |
30 | +#ifndef BIONIC_L | |
22 | 31 | orl $-1, %eax |
32 | +#endif | |
23 | 33 | 1: |
24 | 34 | popl %ebx |
25 | 35 | ret |
26 | - | |
36 | +END(stime) |
@@ -1,6 +1,12 @@ | ||
1 | 1 | /* autogenerated by gensyscalls.py */ |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
9 | +#endif | |
4 | 10 | |
5 | 11 | .text |
6 | 12 | .type swapoff, @function |
@@ -1,6 +1,13 @@ | ||
1 | 1 | /* autogenerated by gensyscalls.py */ |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <asm/unistd.h> | |
8 | +# include <linux/err.h> | |
9 | +# include <machine/asm.h> | |
10 | +#endif | |
4 | 11 | |
5 | 12 | .text |
6 | 13 | .type swapon, @function |
@@ -1,6 +1,12 @@ | ||
1 | 1 | /* autogenerated by gensyscalls.py */ |
2 | -#include <linux/err.h> | |
3 | -#include <asm/unistd.h> | |
2 | + | |
3 | +#ifdef BIONIC_L | |
4 | +# include <private/bionic_asm.h> | |
5 | +#else | |
6 | +# include <asm/unistd.h> | |
7 | +# include <linux/err.h> | |
8 | +# include <machine/asm.h> | |
9 | +#endif | |
4 | 10 | |
5 | 11 | .text |
6 | 12 | .type sysinfo, @function |
@@ -454,11 +454,13 @@ typedef unsigned smalluint; | ||
454 | 454 | |
455 | 455 | #if defined(ANDROID) || defined(__ANDROID__) |
456 | 456 | # undef HAVE_DPRINTF |
457 | -# undef HAVE_STPCPY | |
458 | 457 | # undef HAVE_STRCHRNUL |
459 | 458 | # undef HAVE_STRVERSCMP |
460 | 459 | # undef HAVE_UNLOCKED_LINE_OPS |
461 | 460 | # undef HAVE_NET_ETHERNET_H |
461 | +# ifndef __i386__ | |
462 | +# undef HAVE_STPCPY | |
463 | +# endif | |
462 | 464 | #endif |
463 | 465 | |
464 | 466 | /* |