项目里编译codec
src\makefiles\android\codec\Makefile
line 25 原本用 4.6 不会报错
-L/data/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a \
改成
-L/data/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a \

编译报错 (下面只有四行)

make[]: Entering directory `~/video/makefiles/android/codec'
/data/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -Wl,--as-needed -lc -Wl,--no-undefined -nostdlib -Wl,-soname,libcodec.so -Wl,-shared,-Bsymbolic ../../../src/codec/H264Encoder_noarch_noplat.o ../../../src/codec/ANDROIDAACEncoder_noarch_noplat.o ../../../src/codec/FH264Decoder_noarch_noplat.o ../../../src/codec/AACDecoder_noarch_noplat.o -L. -L../../../output -L../../../input/prebuilt/android -L../../../testbed/recordtest/libs/armeabi -L/data/android/src/4.4/out/target/product/generic/system/lib -L/data/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a -lmlbase -laacdec -larcsoft_h264_enc_arm11_vt -larcsoft_mp4audiocommon_he -laacencoder -lavcodec -lavutil -lz -lm -lc -llog -lstagefright -lmedia -lutils -lbinder -lgnustl_static /data/android/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.8/armv7-a/libgcc.a -shared -fPIC -o ../../../testbed/recordtest/libs/armeabi/libcodec.so -Xlinker -cref -Xlinker -Map -Xlinker ../../../testbed/recordtest/libs/armeabi/libcodec.map
/data1/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /data/android/android-ndk/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/libgnustl_static.a(eh_globals.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC
/data1/android/android-ndk-r9d/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: hidden symbol '__dso_handle' is not defined locally
collect2: error: ld returned exit status

相关的库文件是armeabi-v7a文件夹下 libgnustl_static.a
Google上有人解释说所引用crtbegin_so.o非PIC
https://code.google.com/p/android/issues/detail?id=23203
The problem is that there is a text relocation for __dso_handle. In other words, the code in crtbegin_so.o is not position independent.This is what gcc generates for the same code transposed in C, for arm (thumb would be different):

如果一定用4.8的话,按照
http://www.cnblogs.com/yuanxiaoping_21cn_com/p/3971162.html
可以行得通。

unsupported dynamic reloc R_ARM_REL32 AND hidden symbol '__dso_handle' is not defined的更多相关文章

  1. error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC解决办法

    使用qtcreator加androidndk编译项目时报错: error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; r ...

  2. hidden symbol `pthread_atfork'

    gcc交叉编译时发生这种错误 /.. .../voice_demo: hidden symbol `pthread_atfork' in /opt/gcc-linaro-aarch64-linux-g ...

  3. hidden symbol ... is referenced by DSO

    在Linux上编译Qt的时候configure出来的Makefile传递给g++的参数visiblility=hidden,然后就会调用Qt库所使用的第三方库libpng库源代码函数声明添加上__at ...

  4. [原]android 链接错误

    由于没有使用NDK的makefile, 而是把NDK的toolchain集成到现有的build system, 所以出现了诡异的错误: unsupported dynamic reloc R_ARM_ ...

  5. Static, Shared Dynamic and Loadable Linux Libraries

    转载:http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html Why libraries are used: Th ...

  6. Native层和so接口和Java层

    一.Java层加载so文件 Android在Java层加载so的接口是System.loadLibrary()逐级调用的过程: System.loadLibrary()系统源码: 987    pub ...

  7. elf.h

    1 /* This file defines standard ELF types, structures, and macros. 2 Copyright (C) 1995-2019 Free So ...

  8. Android so库文件的区节section修复代码分析

    本文博客地址:http://blog.csdn.net/qq1084283172/article/details/78818917 一.Android so库文件的节表secion修复方案整理 1.简 ...

  9. -/bin/sh: ./led: not found的解决办法

    环境介绍: 开发板:qq2440 交叉编译器:arm-linux-gcc 3.4.1 内核版本:2.6.13 一.针对该类问题从两个方面入手: 1.从权限出发,权限不够会出现此问题 2.从库文件出发, ...

随机推荐

  1. Java API —— ArrayList类 & Vector类 & LinkList类

    1.ArrayList类     1)ArrayList类概述         · 底层数据结构是数组,查询快,增删慢         · 线程不安全,效率高     2)ArrayList案例   ...

  2. socklen_t在windows和linux平台下的头文件定义

    windows平台下:头文件:#include<ws2tcpip.h> linux平台下:下面两个头文件都有定义:1)#include <sys/socket.h>2)#inc ...

  3. Lua for windows中SciTe开启支持python的方法

    打开Options-Open Global Options #import python的#去掉即可

  4. Linux下检查是否安装过某软件包

    1.rpm包安装的,可以用 rpm -qa 看到,如果要查找某软件包是否安装,用 rpm -qa | grep "软件或者包的名字" 2.以deb包安装的,可以用 dpkg -l ...

  5. Android开发之火星坐标转换工具

    代码: import java.io.InputStream; import java.io.ObjectInputStream; /* * 把获取到的真实地址转换为火星坐标 */ public cl ...

  6. Python模块整理(三):子进程模块subprocess

    文章 原始出处 http://ipseek.blog.51cto.com/1041109/807513. 本来收集整理网络上相关资料后整理: 从python2.4版本开始,可以用subprocess这 ...

  7. Codeforces Round #259 (Div. 2) C - Little Pony and Expected Maximum

    题目链接 题意:一个m个面的骰子,抛掷n次,求这n次里最大值的期望是多少.(看样例就知道) 分析: m个面抛n次的总的情况是m^n, 开始m==1时,只有一种 现在增加m = 2,  则这些情况是新增 ...

  8. Java实现RC4加解密

    package com.vrv.paw.utils; public class RC4Util { public static String decry_RC4(byte[] data, String ...

  9. error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC解决办法

    使用qtcreator加androidndk编译项目时报错: error: qrc_qml.obj: requires unsupported dynamic reloc R_ARM_REL32; r ...

  10. 两个简单的python文件,实现删除本地文件夹和mongodb数据库的内容

    删除本地文件夹: import os , string , datetime ; str = '/home/niuguoqin/tmp/tomcat/'; b = (datetime.datetime ...