Relocations in generic ELF (EM: 40)
最近在搞机器上的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)的更多相关文章
- 异常之交叉编译---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 ...
- iperf linux版本移植到android (使用工具链方式不是使用Android.mk)
由于很多程序是用makefile编译linux应用程序的,如果移植到android就要重新写Android.mk,对于不熟悉这个的人来说,特别麻烦,所以这里介绍只修改makefile就能移植到andr ...
- 交叉编译jpeglib遇到的问题
由于要在开发板中加载libjpeg,不能使用gcc编译的库文件给以使用,需要自己配置使用另外的编译器编译该库文件. /usr/bin/ld: .libs/jaricom.o: Relocations ...
- Linux编译移植Qt5的环境_OMAPL138平台
Linux编译移植Qt5_OMAPL138 [导语]:昨天编译Qt5各种失败,各种离奇的错误在Google上面也搜索不到,真是让人"蛋疼菊紧",今天把所有的环境全部清理干净,也重新 ...
- Qt小结
(1)#include 报错fatal error: QHostInfo:No such file or directory, 解决办法 在.pro文件中添加 QT += core gui netwo ...
- libnl的移植
libnl简介 libnl是为了方便应用程序使用netlink接口而开发的一个库.这个库为原始netlink消息传递以及不同的netlink,family专用接口提供了一个统一的接口.libnl2.0 ...
- s5pv210编译qt
undefined reference to `rpl_malloc' 编译tslib,执行make时提示undefined reference to `rpl_malloc' 是因为config.h ...
- opencv在arm和x86在移植
一个.开发环境 操作系统:fedora14 Opencv版本号:2.0 Qt版本号:4.7 arm:mini6410 交叉编译工具:arm-linux-gcc-4.5.1 二.安装与配置 Linux系 ...
- linux下arm平台Qt编译环境搭建与解析
一.概述: 我们知道QTcreator.这仅仅是个IDE,他包含了一个编译器--qmake.这两者的关系与codeblocks和g++的关系一样,首先要明确这些. 而我们在linu ...
随机推荐
- 有关类朋友圈设计(3) -- 数据库设计&现有技术&流程设计
在写之前,先说说当前的系统架构吧 spring cloud + zuul + eureka + oauth2 + redis + rabbitMq 这个系统是由我搭建的,当时采用的springClou ...
- NOIP初赛:完善程序做题技巧
最近写的文章好像还很多的.那么今天我们来讨论NOIP初赛的题型--完善程序.完善程序相对是比较难的题目了.全卷100分,完善程序占了大概26分,占比非常大.如果和英语考试试卷做比较,相当于首字母填空( ...
- 【OI】竖式问题分析与解答
题目:找出所有形如abc*de(三位数乘以两位数)的算式,使得在完整的竖式中,所有数字都属于一个特定的数字集合.输入数字集合(相邻数字之间没有空格),输出所有竖式.每个竖式前应有编号,之后应有一个空行 ...
- vscode快速添加引号 批量增加引号(用于批量格式化代码)
一.在浏览器中将Params复制到pycharm的py文件中 二.选中需要添加引号的部分,Ctrl+H 调出替换工具栏 三.填写正则表达式 (.*?): (.*) '$1':'$2', 右侧注意点击使 ...
- 第一节:《线程安全和锁Synchronized概念》
第一节:线程安全和锁Synchronized概念 一.进程与线程的概念 (1)在传统的操作系统中,程序并不能独立运行,作为资源分配和独立运行的基本单位都是进程. 在未配置 OS 的系统中,程序的执行方 ...
- ecshop二次开发秒杀、限时折扣、清仓等功能
限时抢购,秒杀商品的二次开发 1,先在后台admin/templates 中找goods_info.htm文件到促销部分,改为一个下拉列表的分别是促销,限时,秒杀,值分别是1,2,3这样,代码如下: ...
- Shell系列(29)- 单分支if语句格式
单分支if条件语句 if [ 条件判断 ] ;then 程序 fi 或者 if [ 条件判断 ] then 程序 fi 注意点 if语句使用fi结尾,和一般语言使用大括号结尾不同 [ 条件判断 ]就是 ...
- DevOps与CICD简介
整体知识点 ·Devops与CI/CD简介 ·Gitlab安装与Git命令使用 ·Gitlab实现持续集成 ·Gitlab实现分支管理 ·Jenkins简介及安装 ·Jenkins插件管理及基础配置 ...
- sublime text 3 在Windows下配置sublimelinter-php的路径问题
首先用package control安装sublimelinter和sublimelinter-php,然后依次点击菜单preference-package settings-sublimelinte ...
- CF786C-Till I Collapse【树状数组倍增,优先队列】
正题 题目链接:https://www.luogu.com.cn/problem/CF786C 题目大意 给出一个长度为\(n\)的序列. 对于每个\(k\in[1,n]\)求将\(n\)分成最少的段 ...