[MLton-user] static link on mac

Sean McLaughlin seanmcl at gmail.com
Sat Sep 29 20:17:27 PDT 2007


Hello,

  I'm using a bunch of external libraries, and would like to make a
statically linked
binary.  On linux I just add -link-opt '-static' and it works perfectly.  On
mac though,
the same thing gives the following error, where

tmp.sml is

val _ = print "Hello"


$ mlton -verbose 1 -default-ann 'allowFFI true' -link-opt '-static' tmp.sml
MLton 20051202 (built Fri Dec 02 11:55:50 2005 on darwin.sweeks.com)
MLton starting
   Compile SML starting
      pre codegen starting
      pre codegen finished in 8.16 + 2.04 (20% GC)
      C code gen starting
      C code gen finished in 0.05 + 0.00 (0% GC)
   Compile SML finished in 8.21 + 2.04 (20% GC)
   Compile C and Assemble starting
      gcc -std=gnu99 -c -I/usr/local/lib/mlton/include -O1 \
          -fno-strict-aliasing -fomit-frame-pointer -w -I/sw/include -o \
          /tmp/filemctdjQ.o /tmp/fileVl2S0f.1.c
      gcc -std=gnu99 -c -I/usr/local/lib/mlton/include -O1 \
          -fno-strict-aliasing -fomit-frame-pointer -w -I/sw/include -o \
          /tmp/filekzwTsb.o /tmp/filewz5Zuz.0.c
   Compile C and Assemble finished in 3.48 + 0.00 (0% GC)
   Link starting
      gcc -std=gnu99 -o tmp /tmp/filemctdjQ.o /tmp/filekzwTsb.o \
          -L/usr/local/lib/mlton/self -lmlton -L/sw/lib -lgmp -lgdtoa -lm \
          -static
/usr/bin/ld: can't locate file for: -lcrt0.o
collect2: ld returned 1 exit status
   Link raised in 0.04 + 0.00 (0% GC)
MLton raised in 11.76 + 2.05 (15% GC)
call to system failed with exit status 1:
gcc -std=gnu99 -o tmp /tmp/filemctdjQ.o /tmp/filekzwTsb.o
-L/usr/local/lib/mlton/self -lmlton -L/sw/lib -lgmp -lgdtoa -lm -static


I can't find anything with that name on my system.

Thanks,

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mlton.org/pipermail/mlton-user/attachments/20070929/144ae5b6/attachment.html


More information about the MLton-user mailing list