简体   繁体   English

NDK12b:clang和gcc使用独立工具链和相同的构建脚本生成的不同ELF

[英]NDK12b: Different ELF produced by clang vs gcc using the standalone toolchain and the same build scripts

Our product contains multiple source packages. 我们的产品包含多个源程序包。 Some of the source packages are built using autotool/conf. 一些源程序包是使用autotool / conf构建的。

Based on what google said of switching to clang as a default compiler for the NDK starting with NDK-13, we went ahead with the switch in the *.mk files as well as in our env setup and build scripts. 根据Google所说的从NDK-13开始,将clang用作NDK的默认编译器的说法,我们继续进行* .mk文件以及环境设置和构建脚本中的切换。 No make files where changed. 没有更改文件。

We were using NDK-10d which is old, so we switched to NDK-12b. 我们使用的是旧的NDK-10d,因此我们改用了NDK-12b。 We also generated a standalone toolchain from it, as recommended by Android's documentation, to simplify our build scripts and standardize across all. 根据Android文档的建议,我们还从中生成了一个独立的工具链,以简化我们的构建脚本并使所有标准标准化。

The issue I am facing is the crash on launch as soon as the native code is loaded. 我面临的问题是,加载本机代码后,启动时会崩溃。 What I have noticed is a warning in logcat regarding: unused DT entry: type 0x6ffffffe ( VERNEED ) and 0x6fffffff ( VERNEEDNUM ). 我注意到的是logcat中的一条警告,内容涉及: unused DT entry: type 0x6ffffffeVERNEED )和0x6fffffffVERNEEDNUM )。

Then, the dreaded: A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x30 in tid 22246 . 然后,可怕的: A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x30 in tid 22246

The stack trace tells me very, very little: 堆栈跟踪告诉我非常少的信息:

08-11 15:31:02.421 128-128/? I/DEBUG:     #00 pc 00036b8c  /system/lib/libc.so
08-11 15:31:02.421 128-128/? I/DEBUG:     #01 pc 0003817b  /system/lib/libc.so (vfprintf+18)
08-11 15:31:02.421 128-128/? I/DEBUG:     #02 pc 00035251  /system/lib/libc.so (fprintf+12)
08-11 15:31:02.421 128-128/? I/DEBUG:     #03 pc 000015fd  /data/app/com.myapp.demo-1/lib/arm/libappdebug.so (pipe_listen+328)
08-11 15:31:02.421 128-128/? I/DEBUG:     #04 pc 0001659b  /system/lib/libc.so
08-11 15:31:02.421 128-128/? I/DEBUG:     #05 pc 000144c3  /system/lib/libc.so

Notice that comparing the data within the ELFs as dumped by readelf -d shows the absence of those 2 DT entries in the binaries generated by arm-linux-androideabi-gcc-4.9 builds. 请注意,将readelf -d转储的ELF中的数据进行比较,可以看出在arm-linux-androideabi-gcc-4.9构建生成的二进制文件中没有这2个DT条目。

Any ideas, pointers, ...anything at all ..., would be much appreciated cuz i have been stuck for (blush) 3 days now. 任何想法,指针,……任何东西……都将不胜感激,因为我被卡住(脸红)三天了。

Thanks. 谢谢。

You need to look into the problem of your unused DT entry . 您需要调查unused DT entry的问题。 If you're using your library to pipe stuff somewhere else, that warning will appear at every run and endanger your pipe to receive garbage, or your app to receive excpetions. 如果您正在使用库在其他地方输送管道,则该警告将在每次运行时出现,并危及管道接收垃圾或使应用程序接收异常的危险。 Please have a look at my post here . 请在这里看我的帖子。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM