Skip to content

Commit

Permalink
[MIPS][X86] Updated to build X86 and to build MIPS correctly.
Browse files Browse the repository at this point in the history
2. Updated Makefile:

   A. Now supports ARCH X86.

   B. Builds MIPS ARCH with _MIPS_SIM_ABI32:
      i) Was building with -D_MIPS_SIM=_MIPS_SIM_NABI32 to get around
         a problem with system call numbers not being defined for ABI32.
         Likely deserves a better fix.

Signed-off-by: Pete Delaney <[email protected]>
Signed-off-by: Tias Guns <[email protected]>
  • Loading branch information
Pete Delaney authored and tias committed Jan 23, 2013
1 parent 3fa3ae7 commit e71bc43
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Point to your android-ndk installation
ANDROID_NDK="/opt/android-ndk"

# Pick your target ARCH (arm,mips)
# Pick your target ARCH (arm,mips,x86)
ARCH=arm

# Config to use
Expand All @@ -27,10 +27,20 @@ endif

#
# MIPS SETUP
# NOTE: MIPS_SIM_NABI32 is a 64bit ABI; Android uses MIPS_SIM_ABI32
#
ifeq ($(ARCH),mips)
GCC_PREFIX="$(ANDROID_NDK)/toolchains/mipsel-linux-android-4.4.3/prebuilt/linux-x86/bin/mipsel-linux-android-"
EXTRA_CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -fpic -fno-short-enums -fgcse-after-reload -frename-registers -U_MIPS_SIM -D_MIPS_SIM=_MIPS_SIM_NABI32"
EXTRA_CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -fpic -fno-short-enums -fgcse-after-reload -frename-registers -U_MIPS_SIM -D_MIPS_SIM=_MIPS_SIM_ABI32"
EXTRA_LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined ${SYSROOT}/usr/lib/crtbegin_dynamic.o ${SYSROOT}/usr/lib/crtend_android.o"
endif

#
# X86 SETUP
#
ifeq ($(ARCH),x86)
GCC_PREFIX="$(ANDROID_NDK)/toolchains/x86-4.4.3/prebuilt/linux-x86/bin/i686-android-linux-"
EXTRA_CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -nostdlib -fpic -fno-short-enums -fgcse-after-reload -frename-registers -Dhtons=__swap16 -Dhtonl=__swap32 -Dntohs=__swap16 -Dntohl=__swap32 -D_XOPEN_SOURCE -D_POSIX_C_SOURCE"
EXTRA_LDFLAGS="-Xlinker -z -Xlinker muldefs -nostdlib -Bdynamic -Xlinker -dynamic-linker -Xlinker /system/bin/linker -Xlinker -z -Xlinker nocopyreloc -Xlinker --no-undefined ${SYSROOT}/usr/lib/crtbegin_dynamic.o ${SYSROOT}/usr/lib/crtend_android.o"
endif

Expand Down

0 comments on commit e71bc43

Please sign in to comment.