mips-openwrt-linux-gcc:无法识别的选项'-rpath-link'

时间:2011-12-20 14:07:01

标签: c gcc

尝试使用toolchain-mips_gcc-4.3.3 + cs_uClibc-0.9.30.1构建我的应用程序时。我在链接阶段遇到错误:

/home/hp/Desktop/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/bin/ld: warning: **ld-uClibc.so.0**, **needed by** /home/hp/Desktop/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/lib/libc.so, not found (**try using -rpath or -rpath-link**)
/home/hp/Desktop/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/lib/**libc.so**: undefined reference to `_dl_app_init_array'
/home/hp/Desktop/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/lib/libc.so: undefined reference to `_dl_loaded_modules'
/home/hp/Desktop/staging_dir/toolchain-mips_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/lib/libc.so: undefined reference to `_dl_app_fini_array'
collect2: ld returned 1 exit status
当trtying添加-rpath-link选项

LDFLAGS += -rpath-link /home/hp/Desktop/staging_dir/target-mips_uClibc-0.9.30.1/root-brcmref/lib/ld-uClibc.so.0

我收到以下错误: mips-openwrt-linux-gcc:无法识别的选项'-rpath-link'

我该如何解决这个问题 此致

3 个答案:

答案 0 :(得分:2)

添加TARGET_LDFLAGS+=-rpath-link $(shell find $(STAGING_DIR) -name ld-uClibc.so.0)package/PAK_NAME/Makefile

答案 1 :(得分:2)

使用

LDFLAGS += --rpath-link /home/hp/Desktop/staging_dir/target-mips_uClibc-0.9.30.1/root-brcmref/lib/ld-uClibc.so.0

而不是

LDFLAGS += -rpath-link /home/hp/Desktop/staging_dir/target-mips_uClibc-0.9.30.1/root-brcmref/lib/ld-uClibc.so.0

答案 2 :(得分:0)

查看https://forum.openwrt.org/viewtopic.php?id=25748处的解决方案,看起来那个人遇到了同样的问题。你有没有机会移动工具链?