warning: shared library text segment is not shareable
error: treating warnings as errors
最近在调试一个Gsensor, 代码是从android4.2上直接移植过来的。但却一直编译不过, 纳闷了。。。
baidu不行
google 又访问不了,真是操蛋
但是终究还是找到了点有用的信息,说是编译器的选项要加上 --no-fatal-warnings
可不管怎么加, 加到那儿都变成了g++的选项,可g++不认得它。郁闷 了一会
看了看链接器的链接选项中看到了如下两个选项
--warn-shared-textrel Warn if text segment is not shareable
--no-warn-shared-textrel Do not warn if text segment is not shareable (default)
由此推测一空是默认添加了 --warn-shared-textrel
所以打一此处直接去掉就OK了, 具体如下:
diff --git a/android/build/core/combo/TARGET_linux-arm.mk b/android/build/core/combo/TARGET_linux-arm.mk
index 5ff30fa..accc3ff 100755
--- a/android/build/core/combo/TARGET_linux-arm.mk
+++ b/android/build/core/combo/TARGET_linux-arm.mk
@@ -132,7 +132,6 @@ TARGET_GLOBAL_LDFLAGS += \
-Wl,-z,noexecstack \
-Wl,-z,relro \
-Wl,-z,now \
- -Wl,--warn-shared-textrel \
-Wl,--fatal-warnings \
-Wl,--icf=safe \
$(arch_variant_ldflags)
warning: shared library text segment is not shareable,布布扣,bubuko.com
warning: shared library text segment is not shareable
原文地址:http://blog.csdn.net/qjclinux/article/details/37036667