Buildroot安装的库未出现在目标中。

huangapple go评论47阅读模式
英文:

Buildroot installed libraries not appearing in target

问题

我正在为我的实际项目构建基于buildroot的Linux。我需要添加protobuf-c库,发现在buildroot的“Finalizing target”步骤之后,库文件(.a和.la)会从目标目录中消失,因为它执行了一个命令来擦除目标/usr/lib和目标/lib中的所有.a和.la文件,所以它们在目标上为空。显然,在加载到目标后,文件仍然丢失。

有人可以帮助我找到这些文件或者如何修复这个问题吗?

我已经尝试从buildroot的menuconfig中安装其他库,但同样的情况发生,文件被安装在/usr/lib目录中,但在“Finalizing target”步骤结束后它们消失了。

提前感谢。

英文:

I'm working on a buildroot-based linux for my actual project. I need to add the protobuf-c library and found that the library files, .a and .la, dissapear from the target directory after the "Finalizing target" step in buildroot, since it executes a command to arase all .a and .la files from target/usr/lib and target/lib, so they are empty on the target. Obviously after loading on the target files are still missing.

Can anyone help me on how I can find those files or how can I fix this?

I've tried installing other libraries from the buildroot menuconfig and the same happens, files are installd in /usr/lib directory, but at the end after the "Finalizing target" step they dissapear.

Thanks in advance

答案1

得分: 1

Buildroot通常会剥离并安装以.so结尾的共享库。

以.a结尾的静态库可以通过在您的包制作文件中实现一个后安装挂钩来安装。对于名为"pack"的示例包,此挂钩看起来如下:

define PACK_INSTALL_MOD
	$(INSTALL) -D -m 755 $(@D)/.libs/libpack.a $(TARGET_DIR)/usr/lib/
endef
PACK_POST_INSTALL_TARGET_HOOKS += PACK_INSTALL_MOD

请注意,其中的变量和命令未被翻译。

英文:

Buildroot will typically strip and install the shared libraries which end in .so

The static library ending in .a can be installed by implementing a post install hook in your package makefile. This hook looks like the following for an example package called "pack". In this case the following would be put into the pack.mk makefile :

define PACK_INSTALL_MOD
	$(INSTALL) -D -m 755 $(@D)/.libs/libpack.a $(TARGET_DIR)/usr/lib/
endef
PACK_POST_INSTALL_TARGET_HOOKS += PACK_INSTALL_MOD

huangapple
  • 本文由 发表于 2023年2月8日 18:25:57
  • 转载请务必保留本文链接:https://go.coder-hub.com/75384394.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定