Warning: Shared Library text segment is not writable able

Source: Internet
Author: User

Warning: Shared Library text segment is not writable able
Error: treating warnings as errors

Recently I am debugging A gsensor. The code is directly transplanted from android4.2. But it has been compiled for a long time...
Baidu does not work
Google cannot access it again.

However, after all, I found some useful information, saying that -- no-fatal-warnings must be added to the compiler options.
But no matter how it is added, it becomes the option of G ++, but G ++ does not recognize it. Depressed for a while
Looking at the link options of the linker, we can see the following two options:
-- Warn-shared-textrel warn if text segment is not writable able
-- No-Warn-shared-textrel do not warn if text segment is not writable able (default)
Therefore, the -- Warn-shared-textrel is added by default.

So after you click here to remove it directly, the details are as follows:
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.