Linux GNU Build: Build Dynamic Library from a Set of Static Libraries

118 Views Asked by At

I have a make system I just completed, and my goal is to have one Monalithic .so file at the end. So far I have compiled all the seperate parts into .a files. I did this just to compact the number of .o files I would have to work with.

My idea so far is to just unpack the .a files at the end and then rebuild all of them into the large .so file. Is this sincable or is there another (better) way to do this?

1

There are 1 best solutions below

0
On BEST ANSWER

See the --whole-archive option in the man page for the ld command to combine static libs into a dynamic lib.