无法识别的arm交叉编译——sysroot选项。

时间:2021-10-02 17:14:41

I'm trying arm cross compilation using sysroot for the autotools project.The options I'm using for autogen script is as follows.

我正在尝试使用sysroot对autotools项目进行arm交叉编译。下面是我在autogen脚本中使用的选项。

CC=arm-linux-gnueabihf-gcc --with-sysroot=/opt/sysroot/dir \
   --host=arm-linux-gnueabihf --sysroot=/opt/sysroot/dir --prefix=/some/dir

But in eclipse plugin it is showing that --sysroot option is unrecognized but the same command is working fine in the terminal.

但是在eclipse插件中,它显示-sysroot选项是不可识别的,但是相同的命令在终端上运行良好。

ERROR:
configure: error: unrecognized option: --sysroot=/opt/sysroot/dir
configure: error: unrecognized option: --sysroot=/opt/sysroot/dir
Try ./configure --help' for more information

And If I remove --sysroot option in eclipse then the autogen works fine but I'm getting the following linker error.

如果我在eclipse中删除sysroot选项,那么autogen就可以正常工作,但是我得到了以下链接器错误。

/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter-0.so when searching for -lwebkit_clutter-0
make[2]: Leaving directory `/home/dir/workspace/Sharukh/sources/applications'
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter-0
make[1]: Leaving directory `/home/dir/workspace/Sharukh/sources'
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/lib/../lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //usr/lib/libwebkit_clutter_mx.so when searching for -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lwebkit_clutter_mx
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /lib/../lib/libcgroup.so when searching for -lcgroup
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible //lib/libcgroup.so when searching for -lcgroup
/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lcgroup
collect2: error: ld returned 1 exit status
make[2]: *** [bin_Sharukh] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

What am I missing?

我缺少什么?

1 个解决方案

#1


3  

You really don't need to use --with-sysroot as --sysroot is enough.

你真的不需要使用——sysroot就足够了。

Your configuration should be like this

您的配置应该是这样的

CC="arm-linux-gnueabihf-gcc" \
CFLAGS="--sysroot=/opt/sysroot/dir" ./configure \
            --prefix=/some/dir \
            --host=arm-linux-gnueabihf

#1


3  

You really don't need to use --with-sysroot as --sysroot is enough.

你真的不需要使用——sysroot就足够了。

Your configuration should be like this

您的配置应该是这样的

CC="arm-linux-gnueabihf-gcc" \
CFLAGS="--sysroot=/opt/sysroot/dir" ./configure \
            --prefix=/some/dir \
            --host=arm-linux-gnueabihf