summaryrefslogtreecommitdiff
authorTrevor Drake <trevd1234@gmail.com>2013-10-05 20:33:20 (GMT)
committer Trevor Drake <trevd1234@gmail.com>2013-10-05 20:33:20 (GMT)
commit2b995269d5c0baa89649bfb6268a5ceee928bc0b (patch)
treed6e971d1323b76349efd196164bff9e44dd815a3
parent3f2a90a33ce303046fce820f3934aefe23abb065 (diff)
downloadbusybox-2b995269d5c0baa89649bfb6268a5ceee928bc0b.zip
busybox-2b995269d5c0baa89649bfb6268a5ceee928bc0b.tar.gz
busybox-2b995269d5c0baa89649bfb6268a5ceee928bc0b.tar.bz2
[x86] Changes and Additions to fix broken x86 build
Add missing syscalls to android/libc/arch-x86/syscalls Remove #undef HAVE_GETLINE from platform.h Fixes definition conflict warnings for x86 but is also suitable for arm as bionic has had a getline implementation for a while now Remove hardcoded CONFIG_CROSS_COMPILER_PREFIX from .config-full and .config-minimal. This is now appended to .config as part of the prepare target in Android.mk It appears no other changes are needed to other files such as bbconfigopts.h etc as these are autogenerated when make prepare is run. Android.mk: Added missing syscalls source to BUSYBOX_SRC_FILES when TARGET_ARCH=x86. Added appending of the CONFIG_CROSS_COMPILER_PREFIX to the .config file based on the TARGET_ARCH Change-Id: I4f550757b3209b852cd5a017e88dce50678e5734
Diffstat
-rw-r--r--.config-full1
-rw-r--r--.config-minimal1
-rw-r--r--Android.mk20
-rw-r--r--android/libc/arch-x86/syscalls/adjtimex.S26
-rw-r--r--android/libc/arch-x86/syscalls/getsid.S25
-rw-r--r--android/libc/arch-x86/syscalls/stime.S26
-rw-r--r--android/libc/arch-x86/syscalls/swapoff.S25
-rw-r--r--android/libc/arch-x86/syscalls/swapon.S28
-rw-r--r--android/libc/arch-x86/syscalls/sysinfo.S25
-rw-r--r--include/platform.h1
10 files changed, 175 insertions, 3 deletions
diff --git a/.config-full b/.config-full
index 039eadc..e893fec 100644
--- a/.config-full
+++ b/.config-full
@@ -62,7 +62,6 @@ CONFIG_FEATURE_HAVE_RPC=y
# CONFIG_FEATURE_INDIVIDUAL is not set
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
# CONFIG_LFS is not set
-CONFIG_CROSS_COMPILER_PREFIX="arm-eabi-"
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS="-Os -fno-short-enums -fgcse-after-reload -frerun-cse-after-loop -frename-registers"
CONFIG_EXTRA_LDFLAGS=""
diff --git a/.config-minimal b/.config-minimal
index 7f860b6..3a189cf 100644
--- a/.config-minimal
+++ b/.config-minimal
@@ -62,7 +62,6 @@ CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
# CONFIG_FEATURE_INDIVIDUAL is not set
# CONFIG_FEATURE_SHARED_BUSYBOX is not set
# CONFIG_LFS is not set
-CONFIG_CROSS_COMPILER_PREFIX="arm-eabi-"
CONFIG_SYSROOT=""
CONFIG_EXTRA_CFLAGS="-Os"
CONFIG_EXTRA_LDFLAGS=""
diff --git a/Android.mk b/Android.mk
index 4b6ae8f..3b00884 100644
--- a/Android.mk
+++ b/Android.mk
@@ -25,6 +25,14 @@ include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH := $(BB_PATH)
include $(CLEAR_VARS)
+# Explicitly set an architecture specific CONFIG_CROSS_COMPILER_PREFIX
+ifeq ($(TARGET_ARCH),arm)
+ BUSYBOX_CROSS_COMPILER_PREFIX := "arm-eabi-"
+endif
+ifeq ($(TARGET_ARCH),x86)
+ BUSYBOX_CROSS_COMPILER_PREFIX := "i686-linux-android-"
+endif
+
# Each profile require a compressed usage/config, outside the source tree for git history
# We keep the uncompressed headers in local include-<profile> to track config changes.
# TODO: generate includes in out/
@@ -35,6 +43,7 @@ include $(CLEAR_VARS)
# Execute make clean, make prepare and copy profiles required for normal & static lib (recovery)
+
KERNEL_MODULES_DIR ?= /system/lib/modules
BUSYBOX_CONFIG := minimal full
$(BUSYBOX_CONFIG):
@@ -42,6 +51,7 @@ $(BUSYBOX_CONFIG):
@cd $(BB_PATH) && make clean
@cd $(BB_PATH) && git clean -f -- ./include-$@/
cp $(BB_PATH)/.config-$@ $(BB_PATH)/.config
+ echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" >> $(BB_PATH)/.config
cd $(BB_PATH) && make prepare
@#cp $(BB_PATH)/.config $(BB_PATH)/.config-$@
@mkdir -p $(BB_PATH)/include-$@
@@ -76,6 +86,16 @@ ifeq ($(TARGET_ARCH),arm)
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
+endif
+
ifeq ($(TARGET_ARCH),mips)
BUSYBOX_SRC_FILES += \
android/libc/arch-mips/syscalls/adjtimex.S \
diff --git a/android/libc/arch-x86/syscalls/adjtimex.S b/android/libc/arch-x86/syscalls/adjtimex.S
new file mode 100644
index 0000000..869baf0
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/adjtimex.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type adjtimex, @function
+ .globl adjtimex
+ .align 4
+
+
+adjtimex:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_adjtimex, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
+
diff --git a/android/libc/arch-x86/syscalls/getsid.S b/android/libc/arch-x86/syscalls/getsid.S
new file mode 100644
index 0000000..6fe39eb
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/getsid.S
@@ -0,0 +1,25 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type getsid, @function
+ .globl getsid
+ .align 4
+
+getsid:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_getsid, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
+
diff --git a/android/libc/arch-x86/syscalls/stime.S b/android/libc/arch-x86/syscalls/stime.S
new file mode 100644
index 0000000..185e26f
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/stime.S
@@ -0,0 +1,26 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type stime, @function
+ .globl stime
+ .align 4
+
+
+stime:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_stime, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
+
diff --git a/android/libc/arch-x86/syscalls/swapoff.S b/android/libc/arch-x86/syscalls/swapoff.S
new file mode 100644
index 0000000..f13833c
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/swapoff.S
@@ -0,0 +1,25 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type swapoff, @function
+ .globl swapoff
+ .align 4
+
+swapoff:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_swapoff, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
+
diff --git a/android/libc/arch-x86/syscalls/swapon.S b/android/libc/arch-x86/syscalls/swapon.S
new file mode 100644
index 0000000..fe554a6
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/swapon.S
@@ -0,0 +1,28 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type swapon, @function
+ .globl swapon
+ .align 4
+
+swapon:
+ pushl %ebx
+ pushl %ecx
+ mov 12(%esp), %ebx
+ mov 16(%esp), %ecx
+ movl $__NR_swapon, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ecx
+ popl %ebx
+ ret
+
diff --git a/android/libc/arch-x86/syscalls/sysinfo.S b/android/libc/arch-x86/syscalls/sysinfo.S
new file mode 100644
index 0000000..bafe20d
--- a/dev/null
+++ b/android/libc/arch-x86/syscalls/sysinfo.S
@@ -0,0 +1,25 @@
+/* autogenerated by gensyscalls.py */
+#include <linux/err.h>
+#include <asm/unistd.h>
+
+ .text
+ .type sysinfo, @function
+ .globl sysinfo
+ .align 4
+
+sysinfo:
+ pushl %ebx
+ mov 8(%esp), %ebx
+ movl $__NR_sysinfo, %eax
+ int $0x80
+ cmpl $-MAX_ERRNO, %eax
+ jb 1f
+ negl %eax
+ pushl %eax
+ call __set_errno
+ addl $4, %esp
+ orl $-1, %eax
+1:
+ popl %ebx
+ ret
+
diff --git a/include/platform.h b/include/platform.h
index 1bbbfe7..8a5cde4 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -452,7 +452,6 @@ typedef unsigned smalluint;
#if defined(ANDROID) || defined(__ANDROID__)
# undef HAVE_DPRINTF
# undef HAVE_FDPRINTF
-# undef HAVE_GETLINE
# undef HAVE_STPCPY
# undef HAVE_STRCHRNUL
# undef HAVE_STRVERSCMP