【问题标题】:Cross-Compile hsflowd for MIPS -get rid of shared Libraries为 MIPS 交叉编译 hsflowd - 摆脱共享库
【发布时间】:2022-07-18 14:41:02
【问题描述】:

我正在尝试为 MIPS 交叉编译 hsflowd,但无法摆脱共享库。

我正在为 Atehros MIPS(softfloat、big endian)使用 openwrt 工具链。程序在路由器上运行,但启动后我得到调试条目:

dbg1: dlopen(/etc/hsflowd/modules/mod_pcap.so) failed : Dynamic loading not supported
dbg1: dlopen(NULL) failed : Dynamic loading not supported
dbg1: dlopen(/etc/hsflowd/modules/mod_tcp.so) failed : Dynamic loading not supported
dbg1: dlopen(NULL) failed : Dynamic loading not supported

我正在使用 CFlags 进行编译:-static -s

mod_pcap.o 和 mod_tcp.o 也是之前构建并链接的。 那么问题来了,程序为什么要加载动态库呢?

是否有任何其他选项可以传递给编译器以将所有库构建到可执行文件中?

感谢您的任何建议

【问题讨论】:

    标签: gcc shared-libraries mips cross-compiling dynamic-loading


    【解决方案1】:

    程序正在尝试加载 DLL,因为它正在使用显式动态链接。我在为 ARM 构建自己的程序时遇到了同样的问题。

    dlopen(NULL) 的意思是“获取程序本身的句柄”,当人们想要 dlsym() 不在 DLL 中但在程序本身中的符号地址时,它很有用。

    很遗憾,尽管它是我自己的应用程序,但我没有找到任何解决方案 :(。静态链接(在我的情况下)需要重新考虑应用程序逻辑。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-07-14
      • 2019-01-18
      • 2017-06-07
      • 2017-10-23
      • 1970-01-01
      • 2018-05-31
      • 2017-08-29
      相关资源
      最近更新 更多