Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-busybox: Commit

external/busybox


Commit MetaInfo

Revision29cf8c21823d9d4a6a1f841d28de7f4dfa76788f (tree)
Time2014-08-06 20:44:13
AuthorChih-Wei Huang <cwhuang@linu...>
CommiterTanguy Pruvot

Log Message

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

Change Summary

Incremental Difference

--- a/Android.mk
+++ b/Android.mk
@@ -20,7 +20,7 @@ LOCAL_C_INCLUDES := $(BB_PATH)/android/librpc
2020 LOCAL_MODULE := libuclibcrpc
2121 LOCAL_CFLAGS += -fno-strict-aliasing
2222 ifeq ($(BIONIC_L),true)
23-LOCAL_CFLAGS += -DBIONIC_L
23+LOCAL_CFLAGS += -DBIONIC_ICS -DBIONIC_L
2424 endif
2525 include $(BUILD_STATIC_LIBRARY)
2626
@@ -89,34 +89,16 @@ BUSYBOX_SRC_FILES = \
8989 android/libc/pty.c \
9090 android/android.c
9191
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
11095 endif
11196
112-ifeq ($(TARGET_ARCH),mips)
97+ifneq ($(filter arm x86 mips,$(TARGET_ARCH)),)
11398 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)
120102 endif
121103
122104 BUSYBOX_C_INCLUDES = \
@@ -141,13 +123,15 @@ BUSYBOX_CFLAGS = \
141123 -D'CONFIG_DEFAULT_MODULES_DIR="$(KERNEL_MODULES_DIR)"' \
142124 -D'BB_VER="$(strip $(shell $(SUBMAKE) kernelversion)) $(BUSYBOX_SUFFIX)"' -DBB_BT=AUTOCONF_TIMESTAMP
143125
144-# to handle differences in ICS/JB (ipv6)
145-ifeq ($(BIONIC_ICS),true)
146- BUSYBOX_CFLAGS += -DBIONIC_ICS
147-endif
148-
149126 ifeq ($(BIONIC_L),true)
150127 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
151135 endif
152136
153137
@@ -166,6 +150,7 @@ LOCAL_CFLAGS += \
166150 -Dgetmntent=busybox_getmntent \
167151 -Dgetmntent_r=busybox_getmntent_r \
168152 -Dgenerate_uuid=busybox_generate_uuid
153+LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS)
169154 LOCAL_MODULE := libbusybox
170155 LOCAL_MODULE_TAGS := eng debug
171156 LOCAL_STATIC_LIBRARIES := libcutils libc libm libselinux
@@ -186,6 +171,7 @@ LOCAL_SRC_FILES += android/libc/__set_errno.c
186171 endif
187172 LOCAL_C_INCLUDES := $(bb_gen)/full/include $(BUSYBOX_C_INCLUDES)
188173 LOCAL_CFLAGS := $(BUSYBOX_CFLAGS)
174+LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS)
189175 LOCAL_MODULE := busybox
190176 LOCAL_MODULE_TAGS := eng debug
191177 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
@@ -230,6 +216,7 @@ LOCAL_CFLAGS += \
230216 -Dgetmntent=busybox_getmntent \
231217 -Dgetmntent_r=busybox_getmntent_r \
232218 -Dgenerate_uuid=busybox_generate_uuid
219+LOCAL_ASFLAGS := $(BUSYBOX_AFLAGS)
233220 LOCAL_FORCE_STATIC_EXECUTABLE := true
234221 LOCAL_MODULE := static_busybox
235222 LOCAL_MODULE_STEM := busybox
--- a/android/libc/arch-arm/syscalls/adjtimex.S
+++ b/android/libc/arch-arm/syscalls/adjtimex.S
@@ -1,19 +1,20 @@
1-/* autogenerated by gensyscalls.py */
2-#include <asm/unistd.h>
1+/* Generated by gensyscalls.py. Do not edit. */
32
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
910
10-adjtimex:
11- .save {r4, r7}
12- stmfd sp!, {r4, r7}
11+ENTRY(adjtimex)
12+ mov ip, r7
1313 ldr r7, =__NR_adjtimex
1414 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
1819 b __set_errno
19- .fnend
20+END(adjtimex)
--- a/android/libc/arch-arm/syscalls/stime.S
+++ b/android/libc/arch-arm/syscalls/stime.S
@@ -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
410
511 #ifndef __NR_stime
612 #define __NR_stime (__NR_SYSCALL_BASE + 25)
713 #endif
814
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
1817 ldr r7, =__NR_stime
1918 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
2323 b __set_errno
24- .fnend
24+END(stime)
--- a/android/libc/arch-mips/syscalls/adjtimex.S
+++ b/android/libc/arch-mips/syscalls/adjtimex.S
@@ -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
26 #include <asm/unistd.h>
3- .text
4- .globl adjtimex
5- .align 4
6- .ent adjtimex
7-
8-adjtimex:
7+#endif
8+
9+ENTRY(adjtimex)
910 .set noreorder
10- .cpload $t9
11- li $v0, (4000+124)
11+ .cpload t9
12+ li v0, __NR_adjtimex
1213 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
1718 1:
18- la $t9,__set_errno
19- j $t9
20- nop
19+ la t9,__set_errno
20+ j t9
21+ nop
2122 .set reorder
22- .end adjtimex
23+END(adjtimex)
--- a/android/libc/arch-mips/syscalls/stime.S
+++ b/android/libc/arch-mips/syscalls/stime.S
@@ -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
26 #include <asm/unistd.h>
3- .text
4- .globl stime
5- .align 4
6- .ent stime
7-
8-stime:
7+#endif
8+
9+ENTRY(stime)
910 .set noreorder
10- .cpload $t9
11- li $v0, (4000+25)
11+ .cpload t9
12+ li v0, __NR_stime
1213 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
1718 1:
18- la $t9,__set_errno
19- j $t9
20- nop
19+ la t9,__set_errno
20+ j t9
21+ nop
2122 .set reorder
22- .end stime
23+END(stime)
--- a/android/libc/arch-x86/syscalls/adjtimex.S
+++ b/android/libc/arch-x86/syscalls/adjtimex.S
@@ -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. */
42
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>
59 .text
610 .type adjtimex, @function
711 .globl adjtimex
812 .align 4
13+#endif
914
10-
11-adjtimex:
15+ENTRY(adjtimex)
1216 pushl %ebx
17+#ifdef BIONIC_L
18+ .cfi_def_cfa_offset 8
19+ .cfi_rel_offset ebx, 0
20+#endif
1321 mov 8(%esp), %ebx
1422 movl $__NR_adjtimex, %eax
1523 int $0x80
@@ -19,8 +27,10 @@ adjtimex:
1927 pushl %eax
2028 call __set_errno
2129 addl $4, %esp
30+#ifndef BIONIC_L
2231 orl $-1, %eax
32+#endif
2333 1:
2434 popl %ebx
2535 ret
26-
36+END(adjtimex)
--- a/android/libc/arch-x86/syscalls/getsid.S
+++ b/android/libc/arch-x86/syscalls/getsid.S
@@ -1,6 +1,13 @@
11 /* 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
411
512 .text
613 .type getsid, @function
--- a/android/libc/arch-x86/syscalls/stime.S
+++ b/android/libc/arch-x86/syscalls/stime.S
@@ -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. */
42
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>
59 .text
610 .type stime, @function
711 .globl stime
812 .align 4
13+#endif
914
10-
11-stime:
15+ENTRY(stime)
1216 pushl %ebx
17+#ifdef BIONIC_L
18+ .cfi_def_cfa_offset 8
19+ .cfi_rel_offset ebx, 0
20+#endif
1321 mov 8(%esp), %ebx
1422 movl $__NR_stime, %eax
1523 int $0x80
@@ -19,8 +27,10 @@ stime:
1927 pushl %eax
2028 call __set_errno
2129 addl $4, %esp
30+#ifndef BIONIC_L
2231 orl $-1, %eax
32+#endif
2333 1:
2434 popl %ebx
2535 ret
26-
36+END(stime)
--- a/android/libc/arch-x86/syscalls/swapoff.S
+++ b/android/libc/arch-x86/syscalls/swapoff.S
@@ -1,6 +1,12 @@
11 /* 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
410
511 .text
612 .type swapoff, @function
--- a/android/libc/arch-x86/syscalls/swapon.S
+++ b/android/libc/arch-x86/syscalls/swapon.S
@@ -1,6 +1,13 @@
11 /* 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
411
512 .text
613 .type swapon, @function
--- a/android/libc/arch-x86/syscalls/sysinfo.S
+++ b/android/libc/arch-x86/syscalls/sysinfo.S
@@ -1,6 +1,12 @@
11 /* 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
410
511 .text
612 .type sysinfo, @function
--- a/include/platform.h
+++ b/include/platform.h
@@ -454,11 +454,13 @@ typedef unsigned smalluint;
454454
455455 #if defined(ANDROID) || defined(__ANDROID__)
456456 # undef HAVE_DPRINTF
457-# undef HAVE_STPCPY
458457 # undef HAVE_STRCHRNUL
459458 # undef HAVE_STRVERSCMP
460459 # undef HAVE_UNLOCKED_LINE_OPS
461460 # undef HAVE_NET_ETHERNET_H
461+# ifndef __i386__
462+# undef HAVE_STPCPY
463+# endif
462464 #endif
463465
464466 /*
Show on old repository browser