您尚未登录。

楼主 #1 2017-12-27 14:25:25

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

./configure --prefix=$(pwd)/sss --host=arm
make CC=arm-linux-gnueabihf-gcc
make install

成功后
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss# ls
etc  include  lib  sbin  share
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss# cd lib
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib# ls
libnl       libnl-cli-3.a   libnl-genl-3.la   libnl-nf-3.a     libnl-route-3.la
libnl-3.a   libnl-cli-3.la  libnl-idiag-3.a   libnl-nf-3.la    pkgconfig
libnl-3.la  libnl-genl-3.a  libnl-idiag-3.la  libnl-route-3.a
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib# cd libnl
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib/libnl# ls
cli
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/sss/lib/libnl#

离线

楼主 #3 2017-12-27 15:30:22

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

参考这个: basicnet/libnl.html

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make


晕哥,上面的方法有错误

/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
.libs/hash.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [libnl-3.la] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make: *** [all-recursive] Error 1

离线

楼主 #7 2017-12-27 18:39:12

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

daydayup 说:
zhuacai 说:
晕哥 说:

参考这个: basicnet/libnl.html


晕哥,上面的方法有错误

/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/hash.o: Relocations in generic ELF (EM: 40)
.libs/hash.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make[2]: *** [libnl-3.la] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/lib'
make: *** [all-recursive] Error 1

工具链还是得用 ARM的哦, (捂脸

用以下命令编译成功后没有libnl-3.so.200
./configure --prefix=$(pwd)/sss     \
        --host=arm  \
            --sysconfdir=/etc \
            --disable-static  &&
make CC=arm-linux-gnueabihf-gcc

离线

楼主 #8 2017-12-27 18:41:29

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

对, 否则就是不识别的指令集了.


晕哥,我是想学习怎样交叉编译,所以想自己编译libnl-3.2.25

离线

楼主 #11 2017-12-27 22:04:26

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

libnl-3.so.200 是一个软链接吧,实际应该指向 libnl-3.so
你看下 libnl-3.so 是否存在。

没有一个.so的文件,我觉下配置关,下面的说明我看不明白
                                  NOTE

There have been some changes starting with 3.2 regarding where and how libnl
is being installed on the system in order to allow multiple libnl versions
to be installed in parallel:

    - Headers will be installed in ${prefix}/include/libnl3, therefore
      you will need to add "-I/usr/include/libnl3" to CFLAGS

    - The library basename was renamed to libnl-3, i.e. the SO names become
      libnl-3.so., libnl-route-3.so, etc.

    - libtool versioning was assumed, to ease detection of compatible library
      versions.

If you are using pkg-config for detecting and linking against the library
things will continue magically as if nothing every happened. If you are
linking manually you need to adapt your Makefiles or switch to using
pkg-config files.

离线

楼主 #14 2017-12-27 22:26:12

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

https://whycan.cn/files/members/3/QQ20171227220343.png
我试了一下,明明有生成文件!


我的怎么没有,你能写下你的步骤吗
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/lib/.libs# ls
addr.o        error.o          libnl-genl-3.lai   libnl-nf-3.lai     object.o
attr.o        handlers.o       libnl-idiag-3.a    libnl-route-3.a    socket.o
cache_mngr.o  hash.o           libnl-idiag-3.la   libnl-route-3.la   utils.o
cache_mngt.o  hashtable.o      libnl-idiag-3.lai  libnl-route-3.lai  version.o
cache.o       libnl-genl-3.a   libnl-nf-3.a       msg.o
data.o        libnl-genl-3.la  libnl-nf-3.la      nl.o
root@ubuntu:/home/vv3/Downloads/wifi/libnl-3.2.25/lib/.libs#

离线

楼主 #16 2017-12-28 08:50:41

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

执行这个x86编译:

./configure --prefix=/usr     \
            --sysconfdir=/etc \
            --disable-static  &&
make


晕哥,我的和你那样操做,有错误,是什么问题呢,网上查都查不到
../lib/.libs/libnl-3.so: undefined reference to `nl_hash_any'
collect2: error: ld returned 1 exit status
make[2]: *** [nf-ct-list] Error 1
make[2]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vv3/Downloads/wifi/libnl-3.2.25/src'
make: *** [all-recursive] Error 1
root@ubuntu:/home/vv3/Downloads/wif

离线

楼主 #19 2017-12-28 09:44:53

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥 说:

刚才用办公电脑再试了一次, 仍然非常正常:

wget https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar xvf libnl-3.2.25.tar.gz
./configure --prefix=/usr                 --sysconfdir=/etc             --disable-static
make -j3


晕哥,终于可以了可能我的libnl有问题,下面是用的gcc编译吗?如果要编译到v3s上用,要怎么编译?是在make后面跟着CC=arm-linux-gnueabihf-gcc吗
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for arm-linux-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes

离线

楼主 #21 2017-12-28 10:33:50

zhuacai
会员
注册时间: 2017-12-16
已发帖子: 234
积分: 233.5

Re: 各路大神,交叉编译libnl-3.2.25成功后没有libnl-3.so.200库,是什么问题?

晕哥,我下面的编译方法是不是交叉编译了,可以在v3s里用了吗?
https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
tar zxvf libnl-3.2.25.tar.gz
cd libnl-3.2.25
./configure --prefix=$(pwd)/aaa     \
        --host=arm-linux-gnueabihf  \
            --sysconfdir=/etc \
            --disable-static  &&
make
make install

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn