How can I ask ocamlopt to link with glibc 2.5?

Is there any way to ask ocamlopt to link with glibc 2.5 so that I can run the resulting binary on machines that have only that version of the library?

If it were possible, are there any additional packages that I would have to install on my machine? My car does not have glibc 2.5. Is there a package for this?

Thanks in advance.

+4
source share
2 answers

You can use the following ocamlopt flags to specify flags for compilation and linking:

-cc <comp> Use <comp> as the C compiler and linker -cclib <opt> Pass option <opt> to the C linker -ccopt <opt> Pass option <opt> to the C compiler and linker 

As long as you know how to ask your C compiler to link the way you want, you can use these flags for this. In fact, I would suggest solving the problem in this order. First run it with the (trivial) C program, then do the following with ocamlopt.

Yes, you will need to install the library for the linker to execute it. In essence, you want your system to look like the target system (the one where you want your code to work). For suggestions on how to install the library on your system, I suggest asking a question on the forum dedicated to this system.

+4
source

In my experience, it is better to get chroot or vm with a glibc-2.5 based system and compile distribution binaries.

+3
source

All Articles