Changeset 14321


Ignore:
Timestamp:
Oct 2, 2010, 12:26:20 PM (9 years ago)
Author:
gb
Message:

Build using the Android NDK, not via an ARM Linux-hosted toolchain.
Be sure to use -fpic when compiling C code.
Use an Android-specific linker script.

Location:
trunk/source/lisp-kernel/androidarm
Files:
1 added
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/androidarm/Makefile

    r14268 r14321  
    1414#   http://opensource.franz.com/preamble.html
    1515
    16 
     16NDK = /usr/local/android-ndk-r4b
     17HOST = linux-x86
     18ANDROIDVERSION = android-8
     19NDKLIB = $(NDK)/build/platforms/$(ANDROIDVERSION)/arch-arm/usr/lib
    1720VPATH = ../
    1821RM = /bin/rm
    19 # Versions of GNU as >= 2.9.1 all seem to work
    20 # AS = gas-2.9.1
    21 AS = as
     22AS = $(NDK)/build/prebuilt/$(HOST)/arm-eabi-4.4.0/bin/arm-eabi-as
     23CC = $(NDK)/build/prebuilt/$(HOST)/arm-eabi-4.4.0/bin/arm-eabi-gcc
     24LD = $(NDK)/build/prebuilt/$(HOST)/arm-eabi-4.4.0/bin/arm-eabi-ld
    2225M4 = m4
    2326ASFLAGS = -mfpu=vfpv2
     
    2528CDEFINES = -DLINUX -DARM -DANDROID -D_REENTRANT -D_GNU_SOURCE -DUSE_FUTEX
    2629CDEBUG = -g
    27 COPT = -O2
     30COPT = #-O2
    2831# Once in a while, -Wformat says something useful.  The odds are against that,
    2932# however.
    3033WFORMAT = -Wno-format
    3134PLATFORM_H = platform-androidarm.h
    32 NDK=/usr/local/src/ndk
     35
    3336
    3437# If the linker supports a "--hash-style=" option, use traditional
     
    4346
    4447
    45 # Likewise, some versions of GAS may need a "-a32" flag, to force the
    46 
    47 # output file to be 32-bit compatible.
    48 
    49 A32 = $(shell ($(AS) --help -v 2>&1 | grep -q -e "-a32") && /bin/echo "-a32")
    5048
    5149.s.o:
    52         $(M4) $(M4FLAGS) -I../ $< | $(AS) $(A32) $(ASFLAGS) -o $@
     50        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
    5351.c.o:
    54         $(CC) -include ../$(PLATFORM_H) -nostdinc -isystem ${NDK}/usr/gcc-include -isystem $(NDK)/usr/include -isystem . -c $<  $(CDEFINES) $(CDEBUG) $(COPT)  $(WFORMAT)  -o $@
     52        $(CC) -include ../$(PLATFORM_H) -I. -I$(NDK)/build/platforms/$(ANDROIDVERSION)/arch-arm/usr/include -c $<  $(CDEFINES) $(CDEBUG) $(COPT) -fpic  $(WFORMAT)  -o $@
    5553
    5654# -nostdinc -isystem ${NDK}/usr/gcc-include -isystem $(NDK)/usr/include
     
    8280# all:  ../../armcl ../../subprims.so
    8381
    84 OSLIBS = -ldl -lm $(NDK)/usr/lib/crtbegin_dynamic.o $(NDK)/usr/lib/crtend_android.o
     82OSLIBS = -ldl -lm -lc $(NDKLIB)/crtbegin_dynamic.o $(NDKLIB)/crtend_android.o
    8583
    8684
    8785../../aarmcl:   $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ)
    88         $(LD) --build-id -e _start --eh-frame-hdr -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -nostdlib -o ../../aarmcl -z relro  --hash-style=sysv -L$(NDK)/usr/lib pad.o arm-spentry.o arm-subprims.o pmcl-kernel.o gc-common.o arm-gc.o bits.o arm-exceptions.o image.o thread_manager.o lisp-debug.o memory.o unix-calls.o arm-asmutils.o imports.o lispdcmd.o plprint.o plsym.o albt.o arm_print.o -ldl -lm /usr/local/src/ndk/usr/lib/crtbegin_dynamic.o /usr/local/src/ndk/usr/lib/crtend_android.o -lgcc -lc -lgcc  --no-as-needed -T ./armlinux.x
     86        $(LD) -Bdynamic -e _start  -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl  -L $(NDKLIB) pad.o arm-spentry.o arm-subprims.o pmcl-kernel.o gc-common.o arm-gc.o bits.o arm-exceptions.o image.o thread_manager.o lisp-debug.o memory.o unix-calls.o arm-asmutils.o imports.o lispdcmd.o plprint.o plsym.o albt.o arm_print.o $(OSLIBS) -T ./armandroid.x
    8987
    9088
Note: See TracChangeset for help on using the changeset viewer.