[英]Installing package from source on an initial ram filesystem
I'm trying to install multiple packages into an initial ram file system. 我正在尝试将多个软件包安装到初始ram文件系统中。 I'm using uclibc as my C library. 我使用uclibc作为我的C库。 This could be a stupid question but... 这可能是一个愚蠢的问题,但是...
Would the compiled program also need a C library installed onto the initramfs
? 编译后的程序是否还需要在initramfs
上安装C库?
Am I right in thinking that when a program is compiled from source, it is compiled into some sort of executable? 我是否认为从源代码编译程序时会将其编译为某种可执行文件? Will the application on the initramfs
be ready to run once I have make install
ed (with the correct prefix and providing dependencies are met )? 一旦make install
ed(具有正确的前缀并提供了相关性), initramfs
上的应用程序是否可以运行?
Whether a compiled program needs a C library - or any kind of library, for that matter - depends on how it was linked . 编译程序是否需要C库-还是任何类型的库-取决于其链接方式 。
In general, if your program was linked statically then it does not have any external dependencies - it only needs a working kernel. 通常,如果您的程序是静态链接的,则它没有任何外部依赖关系-它只需要一个运行中的内核即可。 The executable code of any library that it depends on will have been incorporated into the final executable. 它所依赖的任何库的可执行代码都将并入最终的可执行文件中。
If, on the other hand, it is linked dynamically , then it still needs the shared object files of the libraries it depends on. 另一方面,如果它是动态链接的,那么它仍然需要其依赖的库的共享对象文件。 On Linux, most library shared objects (also known as shared libraries ) follow the convention of having a filename with either a .so
extension or, in general, a *.so.*
format. 在Linux上,大多数库共享对象(也称为共享库 )遵循以下约定:文件名带有.so
扩展名,或者通常是*.so.*
格式。 For example /lib/libssl3.so
and /lib/libncurses.so.5.9
are both shared libraries on my system. 例如,/ /lib/libssl3.so
和/lib/libncurses.so.5.9
都是我系统上的共享库。
It is also possible to have an executable that is statically linked against some libraries and dynamically linked against others. 也可能有一个与某些库静态链接而与其他库动态链接的可执行文件。 A common case where this happens is when rare or proprietary libraries are linked in statically, while standard system libraries are linked in dynamically. 发生这种情况的常见情况是,稀有或专有库是静态链接的,而标准系统库是动态链接的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.