开发者

How can I ask ocamlopt to link against glibc 2.5?

Is t开发者_Python百科here a way to ask ocamlopt to link against glibc 2.5 such that I can run the resulting binary on machines that have only that that version of the library?

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

Thanks in advance.


You can use the following ocamlopt flags to specify flags for compiling 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 in the way you want, you can use these flags to do it. In fact, I'd suggest solving the problem in this order. Get it working with a (trivial) C program first, then work with ocamlopt next.

Yes, you'll need to have the library installed for the linker to do its thing. In essence, you'll want your system to look like the target system (the one where you want your code to run). For suggestions on how to install the library on your system, I'd suggest asking in a forum dedicated to that system.


From my experience, it is better to get chroot or vm with glibc-2.5 based system and compile distributable binary there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜