Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libasmrun_shared.so fails to build #7030

Closed
vicuna opened this issue Oct 27, 2015 · 4 comments
Closed

libasmrun_shared.so fails to build #7030

vicuna opened this issue Oct 27, 2015 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Oct 27, 2015

Original bug ID: 7030
Reporter: Patrick Star
Status: closed (set by @xavierleroy on 2017-02-16T14:14:42Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: sun4u
OS: Solaris
OS Version: 10
Version: 4.02.3
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: configure and build/install
Monitored by: @gasche

Bug description

libasmrun_shared.so fails to build on Solaris/SPARC with the standard Makefile:
[squidward]user:~/src/ocaml-4.02.3/asmrun$ make
gcc -shared -o libasmrun_shared.so startup.pic.o main.pic.o fail.pic.o roots.pic.o globroots.pic.o signals.pic.o signals_asm.pic.o misc.pic.o freelist.pic.o major_gc.pic.o minor_gc.pic.o memory.pic.o alloc.pic.o compare.pic.o ints.pic.o floats.pic.o str.pic.o array.pic.o io.pic.o extern.pic.o intern.pic.o hash.pic.o sys.pic.o parsing.pic.o gc_ctrl.pic.o terminfo.pic.o md5.pic.o obj.pic.o lexing.pic.o printexc.pic.o callback.pic.o weak.pic.o compact.pic.o finalise.pic.o custom.pic.o unix.pic.o backtrace.pic.o natdynlink.pic.o debugger.pic.o meta.pic.o dynlink.pic.o sparc.pic.o -fPIC -lnsl -lsocket -lm
Text relocation remains referenced
against symbol offset in file
L109 0x4 sparc.pic.o
caml_call_gc 0x8 sparc.pic.o
ld: fatal: relocations remain against allocatable but non-writable sections
make: *** [libasmrun_shared.so] Error 1

Steps to reproduce

Attempt to build ocaml on Solaris/SPARC, specifically
[squidward]user:~/src/ocaml-4.02.3/asmrun$ uname -a
SunOS squidward 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-2500 Solaris

Additional information

Solution: Use ld -G, which is the proper way of producing shared objects on Solaris:
[squidward]user:/src/ocaml-4.02.3/asmrun$ ld -G -o libasmrun_shared.so startup.pic.o main.pic.o fail.pic.o roots.pic.o globroots.pic.o signals.pic.o signals_asm.pic.o misc.pic.o freelist.pic.o major_gc.pic.o minor_gc.pic.o memory.pic.o alloc.pic.o compare.pic.o ints.pic.o floats.pic.o str.pic.o array.pic.o io.pic.o extern.pic.o intern.pic.o hash.pic.o sys.pic.o parsing.pic.o gc_ctrl.pic.o terminfo.pic.o md5.pic.o obj.pic.o lexing.pic.o printexc.pic.o callback.pic.o weak.pic.o compact.pic.o finalise.pic.o custom.pic.o unix.pic.o backtrace.pic.o natdynlink.pic.o debugger.pic.o meta.pic.o dynlink.pic.o sparc.pic.o -fPIC -lnsl -lsocket -lm
[squidward]user:
/src/ocaml-4.02.3/asmrun$ file libasmrun_shared.so
libasmrun_shared.so: ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped, no debugging information available

File attachments

@vicuna
Copy link
Author

vicuna commented Oct 27, 2015

Comment author: @xavierleroy

Thanks for your feedback. The SPARC port of OCaml hasn't been maintained for several years, because we don't have access to a SPARC/Solaris machine, so it is no surprise that something is not right.

If you could prepare, test and submit a patch to the "configure" script that implements the workaround you describe, we'll very gladly accept it.

@vicuna
Copy link
Author

vicuna commented Oct 27, 2015

Comment author: Patrick Star

Patch (diff -u) uploaded. Just had to build a fresh source tree to make sure I hadn't changed anything else. Not much builds out of the box on Solaris/SPARC nowadays :P.

@vicuna
Copy link
Author

vicuna commented Oct 27, 2015

Comment author: @xavierleroy

Thanks a lot for the patch, it's applied in commit [trunk 4bd9adb] and will be in the next OCaml release.

Pretty soon we'll have to decide whether to deprecate the SPARC/Solaris port or invest time (and probably some money too) securing access to a test machine.

@vicuna
Copy link
Author

vicuna commented Oct 27, 2015

Comment author: @johnwhitington

The people at polarhome.com can give you shell access for a lifetime payment of ten euros. I've built OCaml on their machines before.

@vicuna vicuna closed this as completed Feb 16, 2017
@vicuna vicuna added this to the 4.03.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant