ptxdist autoconf项目使用sysroot-host / lib而不是sysroot-target / lib(文件格式无法识别)

时间:2016-04-15 16:47:57

标签: cross-compiling autoconf

我的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)

1 个答案:

答案 0 :(得分:0)

您可以在规则文件中配置环境变量。它们用于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参数将没有效果。项目