[MLton] MacOS linking broken?

Matthew Fluet fluet at cs.cornell.edu
Thu Dec 7 07:57:29 PST 2006


> It appears that linking MLton programs with Mac OS X frameworks is 
> broken in the latest SVN revision (it was working in r4796).  When I try 
> to compile a program that compiled before, I get errors like the 
> following:
>
> /usr/bin/ld: Undefined symbols:
> _glBegin
...

> Did something change in the compiler that might account for this 
> problem? The actual linking commands look almost identical:

There was a big merge of changes to the runtime (and some consequent 
changes to the implementation of the Basis Library), but I wouldn't have 
expected this to affect linking behavior.

> OLD:
>      gcc -o triangle /tmp/fileeUELQt.o /tmp/filegsk2yH.o \
>          /Users/jhr/Work/hacking/sml3d/glut/glut-glue.o \
>          -L/Users/jhr/Work/mlton/mlton.OLD/build/lib/self -lmlton -L/sw/lib \
>          -lgmp -lgdtoa -lm -framework GLUT -framework OpenGL -framework \
>          Foundation
>
> NEW:
>      gcc -o triangle /tmp/fileZ7FdMM.o /tmp/fileL3aAgK.o \
>          /Users/jhr/Work/hacking/sml3d/glut/glut-glue.o \
>          -L/Users/jhr/Work/mlton/mlton/build/lib/self -lmlton -L/sw/lib \
>          -lgdtoa -lm -lgmp \
>          -framework GLUT -framework OpenGL -framework Foundation

I note that if you compile with -keep o and then replicate the gcc linking 
line at your shell, then the linking succeeds; so, it looks like the call 
to gcc is being messed up somehow, probably in the way arguments are being 
passed.  I'll investigate.




More information about the MLton mailing list