Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I build programs with statically linked shared libraries?

0
Posted

How do I build programs with statically linked shared libraries?

0

Use the shlicc program (or shlicc++ for C++ programs). The answer to this question hasn’t changed since BSD/OS 3.x, but since we now support two kinds of shared libraries, dynamically linked and statically linked, it’s useful to point out that the old shared library tools are still available. The shlicc program creates ELF files instead of a.out files in BSD/OS 4.x, but it uses the same techniques for linking and loading shared libraries as before. (With one interesting exception: the statically linked shared C library is the ELF `interpreter’ for programs that shlicc links. Since the system must load the ELF interpreter, this saves a few mmap() calls in the application.) Note that the system’s make headers still arrange to link programs with shlicc by default. Most of the programs in the BSD/OS 4.x distribution use statically linked shared libraries. See below for a discussion.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123