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

Fails to compile on modern systems (such as Ubuntu 18.04) #54

Closed athas closed 5 years ago

athas commented 6 years ago

make fails with the following:

/usr/bin/x86_64-linux-gnu-ld: expand.o: relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: callback.o: relocation R_X86_64_32S against undefined symbol `first_atoms' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:37: recipe for target 'camlrunm' failed
make[1]: *** [camlrunm] Error 1
make[1]: Leaving directory '/home/athas/mosml/src/runtime'
Makefile:19: recipe for target 'world' failed
make: *** [world] Error 2

Things seem to work if I just jam CFLAGS=-fPIC into Makefile.inc. I don't know if there is a better way to handle this.

kfl commented 5 years ago

I cannot reproduce this, and it seems strange as -fPIC should be added to ADDRUNCFLAGS per default in src/Makefile.inc unless you changed something.

Can you perhaps provide the Makefile.inc you are using?

athas commented 5 years ago

It seems to work now. Maybe I was using an elderly tarball or something.