Changeset 15012


Ignore:
Timestamp:
Oct 7, 2011, 3:24:39 PM (8 years ago)
Author:
gb
Message:

linux-files.lisp: try to use #_dladdr in Android version of
%probe-shared-library. Don't know if that works, but #$RTLD_NOLOAD
isn't defined and (probably) isn't supported on Android.

lisp-kernel/androidarm/Makefile: use current (r6b) Android NDK;
use Android-9 API (2.3).

lisp-kernel/pmcl-kernel: when reading /proc/cpuinfo to determine
ARM arch, use fgets() because Android doesn't offer getline().

Location:
trunk/source
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/linux-files.lisp

    r15009 r15012  
    977977       
    978978(defun %probe-shared-library (shlib)
    979   #-(or windows-target freebsd-target)
     979  #-(or windows-target android-target freebsd-target)
    980980  (with-cstrs ((name (shlib.pathname shlib)))
    981981    (not (%null-ptr-p (#_dlopen name (logior #$RTLD_NOW #$RTLD_NOLOAD)))))
    982982  ;; FreeBSD may support #$RTLD_NOLOAD in 8.0, and that support may
    983983  ;; have been backported to 7.2.  Until then ...
    984   #+freebsd-target                     
     984  #+(or freebsd-target android-target)
    985985  (rlet ((info #>Dl_info))
    986986    (not (eql 0 (#_dladdr (shlib.base shlib) info))))
  • trunk/source/lisp-kernel/androidarm/Makefile

    r14570 r15012  
    1515
    1616LIBBASE = 0x04001000
    17 NDK = /usr/local/android-ndk-r5
     17NDK = /usr/local/android-ndk-r6b
    1818HOST = darwin-x86
    19 ANDROIDVERSION = android-8
     19ANDROIDVERSION = android-9
    2020SYSROOT = $(NDK)/platforms/$(ANDROIDVERSION)/arch-arm
    2121NDKLIB = $(SYSROOT)/usr/lib
     
    9494
    9595../../aarmcl.so:        $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) ./armandroid.x ./fixlib
    96         $(LD) --shared -Bdynamic -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl.so  -L $(NDKLIB) pad.o arm-spentry.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 -M
     96        $(LD) --shared -Bdynamic -dynamic-linker /system/bin/linker -nostdlib -z nocopyreloc  -o ../../aarmcl.so  -L $(NDKLIB) pad.o arm-spentry.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
    9797        ./fixlib $(LIBBASE) >> ../../aarmcl.so
    9898
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r14953 r15012  
    15711571*/
    15721572  FILE *f = fopen("/proc/cpuinfo", "r");
    1573   char *procline = NULL, *cpuline = NULL, **lineptr, *line = NULL;
     1573  char *procline = NULL, *cpuline = NULL, line[129], *workline;
    15741574  size_t n;
    1575   ssize_t result;
    15761575
    15771576  if (f) {
    15781577    while (1) {
    1579       n = 0;
    1580       line = NULL;
    1581       lineptr = &line;
    1582       result = getline(lineptr, &n, f);
    1583       if (result < 0) {
     1578      if (fgets(line,128,f)==NULL) {
    15841579        break;
    15851580      }
    1586       line = *lineptr;
     1581      n = strlen(line);
    15871582      if (strncmp(line,"Processor",sizeof("Processor")-1) == 0) {
    1588         procline = line;
     1583        procline = malloc(n+1);
     1584        strcpy(procline,line);
     1585        procline[n]='\0';
    15891586      } else if (strncmp(line, "CPU architecture",sizeof("CPU architecture")-1) == 0) {
    1590         cpuline = line;
    1591       } else {
    1592         free(line);
     1587        cpuline = malloc(n+1);
     1588        strcpy(cpuline,line);
     1589        cpuline[n] = '\0';
    15931590      }
    15941591    }
    1595     line = NULL;
    15961592    if (cpuline) {
    1597       line = index(cpuline,':');
    1598       if (line) {
    1599         n = strtol(line+1,lineptr,0);
     1593      workline = index(cpuline,':');
     1594      if (workline) {
     1595        n = strtol(workline+1,NULL,0);
    16001596        if (n >= 7) {
    16011597          if (n == 7) {
Note: See TracChangeset for help on using the changeset viewer.