S
S
sitev_ru2018-03-13 11:08:17
linux
sitev_ru, 2018-03-13 11:08:17

How to compile into one big startup file?

I am compiling a executable file under Linux, it depends on a large number of so-libraries. Is it possible to compile them all into one big executable file?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Makarov, 2018-03-13
@Nipheris

it depends on a large number of so-libraries.

You have two options:
1. Use static versions of libraries instead of dynamic ones (so) - this is what Vitaly suggests .
2. Continue building as it is now, but learn how to build normal packages for the distributions you need, with a normal description of dependencies - then the system package manager will install all the dependencies you need when installing your package.
The second option is more difficult, but preferable, because. in case of critical vulnerabilities in libraries, they can be updated independently without updating your application. When you link statically, obviously the vulnerable code in your binary can only be updated by rebuilding that binary with a new version of the library, i.e. without your participation (if the code is closed), the vulnerability cannot be eliminated. Whether this is critical for you or not is up to you, depends on the importance of your application.

V
Vitaly, 2018-03-13
@vt4a2h

Yes. Read about static linking.
In addition, you can simply supply all the necessary dependencies with the executable file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question