kfl / mosml

Moscow ML is a light-weight implementation of Standard ML (SML), a strict functional language widely used in teaching and research.
http://mosml.org
341 stars 42 forks source link

MosML fails to build on OpenBSD 5.6 in a different way #28

Closed athas closed 9 years ago

athas commented 9 years ago

After using the fix mentioned in the sibling issue, make world can proceed to this far more exciting error:

ld -o camlrunm prims.o interp.o expand.o misc.o stacks.o fix_code.o main.o fail.o signals.o freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o compare.o ints.o floats.o str.o io.o extern.o externcp.o intern.o interncp.o hash.o sys.o meta.o parsing.o lexing.o gc_ctrl.o mosml.o unix.o runtime.o md5sum.o callback.o dynlib.o -lm 
interp.o(.text+0x1c): In function `interprete':
: undefined reference to `__guard_local'
ld: final link failed: Bad value
athas commented 9 years ago

Adding -shared to ADDRUNLIBS in src/Makefile.inc produces this truly amazing error:

ld -o camlrunm prims.o interp.o expand.o misc.o stacks.o fix_code.o main.o fail.o signals.o freelist.o major_gc.o minor_gc.o memory.o alloc.o roots.o compare.o ints.o floats.o str.o io.o extern.o externcp.o intern.o interncp.o hash.o sys.o meta.o parsing.o lexing.o gc_ctrl.o mosml.o unix.o runtime.o md5sum.o callback.o dynlib.o -lm -shared
camlrunm
Ð6pHp¢ @±      Ð!%ü+Ì/1ÆÊæ6ëºÎ3+)5=*4»bCù B򿏴:VÀÝN1k0Ñv$ï7L½Zú;Wp­CR @.j:H\(Y,_~˅seÔ<¢]D{²°îP
Àæ!
   "
è       2ð2BÎ0¢?´       `gløðd` 0N]à;ø O]p8î e: not found
./camlrunm: syntax error: `)' unexpected
./camlrunm[4]: °zG
                  : not found
./camlrunm[4]: Pçìs2à: not found
./camlrunm[389]: no closing quote
athas commented 9 years ago

Wait, of course that happens. I feel like a first year student. Will figure out something else.

athas commented 9 years ago

I managed to get a working build after adding the following block to src/Makefile.inc:

ifeq ($(UNAME_S),OpenBSD)
    ADDRUNLIBS=
    CPP=cpp -P -traditional -Dunix -Umsdos
    STRIP=strip -S
    LD=gcc -rdynamic -Wl,-rpath,$(LIBDIR)
    DYNLD=gcc -shared
endif