Problems with building OCaml-3.12.1
#1
Problems with building OCaml-3.12.1
Hello to all,

I am trying to compile and build the OCaml-3.12.1 compiler and tools - the last version which support MIPS and Irix.
It is quite easy to get a fresh build of compiler with static libraries option - just do
"./configure -no-shared-libs"
and after that
"gmake world"
or/and
"gmake world.opt" for faster native version.
However, when I want to get a version of byte and native compiler with shared libraries, the dynamic linker ld is very
upset and give me the strange message:
"ld32: FATAL 2 : Internal: at ../../ld/write.c writing beyond end-of-file"
(full log in attached file).

Has anyone any idea how to avoid above message and make ld to be happy?
Generally, how it is possible that ld tries to write beyond end the file end?

I'll be thanking everyone for making me answer.
Kwezan
SGI Hobbyist

Trade Count: (0)
Posts: 3
Threads: 1
Joined: Jul 2019
Location: Warszawa, Polska
Find Reply
09-05-2019, 01:15 PM
#2
RE: Problems with building OCaml-3.12.1
(09-05-2019, 01:15 PM)Kwezan Wrote:  Hello to all,

I am trying to compile and build the OCaml-3.12.1 compiler and tools - the last version which support MIPS and Irix.
It is quite easy to get a fresh build of compiler with static libraries option - just do
"./configure -no-shared-libs"
and after that
"gmake world"
or/and
"gmake world.opt" for faster native version.
However, when I want to get a version of byte and native compiler with shared libraries, the dynamic linker ld is very
upset and give me the strange message:
"ld32: FATAL 2 : Internal: at ../../ld/write.c writing beyond end-of-file"
(full log in attached file).

Has anyone any idea how to avoid above message and make ld to be happy?
Generally, how it is possible that ld tries to write beyond end the file end?

I'll be thanking everyone for making me answer.

EDIT: adding mentioned log file


Attached Files
.txt log.txt Size: 903 bytes  Downloads: 341
Kwezan
SGI Hobbyist

Trade Count: (0)
Posts: 3
Threads: 1
Joined: Jul 2019
Location: Warszawa, Polska
Find Reply
09-05-2019, 03:14 PM
#3
RE: Problems with building OCaml-3.12.1
(09-05-2019, 01:15 PM)Kwezan Wrote:  However, when I want to get a version of byte and native compiler with shared libraries, the dynamic linker ld is very upset and give me the strange message:
"ld32: FATAL 2 : Internal: at ../../ld/write.c writing beyond end-of-file"

Well, as the message says, the linker has encountered a fatal internal error. There's not much you can do about that since it probably indicates a bug in the linker itself.

Are you compiling with SGI's compiler or GCC? Have you tried the other? It's possible the compiler has generated bad output that's confusing the linker, or something like that. You might also want to try ld from GNU Binutils instead of the SGI linker. That could cause a bunch of other problems, but then you'd know for sure if it's the linker or the generated code that's to blame.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
09-06-2019, 07:02 PM
#4
RE: Problems with building OCaml-3.12.1
(09-05-2019, 01:15 PM)Kwezan Wrote:  Has anyone any idea how to avoid above message and make ld to be happy?
Generally, how it is possible that ld tries to write beyond end the file end?

It looks like you are building with the native MIPSPro compiler, although you need to tell us more about your compiler software setup.
What IRIX version and what MIPSPro version are you running? Do you have patches for MIPSPro and IRIX software components installed?

Other than that i see no real problems from building ocaml on my system. Tried it just now and It compiles and links the libcamlrun_shared.so without linker errors. There is some issue with hardcoded ranlib references, but these can be fixed later by a dummy shellscript or some patches in Makefiles
dexter1
Administrator

Trade Count: (1)
Posts: 297
Threads: 17
Joined: May 2018
Location: The Netherlands
Find Reply
09-07-2019, 01:11 PM
#5
RE: Problems with building OCaml-3.12.1
dexter1 Wrote:It looks like you are building with the native MIPSPro compiler, although you need to tell us more about your compiler software setup.
What IRIX version and what MIPSPro version are you running? Do you have patches for MIPSPro and IRIX software components installed?

No, I am building with gcc for bytecode and with MIPSPro compiler for native code according to Install doc.
I am using:
- gcc v. 4.7.4
- MIPSPro v. 7.4.4m - all patches installed
- Irix 6.5.30m on Octane 400Mhz dual head

Attaching my Makefile file created by configure script.

jpstewart Wrote:Are you compiling with SGI's compiler or GCC? Have you tried the other?

What do you mean by other?
There's not much choice. As I know, gcc 3.6.4 and 4.7.4 are stable version only.
I am assuming, maybe wrongly that gcc v.4.7.4 is better.


Attached Files
.txt Makefile.config.txt Size: 1.67 KB  Downloads: 241
Kwezan
SGI Hobbyist

Trade Count: (0)
Posts: 3
Threads: 1
Joined: Jul 2019
Location: Warszawa, Polska
Find Reply
09-09-2019, 09:11 AM
#6
RE: Problems with building OCaml-3.12.1
(09-09-2019, 09:11 AM)Kwezan Wrote:  
jpstewart Wrote:Are you compiling with SGI's compiler or GCC? Have you tried the other?

What do you mean by other?

I mean: if you've been using the MIPSpro compiler, have you tried GCC; or if you've been using GCC have you tried MIPSpro?

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
09-09-2019, 07:49 PM
#7
RE: Problems with building OCaml-3.12.1
I'm reviving this thread to say I have an interest in getting OCaml 4.x working on IRIX. Can't promise anything, but stay put!

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
06-14-2021, 04:09 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)