none
Visual Studio Android compiler flags issue

    Question

  • Hi,

    I have two issues with the compiler flags in a freshly created Android NativeActivity project (when compiling for ARM):

    1) First it seems the 'Floating-point ABI' property is ignored. I set it to 'SoftFP (-mfloat-abi=softfp)', however in the verbose output I can see that what actually gets passed to the compiler is '-target-feature +soft-float-abi -mfloat-abi soft'. This will be a major performance issue!

    2) Secondly it seems Visual Studio adds '-target-cpu cortex-a8' flag automatically to the compiler flags. This will cause '__ARM_NEON__' to be defined in the precompiled header which will cause problems if I want to compile for armv7 cpu-s without NEON support (f.e Tegra 2).

    Are these known issues? Is there a workaround?

    This happens with both Community and Enterprise Update 3 editions.

    Thursday, February 9, 2017 8:07 PM

Answers

  • I created a feedback ticket: https://connect.microsoft.com/VisualStudio/feedback/EditFeedback.aspx?FeedbackID=3123312

    I decided to ignore the issue regarding NEON/cortex-a8 issue because it's only relevant to a few very old devices.

    • Marked as answer by gq3 Thursday, February 16, 2017 5:13 PM
    Thursday, February 16, 2017 5:13 PM

All replies

  • Hi gq3,

    According to your description, which emulator you are operating, Android emulator from Google or Android emulator from Microsoft?

    And could you please share me a screenshot about your issue, you could upload it to OneDrive and share a link here in text format, which could help me understand your issue clearly.

    Whether you used the following emulator?

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 13, 2017 2:02 AM
    Moderator
  • I'm using an actual device not an emulator, but it doesn't matter. This is a compile/build issue that happens regardless what device or emulator you are running, you can even have no devices connected at all, the problem is still there.

    This is an image from the project properties and the verbose compiler output: https://1drv.ms/i/s!AiIvBuPTiEVdgx0PVsRRp_ZzM7sP


    • Edited by gq3 Monday, February 13, 2017 12:08 PM
    Monday, February 13, 2017 12:07 PM
  • Hi gq3,

    According to your description, whether you could deploy a new project to an ARM device. I followed your screenshot, and build my project without any problems.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 15, 2017 9:21 AM
    Moderator
  • The deployment itself is not a problem the sample app compiles and deploys fine.

    The problem is the compiler flags that get passed to the compiler do not match the flags set in the properties. Please look at the green and red circles on the screenshot I posted last time.

    These incorrect flags cause performance and runtime problems in real world applications. How can we use Visual Studio for Android development if such basic things work incorrectly?

    Thanks

    • Edited by gq3 Wednesday, February 15, 2017 2:42 PM
    Wednesday, February 15, 2017 2:42 PM
  • Hi gq3,

    In my side, I could reproduce your issue. I suggest you could report your issue to the following link:

    http://connect.microsoft.com/VisualStudio

    and share your link here, I think engineers from Microsoft will evaluate this issue seriously. And remember to mark you reply that could help others who have the same issue as yours to vote and comment it.

    Sincerely,

    Oscar


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 16, 2017 9:42 AM
    Moderator
  • I created a feedback ticket: https://connect.microsoft.com/VisualStudio/feedback/EditFeedback.aspx?FeedbackID=3123312

    I decided to ignore the issue regarding NEON/cortex-a8 issue because it's only relevant to a few very old devices.

    • Marked as answer by gq3 Thursday, February 16, 2017 5:13 PM
    Thursday, February 16, 2017 5:13 PM