[erlang-questions] Compiling Erlang for the iPhone

Matt Williamson <>
Sat Mar 28 23:14:24 CET 2009


I made a little more progess with R13, but it seems even though I am
specifying make *noboot* erlc is still trying to run. IT will not run as I
am compiling for a different architecture!:

=== Entering application stdlib
erlc -W  +debug_info -I../include -I../../kernel/include -o../ebin array.erl
./array.erl:156: bad attribute
./array.erl:177: type array() undefined
./array.erl:221: type array() undefined
./array.erl:242: type array() undefined
./array.erl:309: type array() undefined
./array.erl:320: type array() undefined
./array.erl:404: type array() undefined
./array.erl:404: type array() undefined
./array.erl:415: type array() undefined
./array.erl:454: type array() undefined
./array.erl:454: type array() undefined
./array.erl:480: type array() undefined
./array.erl:480: type array() undefined
./array.erl:513: type array() undefined
./array.erl:513: type array() undefined
./array.erl:564: type array() undefined
./array.erl:564: type array() undefined
./array.erl:628: type array() undefined
./array.erl:669: type array() undefined
./array.erl:669: type array() undefined
./array.erl:727: type array() undefined
./array.erl:801: type array() undefined
./array.erl:869: type array() undefined
./array.erl:882: type array() undefined
./array.erl:980: type array() undefined
./array.erl:1073: type array() undefined
./array.erl:1154: type array() undefined
./array.erl:1169: type array() undefined
./array.erl:1256: type array() undefined
./array.erl:1256: type array() undefined
./array.erl:1348: type array() undefined
./array.erl:1348: type array() undefined
./array.erl:1446: type array() undefined
./array.erl:1521: type array() undefined
./array.erl:1600: type array() undefined
./array.erl:1681: type array() undefined
./array.erl:1732: type array() undefined
make[4]: *** [../ebin/array.beam] Error 1
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [libs] Error 2
make: *** [noboot] Error 2


On Sat, Mar 28, 2009 at 5:38 PM, Matt Williamson <>wrote:

> I've gotten past the CPP fails error by setting it to the correct version
> (iPhone SDK)  and have gotten it to configure correctly:
>
>
>    - nano erts/configure
>    - Search (Ctrl+W for nano) for "checking whether getaddrinfo accepts
>    enough flags" without the quotes and then remove the entire line a couple
>    lines down which contains the command "{ (exit 1); exit 1; }; }" and replace
>    the whole line with a single "}" without the quotes.
>
>
>
> export
> CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
> export CPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
> export LD="/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ld"
> export
> RANLIB=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib
> export AR=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ar
> export CXXPP=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/cpp
> export CXX=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++
> export NM=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/nm
>
> export CFLAGS="-arch
> armv6-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/usr/include/
> -isysroot
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk"
> export CXXFLAGS=$CFLAGS
> export LDFLAGS=$CFLAGS
>
> ./configure --host=arm-apple-darwin --target=arm-apple-darwin
> --prefix=/usr/local/iphone --target=arm-apple-darwin --disable-smp-support
>
> *********************************************************************
> **********************  APPLICATIONS DISABLED  **********************
> *********************************************************************
>
> crypto         : No usable OpenSSL found
> odbc           : ODBC library - link check failed
> ssh            : No usable OpenSSL found
> ssl            : No usable OpenSSL found
>
> *********************************************************************
>
>
> But then when I run make, I get pretty far, but I run into an error at:
>
> erl_memory.c:2620: warning: pointer targets in passing argument 3 of
> ‘accept’ differ in signedness
> /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
> -DUSE_THREADS  -D_THREAD_SAFE -D_REENTRANT  -arch
> armv6-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/usr/include/
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/emulator/arm-apple-darwin/opt/smp/
> -isysroot
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/arm-apple-darwin
> -no-cpp-precomp   -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/include
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/include/arm-apple-darwin
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/include/internal
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/include/internal/arm-apple-darwin
> -o ../obj/arm-apple-darwin/opt/emem/erl_memory_trace_block_table.o -c
> erl_memory_trace_block_table.c
> /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin9-gcc-4.0.1
> -arch
> armv6-I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/usr/include/
> -I/Users/dawsdesign/Projects/otp_src_R12B-5/erts/emulator/arm-apple-darwin/opt/smp/
> -isysroot
> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk  -o
> ../bin/arm-apple-darwin/emem ../obj/arm-apple-darwin/opt/emem/erl_memory.o
> ../obj/arm-apple-darwin/opt/emem/erl_memory_trace_block_table.o -lutil -ldl
> -lm   -L/Users/dawsdesign/Projects/otp_src_R12B-5/erts/lib/arm-apple-darwin
> -L/Users/dawsdesign/Projects/otp_src_R12B-5/erts/lib/internal/arm-apple-darwin
> -lerts_r -lethread -lpthread
> ld warning: in
> /Users/dawsdesign/Projects/otp_src_R12B-5/erts/lib/arm-apple-darwin/liberts_r.a,
> file is not of required architecture
> Undefined symbols:
>   "_emtp_get_info", referenced from:
>       _complete_state in erl_memory.o
>   "_emtp_state_new", referenced from:
>       _new_state in erl_memory.o
>   "_emtp_parse", referenced from:
>       _process_trace in erl_memory.o
>       _process_trace in erl_memory.o
>   "_emtp_error_string", referenced from:
>       _error_string in erl_memory.o
>   "_emtp_state_destroy", referenced from:
>       _destroy_state in erl_memory.o
>       _new_state in erl_memory.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> make[4]: *** [../bin/arm-apple-darwin/emem] Error 1
> make[3]: *** [opt] Error 2
> make[2]: *** [opt] Error 2
> make[1]: *** [opt] Error 2
> make: *** [libs] Error 2
>
>
> I get even further compiling directly on the iPhone, but when it goes to
> compile pcre, it runs out of memory and reboots. Anyone have any ideas.
>
>
>
> On Thu, Sep 18, 2008 at 4:59 AM, Tony Rogvall <> wrote:
>
>> There are alternatives.
>>
>> You do not have to go the apple way if you use Pawnage tool. Then you
>> can build packages
>> for the Cydia installer.
>> The cross compiler can be found at Mac Ports. It require that you do
>> have a copy of the root file system on
>> the build machine.
>>
>> /Tony
>>
>>
>>
>> On 18 sep 2008, at 02.58, Bob Ippolito wrote:
>>
>> > I think it might actually say that you can't have a VM or interpreter
>> > that will run code over the network, I think you can use one as long
>> > as the code it's executing is static.
>> >
>> > (I haven't read the SDK agreement, but I did hear people talking at
>> > length about iPhone stuff at C4[2] recently)
>> >
>> > On Wed, Sep 17, 2008 at 11:56 AM, Andy Gross <>
>> > wrote:
>> >>
>> >> Uwe,
>> >>
>> >> Unfortunately, the iPhone SDK Agreement forbids installation of non-
>> >> Apple VMs or interpreters.   :(
>> >>
>> >> Andy
>> >>
>> >>
>> >> On Sep 14, 2008, at 12:49 PM, Uwe Dauernheim wrote:
>> >>
>> >>> Hej Chris,
>> >>>
>> >>> of course I'll do so, if I can deliver a benefit to the community.
>> >>>
>> >>> By the way: Anyone expierenced in the error message >>"lib/cpp"
>> >>> fails
>> >>> sanity check<<? That is one of my problems at the moment.
>> >>>
>> >>> Regards,
>> >>> Uwe
>> >>>
>> >>> --
>> >>>
>> >>> Am 14.09.2008 um 18:22 schrieb Chris Anderson:
>> >>>
>> >>>> On Sun, Sep 14, 2008 at 9:16 AM, Uwe Dauernheim
>> >>>> <>
>> >>>> wrote:
>> >>>>> I'd like to compile Erlang for the iPhone.
>> >>>>
>> >>>> Uwe,
>> >>>>
>> >>>> I'm sorry I can't be helpful with an answer to your question, but I
>> >>>> am
>> >>>> very interested in your result. Please keep us posted on this
>> >>>> list if
>> >>>> you have success!
>> >>>>
>> >>>> Thanks,
>> >>>> Chris
>> >>>>
>> >>>> --
>> >>>> Chris Anderson
>> >>>> http://jchris.mfdz.com
>> >>>
>> >>> _______________________________________________
>> >>> erlang-questions mailing list
>> >>> 
>> >>> http://www.erlang.org/mailman/listinfo/erlang-questions
>> >>
>> >> _______________________________________________
>> >> erlang-questions mailing list
>> >> 
>> >> http://www.erlang.org/mailman/listinfo/erlang-questions
>> >>
>> > _______________________________________________
>> > erlang-questions mailing list
>> > 
>> > http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090328/e173587c/attachment.html>


More information about the erlang-questions mailing list