[Ecls-list] ECL on iPhone

Red Daly reddaly at gmail.com
Tue Sep 9 19:34:15 UTC 2008


Thank you, Martin, for your knowledgeable explanation.  I was able to
determine that the ARM Apple uses has a VFP co-processor, so I did a little
more testing and eventually found out that... I was using the wrong version
of GCC to build it!  Apple included two versions of GCC for cross-compiling
to ARM, and I used the wrong one.

Unfortunately, I am still having problems.  I believe I am getting through
the configuration process without any warnings (at least when I compile
without GMP). There are new problems in what appears to be the lisp phase of
the build.

My configuration instruction:
#!/bin/sh

./configure \
 --prefix=/Users/red/lib/iphoneos-ecl/ \
 --host=arm-apple-darwin \
 --without-gmp \
 --disable-shared \
 CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0 \
 AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar \
 CFLAGS="-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings
-fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0
-fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphon\
eos-version-min=2.0 -I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk" \
 CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp

The build appears to abort to the top-level

;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0
-Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0
-I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
-Ddarwin -I"/Users/red/Projects/ecl/ecl-iphone/src/c"
"-I/Users/red/Projects/ecl/ecl-iphone/build/" -w -c
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITmuv5u9.c"
-o
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITmuv5u9.o"
;;; Note: Invoking external command:
;;;   ar cr libcmp.a
/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITmuv5u9.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpdefs.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmac.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpinline.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmputil.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptype.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpbind.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpblock.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcall.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcatch.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpenv.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpeval.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpexit.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpflet.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpfun.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpif.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmplam.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmplet.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmploc.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmap.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpstack.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmulti.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpspecial.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptag.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptop.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpvar.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpwt.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpffi.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcbk.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpct.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpnum.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpname.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpopt.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpclos.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpstructures.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmparray.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmain.o
;;; Note: Invoking external command:
;;;   ranlib libcmp.a
;;; Compiling ext:profile;profile.lisp.
;;; OPTIMIZE levels: Safety=2, Space=3, Speed=1, Debug=0
;;; Compiling (DEFUN GET-BYTES-CONSED ...).
;;; Compiling (DEFVAR *PROFILED-FUN-NAME->INFO* ...).
;;; Warning: Ignoring definition for class PROFILE-INFO
;;; No class named PROFILE-INFO.
;;; The variable C::C is unbound.
;;; Note: Creating tag: "_eclL8Sp8No8_cqMFyNy" for
#P"build:ext;profile.o.NEWEST"
;;; Note: Invoking external command:
;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0
-Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0
-I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
-Ddarwin -I"/Users/red/Projects/ecl/ecl-iphone/src/c"
"-I/Users/red/Projects/ecl/ecl-iphone/build/" -w -c
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITlubj6V.c"
-o
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITlubj6V.o"
;;; Note: Invoking external command:
ar: /Users/red/Projects/ecl/ecl-iphone/build/ext/profile.o: No such file or
directory
;;; Warning: Ignoring definition for class SIMPLE-PROGRAM-ERROR
Not a condition type: SIMPLE-PROGRAM-ERROR
;;;   ar cr libprofile.a
/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITlubj6V.o
/Users/red/Projects/ecl/ecl-iphone/build/ext/profile.o Broken at TOP-LEVEL.
File: #P"/Users/red/Projects/ecl/ecl-iphone/src/lsp/top.lsp" (Form #26)No
restarts available.
Top level.
SI>

When I re-run make, I get slightly different output:

...
;;;   ar cr libcmp.a
/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITrELdQO.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpdefs.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmac.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpinline.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmputil.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptype.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpbind.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpblock.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcall.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcatch.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpenv.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpeval.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpexit.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpflet.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpfun.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpif.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmplam.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmplet.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmploc.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmap.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpstack.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmulti.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpspecial.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptag.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmptop.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpvar.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpwt.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpffi.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpcbk.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpct.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpnum.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpname.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpopt.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpclos.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpstructures.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmparray.o
/Users/red/Projects/ecl/ecl-iphone/build/cmp/cmpmain.o
;;; Note: Invoking external command:
;;;   ranlib libcmp.a
;;; Note: Scanning #P"build:ext;profile.o.NEWEST"
;;; Note: Found tag: "_eclL8Sp8No8_zEgGyNy"
;;; Note: Invoking external command:
;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0
-Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0
-I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
-Ddarwin -I"/Users/red/Projects/ecl/ecl-iphone/src/c"
"-I/Users/red/Projects/ecl/ecl-iphone/build/" -w -c
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITcoTKbI.c"
-o
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITcoTKbI.o"
;;; Note: Invoking external command:
;;;   ar cr libprofile.a
/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITcoTKbI.o
/Users/red/Projects/ecl/ecl-iphone/build/ext/profile.o
;;; Note: Invoking external command:
;;;   ranlib libprofile.a
;;; Note: Scanning #P"build:ext;sockets.o.NEWEST"
;;; Note: Found tag: "_ecl3HaOXjm8_qKgGyNy"
;;; Note: Invoking external command:
;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0
-Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0
-I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
-Ddarwin -I"/Users/red/Projects/ecl/ecl-iphone/src/c"
"-I/Users/red/Projects/ecl/ecl-iphone/build/" -w -c
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITISkJE1.c"
-o
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITISkJE1.o"
;;; Note: Invoking external command:
;;;   ar cr libsockets.a
/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINITISkJE1.o
/Users/red/Projects/ecl/ecl-iphone/build/ext/sockets.o
;;; Note: Invoking external command:
;;;   ranlib libsockets.a
;;; Note: Invoking external command:
;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0
-arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0
-Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden
-miphoneos-version-min=2.0 -gdwarf-2 -mthumb -miphoneos-version-min=2.0
-I/Library/iPhone/include -isysroot
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk
-Ddarwin -I"/Users/red/Projects/ecl/ecl-iphone/src/c"
"-I/Users/red/Projects/ecl/ecl-iphone/build/" -w -c
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINIT4afjrO.c"
-o
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINIT4afjrO.o"
;;; Note: Invoking external command:
gcc-4.0: installation problem, cannot exec
'/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/i686-apple-darwin9-gcc-4.0.1':
No such file or directory
LAMBDA: Too many arguments to function CONTINUE.
;;;   /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0 -o
"/Users/red/Projects/ecl/ecl-iphone/build/bin/ecl"
-L"/Users/red/Projects/ecl/ecl-iphone/build/"
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINIT4afjrO.o"
"-lsockets" "-lprofile" "-lcmp" "-L./"   libecl.a -leclgc    -lm  Broken at
TOP-LEVEL. File: #P"/Users/red/Projects/ecl/ecl-iphone/src/lsp/top.lsp"
(Form #26)No restarts available.
Top level.
SI> (quit)


>From what I can tell, one problem is that not all the GCC flags I specified
in the configuration stage are preserved in this latter stage of the build.

The command issued at the end of the final output,
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0 -o
"/Users/red/Projects/ecl/ecl-iphone/build/bin/ecl"
-L"/Users/red/Projects/ecl/ecl-iphone/build/"
"/private/var/folders/bZ/bZzxCBiyF0ec7xuYjNmSMk+++TI/-Tmp-/ECLINIT4afjrO.o"
"-lsockets" "-lprofile" "-lcmp" "-L./"   libecl.a -leclgc    -lm

does not contain the -arch arm etc. flags specified in my call to
configure.  However, many other calls to gcc do have those flags.

The AR value I specify also does not make it all the way to the lisp stage.
Commands like " ar cr libsockets.a ..." are being called instead of
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar.  I'm not sure
what difference this makes.

I will keep hacking away at this but your expert opinions would be helpful!
I avoid C as much as I can, so this is a different world.

Thanks,
Red


On Tue, Sep 9, 2008 at 1:59 AM, Red Daly <reddaly at gmail.com> wrote:

> ECLispers,
>
> I am trying to cross-compile ECL to work on the iPhone, which uses an ARM
> v6 architecture, little endian.
>
> I have successfully built and tested ECL, with all the default features
> enabled, for my Darwin i686 Intel Mac.  I can use it within the iPhone
> Simulator (which does not simulate the architecture).. pretty cool
>
> However, the hard part is getting ECL to cross-compile correctly for an ARM
> processor.  I have run into bugs with fenv.h
>
> Here is my ./configure command with tons of arguments to work correctly for
> the iPhone.  (I have inserted some line spaces to make it readable
>
> ./configure
>   --prefix=/Users/red/lib/iphoneos-ecl/
>   --host=arm-apple-darwin
>   --without-gmp
>
> CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
>   CFLAGS="-arch armv6 -pipe -std=c99 -miphoneos-version-min=2.0 -gdwarf-2
> -I/Library/iPhone/include -isysroot
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk"
>    CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
> AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
>
> When I run configure, it accurately predicts trouble with fenv.h:
> configure: WARNING: fenv.h: present but cannot be compiled
> configure: WARNING: fenv.h:     check for missing prerequisite headers?
> configure: WARNING: fenv.h: see the Autoconf documentation
> configure: WARNING: fenv.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: fenv.h: proceeding with the preprocessor's result
> configure: WARNING: fenv.h: in the future, the compiler will take
> precedence
>
> the offending section in fenv.h is:
> /*  We require VFP for this set of interfaces to work  */
> #if !defined(__VFP_FP__) || defined(__SOFTFP__)
>     #error  This fenv header and set of APIs is intended for the ARM (with
> VFP) architecture only.
> #endif
>
> Unfortunately I don't know what VFP_FP means.  I am guessing that I am not
> including some necessary headers, but I don't know what they are.
>
>
> As you can see, I am compiling without support for GMP.  When I enable it,
> I get the following error during configure:
>
> checking compiler
> /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
> -fPIC -fno-common -arch armv6 -pipe -std=c99 -Wno-trigraphs -fpascal-strings
> -fasm-blocks -O0 -Wreturn-type -Wunused-variable -fmessage-length=0
> -fvisibility=hidden -miphoneos-version-min=2.0 -gdwarf-2 -mthumb
> -miphoneos-version-min=2.0 -I/Library/iPhone/include -isysroot
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk -fPIC
> -fno-common  ... no, long long reliability test 1
> configure: error: could not find a working compiler, see config.log for
> details
>
>
> I would appreciate any help you can give regarding these two issues.
>
> Red
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20080909/d6aae34a/attachment.html>


More information about the ecl-devel mailing list