[MLton] building mlton for darwin + intel

Thant Tessman thant at tessman.com
Mon Feb 19 05:43:38 PST 2007


Hi,

I posted this to comp.lang.functional, but I thought I'd forward it to 
someone who might care at the mlton.org site. My apologies if this is 
not the right person to send it to, but it's the only e-mail address 
that presented itself right away.

-thant

***


I installed MLton on my MacBook Pro to build a standalone SML
executable. It sorta seems to work, except that at link time it
complained that libmlton.a, libgmp.a, and libgdtoa.a have the wrong
cpu type. This made me guess that mlton is built for the PowerPC, but
that it just happens to run on my intel mac because of rosetta.

I built a custom version of libgmp.a (which only passed the "check"
test if I specified no cpu and no host) and that made the error for
libgmp.a go away (but not the others).

So I decided to get the source for mlton and try to build it. The
compile fails trying to access a member of a structure that doesn't
exist. (I checked the header. It ain't there.) The error is below
(past my standalone app error).

Much obliged for any suggestions.

(What's the status of building standalone apps with SML/NJ?)

-thant

---begin standalone app error---

/usr/bin/ld: warning /usr/local/lib/mlton/self/libmlton.a archive's
cputype (18, architecture ppc) does not match cputype (7) for
specified -arch flag: i386 (can't load from it)
/usr/bin/ld: warning /usr/local/lib/mlton/self/libgdtoa.a archive's
cputype (18, architecture ppc) does not match cputype (7) for
specified -arch flag: i386 (can't load from it)
/usr/bin/ld: Undefined symbols:
_GC_arrayAllocate
_GC_gc
_MLton_bug
_MLton_exit
_Stdio_print
_WordS32_quot
_WordS32_rem
_GC_switchToThread
_MLton_init
_sfread
_swrite
collect2: ld returned 1 exit status
call to system failed with exit status 1:
gcc -std=gnu99 -o tree /tmp/fileUf1EKJ.o /tmp/file1JFxCB.o -L/usr/
local/lib/mlton/self -lmlton -lgmp -lgdtoa -lm
make: *** [check] Error 1

---end standalone app error---

---begin build mlton error---

Compiling MLton runtime system for self.
make -C runtime
gcc -std=gnu99 -O2 -Wall -I. -Iplatform -D_FILE_OFFSET_BITS=64 -fomit-
frame-pointer -falign-loops=2 -falign-jumps=2 -falign-functions=5 -c -
o platform/darwin.o platform/darwin.c
platform/darwin.c: In function 'catcher':
platform/darwin.c:13: error: 'i386_thread_state_t' has no member named
'srr0'
platform/darwin.c: In function 'getTextStart':
platform/darwin.c:30: warning: '_dyld_lookup_and_bind' is deprecated
(declared at /usr/include/mach-o/dyld.h:298)
platform/darwin.c:30: warning: passing argument 2 of
'_dyld_lookup_and_bind' from incompatible pointer type
platform/darwin.c:30: warning: passing argument 3 of
'_dyld_lookup_and_bind' from incompatible pointer type
platform/darwin.c:31: warning: passing argument 1 of
'_dyld_get_image_header_containing_address' makes pointer from integer
without a cast
platform/darwin.c:31: warning: assignment discards qualifiers from
pointer target type
make[2]: *** [platform/darwin.o] Error 1
make[1]: *** [runtime] Error 2
make: *** [all-no-docs] Error 2

--- end build mlton error---



More information about the MLton mailing list