首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用waf交叉编译ARM9的buildroot包

用waf交叉编译ARM9的buildroot包
EN

Stack Overflow用户
提问于 2013-09-10 10:04:42
回答 2查看 4.5K关注 0票数 1

我使用的代码来源g++精巧工具链2013年。

有一个项目,我把它集成到buildroot中(看起来很好,一切都按预期进行了调用)。

waf是可供选择的构建系统

代码语言:javascript
复制
define EEBUSRESTIFIED_CONFIGURE_CMDS
(cd "$(@D)"; \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(CFLAGS_FOR_BUILD)" \
LDFLAGS="--sysroot=$(STAGING_DIR)" \
LD_LIBRARY_PATH="$(STAGING_DIR)" \
PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
./waf --dest=$(TARGET_DIR) configure)
endef

显示

代码语言:javascript
复制
Setting top to                           : /home/bernhard/buildroot-2013.08/output/build/foo-6508f5b36172ba8965372ef96fb350b413ec5d15 
Setting out to                           : /home/bernhard/buildroot-2013.08/output/build/foo-6508f5b36172ba8965372ef96fb350b413ec5d15/build 
Checking for program gcc,cc              : /home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-gcc 
Checking for program ar                  : /home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-ar 
Checking for program glib-genmarshal     : /home/bernhard/buildroot-2013.08/output/host/usr/bin/glib-genmarshal 
Checking for program perl                : /usr/bin/perl 
Checking for 'glib-mkenums'              : /home/bernhard/buildroot-2013.08/output/host/usr/bin/glib-mkenums 
Checking for program glib-compile-schemas : /home/bernhard/buildroot-2013.08/output/host/usr/bin/glib-compile-schemas 
Checking for program pkg-config           : /home/bernhard/buildroot-2013.08/output/host/usr/bin/pkg-config 
Checking for pkg-config version >= '0.26' : yes 
Checking for 'glib-2.0'                   : yes 
Checking for 'glib-2.0' version           : yes 
Checking for 'gobject-2.0'                : yes 
Checking for 'libsoup-2.4'                : yes 
Checking for 'libsoup-2.4' version        : yes 
Checking for 'libxml-2.0'                 : yes 
Checking for 'uuid'                       : yes 
Checking for endianness                   : little 
Checking for inline                       : inline

看起来挺好的。

在编译步骤中

代码语言:javascript
复制
define EEBUSRESTIFIED_BUILD_CMDS
(cd "$(@D)"; \
$(TARGET_CONFIGURE_OPTS) \
LDFLAGS="--sysroot=$(STAGING_DIR)" \
LD_LIBRARY_PATH="$(STAGING_DIR)" \
PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
./waf --dest=$(TARGET_DIR) build)
endef

它会随着

代码语言:javascript
复制
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
/usr/lib/libgobject-2.0.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status

我理解这个问题-- waf/ld试图链接到我的主机库,这注定会失败。

如何修复ld以获取正确的库路径?这个问题的根源是什么?

在这里,build命令的扩展输出(将空格替换为换行符):

代码语言:javascript
复制
echo
"PATH="/home/bernhard/buildroot-2013.08/output/host/bin:/home/bernhard/buildroot-2013.08/output/host/usr/bin:/home/bernhard/buildroot-2013.08/output/host/usr/sbin/:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/core_perl"
AR="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-ar"
AS="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-as"
LD="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-ld"
NM="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-nm"
CC="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-gcc"
GCC="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-gcc"
CPP="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-cpp"
CXX="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-g++"
FC="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-gfortran"
RANLIB="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-ranlib"
READELF="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-readelf"
STRIP="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-strip"
OBJCOPY="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-objcopy"
OBJDUMP="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-objdump"
AR_FOR_BUILD="/usr/bin/ar"
AS_FOR_BUILD="/usr/bin/as"
CC_FOR_BUILD="/usr/bin/gcc"
GCC_FOR_BUILD="/usr/bin/gcc"
CXX_FOR_BUILD="/usr/bin/g++"
FC_FOR_BUILD="/usr/bin/ld"
LD_FOR_BUILD="/usr/bin/ld"
CPPFLAGS_FOR_BUILD="-I/home/bernhard/buildroot-2013.08/output/host/usr/include"
CFLAGS_FOR_BUILD="-O2
-I/home/bernhard/buildroot-2013.08/output/host/usr/include"
CXXFLAGS_FOR_BUILD="-O2
-I/home/bernhard/buildroot-2013.08/output/host/usr/include"
LDFLAGS_FOR_BUILD="-L/home/bernhard/buildroot-2013.08/output/host/lib
-L/home/bernhard/buildroot-2013.08/output/host/usr/lib
-Wl,-rpath,/home/bernhard/buildroot-2013.08/output/host/usr/lib"
FCFLAGS_FOR_BUILD=""
DEFAULT_ASSEMBLER="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-as"
DEFAULT_LINKER="/home/bernhard/buildroot-2013.08/output/host/usr/bin/arm-none-linux-gnueabi-ld"
CPPFLAGS="-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64"
CFLAGS="-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64

-pipe
-O2
"
CXXFLAGS="-D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64

-pipe
-O2
"
LDFLAGS=""
FCFLAGS=""
PKG_CONFIG="/home/bernhard/buildroot-2013.08/output/host/usr/bin/pkg-config"
PERLLIB="/home/bernhard/buildroot-2013.08/output/host/usr/lib/perl"
STAGING_DIR="/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot""

I tried a couple of combinations for `PKG_CONFIG_*` , with/without `--sysroot` but no success so far.

已读过linux cross compiling and dynamic libraries / linking

作为参考,整个foo.mk

代码语言:javascript
复制
FOO_VERSION = abcd1234
FOO_SITE = ssh://git@some.where/FOO
FOO_SITE_METHOD = git
FOO_LICENSE = unknown
FOO_INSTALL_TARGET = YES
FOO_DEPENDENCIES = util-linux libglib2 libsoup libxml2 host-pkgconf

define FOO_CONFIGURE_CMDS
    echo "$(TARGET_CONFIGURE_OPTS)"
    (cd "$(@D)"; \
    $(TARGET_CONFIGURE_OPTS) \
    LDFLAGS="--sysroot=$(STAGING_DIR)" \
    LD_LIBRARY_PATH="$(STAGING_DIR)" \
    PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
    PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
    ./waf --dest=$(TARGET_DIR) configure)
endef

define FOO_BUILD_CMDS
    (cd "$(@D)"; \
    LDFLAGS="--sysroot=$(STAGING_DIR)" \
    LD_LIBRARY_PATH="$(STAGING_DIR)" \
    PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
    PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
    ./waf --dest=$(TARGET_DIR) debug)
endef

define FOO_INSTALL_TARGET_CMDS
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) install)
endef

define FOO_CLEAN_CMDS
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) distclean)
endef

$(eval $(generic-package))
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-09-10 11:45:03

经过一个make clean,一个make all,我终于得到了一个解决方案-诀窍是通过LDFLAGS将有关sysroot的标志传递给链接器。

file告诉我./build/foo.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped,这看起来很不错。

低于所使用的foo.mk

代码语言:javascript
复制
FOO_VERSION = 6508f5b36172ba8965372ef96fb350b413ec5d15
FOO_SITE = ssh://git@some.where/FOO
FOO_SITE_METHOD = git
FOO_LICENSE = unknown
FOO_INSTALL_TARGET = YES
FOO_DEPENDENCIES = util-linux libglib2 libsoup libxml2 host-pkgconf

define FOO_CONFIGURE_CMDS
    (cd "$(@D)"; \
    $(TARGET_CONFIGURE_OPTS) \
    LDFLAGS="-Wl,--sysroot=$(STAGING_DIR) -Wl,--verbose=9 -Wl,--error-poison-system-directories -L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
    ./waf --dest=$(TARGET_DIR) configure)
endef

define FOO_BUILD_CMDS
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) debug)
endef

define FOO_INSTALL_TARGET_CMDS
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) install)
endef

define FOO_CLEAN_CMDS
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) distclean)
endef

$(eval $(generic-package))

供参考-链接器输出

代码语言:javascript
复制
GNU ld (Sourcery CodeBench Lite 2011.09-70) 2.21.53.20110905
  Supported emulations:
   armelf_linux_eabi
   armelfb_linux_eabi
using internal linker script:
==================================================
<< stripped manually >>    
==================================================
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crt1.o succeeded
/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crt1.o
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crti.o succeeded
/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crti.o
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/crtbegin.o succeeded
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/crtbegin.o
attempt to open src/asyncrequestobj.c.1.o succeeded
src/asyncrequestobj.c.1.o
attempt to open src/cache.c.1.o succeeded
src/cache.c.1.o
attempt to open src/error.c.1.o succeeded
src/error.c.1.o
attempt to open src/main.c.1.o succeeded
src/main.c.1.o
attempt to open src/request-info.c.1.o succeeded
src/request-info.c.1.o
attempt to open src/response-info.c.1.o succeeded
src/response-info.c.1.o
attempt to open src/xml_helper.c.1.o succeeded
src/xml_helper.c.1.o
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgobject-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgobject-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so succeeded
-lgobject-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so succeeded
-lglib-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so succeeded
-lglib-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libsoup-2.4.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libsoup-2.4.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so succeeded
-lsoup-2.4 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgio-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgio-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgio-2.0.so succeeded
-lgio-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgio-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgobject-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgobject-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so succeeded
-lgobject-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libglib-2.0.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so succeeded
-lglib-2.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libglib-2.0.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libxml2.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libxml2.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libxml2.so succeeded
-lxml2 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libxml2.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libuuid.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libuuid.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libuuid.so succeeded
-luuid (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libuuid.so)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.a succeeded
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so succeeded
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so
attempt to open libgcc_s.so.1 failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so.1 succeeded
libgcc_s.so.1 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so.1)
attempt to open libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.a succeeded
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libpthread.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libpthread.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libpthread.so succeeded
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libpthread.so
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libpthread.so
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libpthread.so.0 succeeded
/lib/libpthread.so.0 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libpthread.so.0)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libpthread_nonshared.a succeeded
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc.so succeeded
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc.so
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc.so
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libc.so.6 succeeded
/lib/libc.so.6 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libc.so.6)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc_nonshared.a succeeded
(/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libc_nonshared.a)elf-init.oS
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3 succeeded
/lib/ld-linux.so.3 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3)
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.so failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.so failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.a succeeded
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so succeeded
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so
opened script file /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so
attempt to open libgcc_s.so.1 failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so.1 succeeded
libgcc_s.so.1 (/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc_s.so.1)
attempt to open libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgcc.a failed
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/libgcc.a succeeded
attempt to open /home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/crtend.o succeeded
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/crtend.o
attempt to open /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crtn.o succeeded
/home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/crtn.o
libpcre.so.1 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so
found libpcre.so.1 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libpcre.so.1
librt.so.1 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so
found librt.so.1 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/librt.so.1
libffi.so.6 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgobject-2.0.so
found libffi.so.6 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libffi.so.6
libgmodule-2.0.so.0 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libgmodule-2.0.so.0 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libgmodule-2.0.so.0
libresolv.so.2 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libresolv.so.2 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libresolv.so.2
libz.so.1 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libz.so.1 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libz.so.1
libm.so.6 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libm.so.6 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libm.so.6
libsqlite3.so.0 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libsqlite3.so.0 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsqlite3.so.0
libdl.so.2 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libsoup-2.4.so
found libdl.so.2 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/libdl.so.2
ld-linux.so.3 needed by /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libuuid.so
found ld-linux.so.3 at /home/bernhard/buildroot-2013.08/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
/home/bernhard/buildroot-2013.08/output/host/opt/ext-toolchain/bin/../lib/gcc/arm-none-linux-gnueabi/4.6.1/../../../../arm-none-linux-gnueabi/bin/ld: warning: library search path "/usr/lib" is unsafe for cross-compilation

在最后,您仍然可以看到错误的路径存在,但是通过传递似乎具有更高优先级的-L标志,它仍然可以正常工作。

我找到了根本原因-当我做一个

代码语言:javascript
复制
bld.program(features = ['c', ..],
        libpath = ["/usr/lib"],
        stlibpath = ["/usr/lib"],
        includes = ["src", "/usr/include"],
        target = "foo.bin",
        source = ["main.c","foo.c"])

libpathstlibpathincludes (至少更多)没有以destdir作为前缀--而且选项应该是--destdir而不是--dest

票数 1
EN

Stack Overflow用户

发布于 2013-09-10 10:55:22

没有关于waf的专家,但是“狡猾”的*_FOR_BUILD vars应该是由于在FOO_BUILD_CMDS中缺少echo "$(TARGET_CONFIGURE_OPTS)"。但是,如果这是一个基于自动工具的配置和安装,那么在构建步骤中我不会重写太多,所以请尝试使用

代码语言:javascript
复制
define FOO_BUILD_CMDS
    echo "$(TARGET_CONFIGURE_OPTS)"
    (cd "$(@D)"; \
    ./waf --dest=$(TARGET_DIR) debug)
endef

另外,将PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"替换为PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/lib/pkgconfig:‌​$(STAGING_DIR)/usr/local/lib/pkgconfig"

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18715976

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档