Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8481437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:33:30+00:00 2026-06-10T19:33:30+00:00

I want to build my library for armv6, and there is some neon code

  • 0

I want to build my library for armv6, and there is some neon code that I enable at runtime if the device supports it. The neon code uses neon intrinsics, and to be able to compile it, I must enable armeabi-v7a, but that affects regular c-code (it becomes broken on some low-end devices).

So, if the android build system wasn’t excessively intrusive, I wouldn’t have to ask questions, but it seems that there is no way for me to compile one file for armv6 and the other file for arm7-neon.

Can anybody give any clues if that’s doable?

Edit
Before trying to reply and wasting internet-ink, it should be clear that these are the main points:
1) make only ONE lib.
2) make build that runs on armv6 (pre neon devices, e.g. armeabi).
3) allow this build to also contain NEON code (which could be executed based on run-time cpu detection; cpu detection is outside the scope of the question).
4) NEON code comes from a c/cpp file and is written using neon intrinsics.

Omitting any part of these requirements totally loses the point of the question

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:33:31+00:00Added an answer on June 10, 2026 at 7:33 pm

    I have recently found another way to work around the limitations of NDK. My case was not related to NEON, but for you the same hack could do the job.

    The trick is to use the existing “tag” mechanism of NDK to specify special CFLAGS for a bunch of files. This is how you do it:

    First, list the neon-specific sources. You cannot use the .neon suffix as described in docs/CPU-ARM-NEON.html because build-binary.mk will find that you are not targeting armeabi-v7a. I use the following technique:

    LOCAL_NEON_SRC_FILES := imgproc/neon_utils.c \
                            videoproc/usingneon.cpp
    LOCAL_SRC_FILES := main.c \
                       imgproc/img.c \
                       videoproc/video.cpp
    
    LOCAL_SRC_FILES += $(LOCAL_NEON_SRC_FILES)
    

    Now, define the CFLAGS for NEON:

    LOCAL_NEON_CFLAGS := -mfloat-abi=softfp -mfpu=neon -march=armv7
    

    Finally, add the following magical line to your Android.mk:

    TARGET-process-src-files-tags += $(call add-src-files-target-cflags, $(LOCAL_NEON_SRC_FILES), $(LOCAL_NEON_CFLAGS))
    

    If you have more than one binary to build, you will probably want $(LOCAL_NEON_SRC_FILES) to be reset by

    include $(CLEAR_VARS)
    

    For this, add the following to your Android.mk or to Application.mk:

    modules-LOCALS += NEON_SRC_FILES
    

    Note: I have not tried this magic for NEON, I needed it for entirely different purposes. You may need some adaptations to achieve the desired compilation options for your files, and for your project. I am using NDK r.8b, and I did not check if this would work on earlier (or later) versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to build a static library that catches incoming push notifications and uses
I want to build some statistics on which Java standard library classes (those in
I want to build a static library that requires openssl for iPhone. It can't
I want to build some libraries into executables that I need to use with
I want to build as simple notepad application with some code-completion. It should be
I want to build a shared library. GNU/Linux is the development and target platform.
I want build a sketch pad app on iPhone, I assume that this type
I want to build flash application that can detect the user eyes color and
I want to build a form_tag that will allow me to post a new
I want to build a python program that deletes all the photos from my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.