On 06/01/2016 15:44, Anthony Fox wrote:
When trying to build Poly/ML with
./configure --enabled-shared
I got
ld: illegal text-relocation to 'assign_word' in .libs/x86asmtemp.o from '_entryPointVector' in .libs/x86asmtemp.o for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [libpolyml.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
However, the build was successful with the default ./configure.
I don't know what is going on here. It looks as though Mac OS X is expecting some sort of relocation rather than an absolute address.
Once built there was a problem when calling polyc, as I was getting the error
ld: unknown option: -R/path/lib
Replacing
-Wl,-R${LIBDIR}
with
-Wl,-rpath ${LIBDIR}
seemed to work (things also worked when I deleted this option). I was then able to build HOL4.
This was added as part of a patch from Aleksej Saushev. The -R option is a synonym for -rpath on Linux/X86. It's not clear whether changing to -rpath would work on all platforms or not. I think the idea was that if Poly/ML was built with a shared library and it was installed to a directory that wasn't in the dynamic library search path having this option would cause polyc to add the installation path into the executable. It's rather nice to have it but if it breaks on some platforms it would be better to remove it.
The warning message
ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame
seems to be back, i.e. it doesn?t go away with -Wl,-no_pie. I?m not sure of the best way to silence this message. I?ve ended up adding -w to EXTRALDFLAGS.
Looking through the log I found that I'd added -Wl,-no_compact_unwind to fix this but then reverted that because it broke exception handling in OS X 10.9.
David