最近在搞机器上的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. EditPlus配置C/C++运行环境

    1.安装MinGW和EditPlus 2.打开EditPlus ctrl+1 编译 ctrl+2 运行

  2. Ts基本数据类型

    TS的基本数据类型 string let str : string str = 1 //报错 会提示num是字符串 不是数字 str = 'test' //正确 //拼接字符串 let str2 : ...

  3. TypeScript与面向对象

    目录 1.引 2.类(class) 3.构造函数和this 4.继承 5.super 6.抽象类 7.接口 8.属性的封装 9.泛型 1.引 简而言之就是程序之中所有的操作都需要通过对象来完成.一切操 ...

  4. PHP设计模式之命令模式

    命令模式,也称为动作或者事务模式,很多教材会用饭馆来举例.作为顾客的我们是命令的下达者,服务员是这个命令的接收者,菜单是这个实际的命令,而厨师是这个命令的执行者.那么,这个模式解决了什么呢?当你要修改 ...

  5. Python - 生成requirement.text 文件

    前言 该篇操作笔记摘自小菠萝 Python项目中,一般都会有一个 requirements.txt 文件 这个文件主要是用于记录当前项目下的所有依赖包及其精确的版本号,以方便在一个新环境下更快的进行部 ...

  6. javascript 高阶函数 实现 AOP 面向切面编程 Aspect Oriented Programming

    AOP的主要作用是吧一些跟核心业务逻辑模块无关的功能 -日志统计, 安全控制, 异常处理- 抽离出来, 再通过"动态织入"的方式掺入业务逻辑模块中. 这里通过扩展Function. ...

  7. php socket 发送http请求 GET POST

    http://docs.php-http.org/en/latest/httplug/users.html <?php /** * Created by PhpStorm. * User: Mc ...

  8. flask_sqlalchemy 查询结果转dict 终极解决方案

    之前为了学习Python,试着拿Flask作框架搞小网站,感觉还不错,基本就抛弃了PHP.前段时间做了一个微信小程序,想着yii框架拿来写几十个小接口是不是浪费了,就继续用flask写api了,哪想到 ...

  9. 大型项目源码集合「GitHub 热点速览 v.21.39」

    作者:HelloGitHub-小鱼干 代码,尤其是优雅规范的代码,一直都是学习编程技巧的捷径.虽然有实用的代码小片段,能拯救当前业务的燃眉之急,但是真要去提升自己的技能还是得从大型的项目,尤其是有一定 ...

  10. 记typora美化----让文章更加优美

    前言 昨晚偶然间看到一篇介绍记笔记工具以及如何美化的视频,突发奇想我打算也写一篇记录一下自己的美化过程,并会把自己使用的插件,样式文件等提供在下方,觉得不错得可以直接拿去使用,只希望观众能够一键3连, ...