【问题标题】:ptxdist autoconf project uses sysroot-host/lib instead of sysroot-target/lib (File format not recognized)ptxdist autoconf 项目使用 sysroot-host/lib 而不是 sysroot-target/lib(文件格式无法识别)
【发布时间】:2016-04-15 16:47:56
【问题描述】:

我的ptxdist 项目中有一个依赖于libxml2 的包。

根据此错误消息,它尝试链接 sysroot-host 中的 libxml2.so,我认为应该是 sysroot-target

/home/wago/WAGO-PFC/ptxproj-2.4.22/platform-wago-pfcXXX/sysroot-host/lib/libxml2.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status

我可以的

ptxdist compile libxml2

它做得很好。该文件存在并且是正确的架构:

platform-wago-pfcXXX/sysroot-target/usr/lib/libxml2.so: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped   

所有其他依赖项似乎都是从正确的位置提取的。我能做些什么?我可以在 .rules 文件中设置一个选项吗? 这是它的 autoconf 特定部分:

OPENCONNECT_CONF_TOOL   := autoconf
OPENCONNECT_CONF_OPT    := $(CROSS_AUTOCONF_USR)

$(STATEDIR)/openconnect.prepare:
        @$(call targetinfo)
        @$(call clean, $(OPENCONNECT_DIR)/config.cache)
        cd $(OPENCONNECT_DIR) && \
                $(OPENCONNECT_PATH) $(OPENCONNECT_ENV) \
                ./configure $(OPENCONNECT_CONF_OPT) --with-vpnc-script=/etc/vpnc/vpnc-script
        @$(call touch)

【问题讨论】:

    标签: cross-compiling autoconf


    【解决方案1】:

    您可以在规则文件中配置环境变量。它们用于 autoconf 运行。使用 LDFLAGS 您可以指定外部库的搜索路径:

    OPENCONNECT_CONF_ENV    := $(CROSS_ENV)\
                               LDFLAGS='-L$(SYSROOT)/lib'
    
    OPENCONNECT_CONF_TOOL   := autoconf
    OPENCONNECT_CONF_OPT    := $(CROSS_AUTOCONF_USR
    

    但我不确定您的项目的 Makefile 是否有任何依赖项。 我可以想象,如果在您的“OPENCONNECT”项目的 Makefile 中没有考虑额外的 LDFLAGS 参数,它不会产生任何影响。

    【讨论】:

      猜你喜欢
      • 2014-09-26
      • 2017-02-17
      • 2015-07-05
      • 1970-01-01
      • 1970-01-01
      • 2021-12-03
      • 2015-08-25
      • 2016-10-05
      • 1970-01-01
      相关资源
      最近更新 更多