最近在搞机器上的wifi热点,需要移植一大堆东西,如hostapd\wpa_suppliant、dhcp等,这些玩意又依赖其他的一大堆库的移植,比如libnl,openssl等,今天在移植编译libnl-3.4.0出现报错“Relocations in generic ELF (EM: 40)”

详细log如下:

void@void-ThinkPad-E450:~$ tar -xvf libnl-3.4.0.tar.gz
void@void-ThinkPad-E450:~/libnl-3.4.0$ sudo mkdir /usr/local/arm/libnl3.4
void@void-ThinkPad-E450:~$ cd libnl-3.4.0/
void@void-ThinkPad-E450:~/libnl-3.4.0$ ./configure --host=arm-linux –prefix=/usr/local/arm/libnl3.4
void@void-ThinkPad-E450:~/libnl-3.4.0$ sudo make CC=/usr/local/arm/gcc-linaro/bin/arm-linux-gnueabi-gcc
CC lib/lib_libnl_3_la-addr.lo
CC lib/lib_libnl_3_la-attr.lo
CC lib/lib_libnl_3_la-cache.lo
CC lib/lib_libnl_3_la-cache_mngr.lo
CC lib/lib_libnl_3_la-cache_mngt.lo
CC lib/lib_libnl_3_la-data.lo
CC lib/lib_libnl_3_la-error.lo
CC lib/lib_libnl_3_la-handlers.lo
CC lib/lib_libnl_3_la-msg.lo
CC lib/lib_libnl_3_la-nl.lo
CC lib/lib_libnl_3_la-object.lo
CC lib/lib_libnl_3_la-socket.lo
CC lib/lib_libnl_3_la-utils.lo
CC lib/lib_libnl_3_la-version.lo
CC lib/lib_libnl_3_la-hash.lo
CC lib/lib_libnl_3_la-hashtable.lo
CC lib/lib_libnl_3_la-mpls.lo
CCLD lib/libnl-3.la
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: lib/.libs/lib_libnl_3_la-addr.o: Relocations in generic ELF (EM: 40)
lib/.libs/lib_libnl_3_la-addr.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [lib/libnl-3.la] Error 1

经过查找资料,了解到应该是前后编译器不一样导致,因为在未设置交叉编译器之前我make过一次,失败之后再去配置的,所以只需要clean干净,然后统一用新的交叉编译器编译次即可

void@void-ThinkPad-E450:~/libnl-3.4.0$ ./configure --host=arm-linux --prefix=/usr/local/arm/libnl3.4 CC=/usr/local/arm/gcc-linaro/bin/arm-linux-gnueabi-gcc

void@void-ThinkPad-E450:~/libnl-3.4.0$ sudo make

void@void-ThinkPad-E450:~/libnl-3.4.0$ sudo make install
…........................................
Libraries have been installed in:
/usr/local/arm/libnl3.4/lib/libnl/cli/qdisc
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf' See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/arm/libnl3.4/etc/libnl'
/usr/bin/install -c -m 644 etc/pktloc etc/classid '/usr/local/arm/libnl3.4/etc/libnl'
make[1]: Leaving directory `/home/void/libnl-3.4.0'

如上则已经成功编译安装。

Relocations in generic ELF (EM: 40)的更多相关文章

  1. 异常之交叉编译---arm-vfp-linux-gnu/bin/ld: cgic.o: Relocations in generic ELF (EM: 3)

    /opt/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/../../../../arm-none-linux-gnueabi/bin/l ...

  2. iperf linux版本移植到android (使用工具链方式不是使用Android.mk)

    由于很多程序是用makefile编译linux应用程序的,如果移植到android就要重新写Android.mk,对于不熟悉这个的人来说,特别麻烦,所以这里介绍只修改makefile就能移植到andr ...

  3. 交叉编译jpeglib遇到的问题

    由于要在开发板中加载libjpeg,不能使用gcc编译的库文件给以使用,需要自己配置使用另外的编译器编译该库文件. /usr/bin/ld: .libs/jaricom.o: Relocations  ...

  4. Linux编译移植Qt5的环境_OMAPL138平台

    Linux编译移植Qt5_OMAPL138 [导语]:昨天编译Qt5各种失败,各种离奇的错误在Google上面也搜索不到,真是让人"蛋疼菊紧",今天把所有的环境全部清理干净,也重新 ...

  5. Qt小结

    (1)#include 报错fatal error: QHostInfo:No such file or directory, 解决办法 在.pro文件中添加 QT += core gui netwo ...

  6. libnl的移植

    libnl简介 libnl是为了方便应用程序使用netlink接口而开发的一个库.这个库为原始netlink消息传递以及不同的netlink,family专用接口提供了一个统一的接口.libnl2.0 ...

  7. s5pv210编译qt

    undefined reference to `rpl_malloc' 编译tslib,执行make时提示undefined reference to `rpl_malloc' 是因为config.h ...

  8. opencv在arm和x86在移植

    一个.开发环境 操作系统:fedora14 Opencv版本号:2.0 Qt版本号:4.7 arm:mini6410 交叉编译工具:arm-linux-gcc-4.5.1 二.安装与配置 Linux系 ...

  9. linux下arm平台Qt编译环境搭建与解析

    一.概述:      我们知道QTcreator.这仅仅是个IDE,他包含了一个编译器--qmake.这两者的关系与codeblocks和g++的关系一样,首先要明确这些.      而我们在linu ...

随机推荐

  1. go案例:客户管理系统流程 mvc模式 分层设计

    下面是一个简要的客服系统,主要是演示分层计.. model : 数据部份: package model import "fmt" //声明一个结构体,表示一个客户信息 type C ...

  2. vue2.0 前端框架

    在正式开始先复习一下js基础.因为vue最通终也要操作这些元素,vue和以前学的js并不挂勾,他和传统的jquert  设计理念相反 ## js 数据类型 1 基本类型 number  string  ...

  3. 1.Java 基础

    1. JDK 和 JRE 有什么区别? jdk:开发工具包,jre:java运行环境 jdk包含了jre和java开发环境,如编译java源码的编译器javac,还包含了许多java程序调试和分析的工 ...

  4. 关于python中一切皆对象和深浅拷贝

  5. js 获取转换网址中文参数

    var search = decodeURI(location.search).substr(1); console.log(search); decodeURI 方法返回一个已编码的统一资源标识符 ...

  6. Linux系列(13) - CentOs 8 配置静态IP

    step-1 vim etho的配置文件 [root#localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0 step-2 新增修改以下 ...

  7. Linux系列(34) - yum源文件(1)

    yum源文件各参数含义 在[/etc/yum.repos.d/]目录中,默认有4个yum源文件,其中[CentOS-Linux-BaseOS.repo]是基本yum源文件,如果我们能上网,那它是默认生 ...

  8. 博客主题-Next风格

    适配方法 下载压缩包,按照文件名将内容复制粘贴到对应框中即可. 注意事项 请将主题设置为custom 禁用默认css 下载连接 Next.rar version:2020-07-10 next.rar ...

  9. 腾讯云启动jenkins

    首先配置后jdk环境 可参考:https://www.cnblogs.com/Uni-Hoang/p/12991686.html 下载jenkins的war包 在/usr/local/创建一个jenk ...

  10. javascript 字符串 数字反转 字母大小写互换

    // 符串abcd123ABCD456 怎么转换为 ABCD321abcd654 // 数字要倒序 小写转大写, 大写转小写 Array.prototype.reverse = function() ...