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 7647203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:24:23+00:00 2026-05-31T10:24:23+00:00

After several hours of experimentation, I’ve managed to reduce the problem to the following

  • 0

After several hours of experimentation, I’ve managed to reduce the problem to the following example (C++):

extern "C" void foo();

struct test
{
    ~test() { }
};

void doTest()
{
    test t; // 1
    foo();  // 2
}

This is being compiled for iOS devices in XCode 4.2, using the provided Clang compiler (Apple LLVM compiler 3.0) and the iOS 5.0 SDK. The project is configured as a Cocoa Touch Static Library, and “Enable Linking With Shared Libraries” is set to No because I’m building an AIR native extension. The function foo is defined in another external library. (In my actual project, this would be any of the C API functions defined by Adobe for use in AIR native extensions.)

When attempting to compile this code, I get back the error:

FATAL:incompatible feature used: section type non_lazy_symbol_pointers (must specify "-dynamic" to be used)
clang: error: assembler command failed with exit code 1 (use -v to see invocation)

The error goes away if I comment out either of the lines marked 1 or 2 above, or if I change the build setting “Enable Linking With Shared Libraries” to Yes. (However, if I change the build setting, then I get multiple ld warning: unexpected srelocation type 9 warnings when linking the library into the final project, and the application crashes when running on the device.) The build error also goes away if I remove the destructor from test.

So: Is this a bug in Clang? Am I missing some all-important and undocumented build setting? The interaction between an externally-provided function and a struct with a destructor is very peculiar, to say the least.

  • 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-05-31T10:24:24+00:00Added an answer on May 31, 2026 at 10:24 am

    After much searching, I finally stumbled across Richard Lord’s excellent blog post on AIR native extensions. It turns out that effective development requires use of a few flags that Adobe hasn’t bothered to document yet (unless you count developer blog posts as documentation — I don’t).

    Long story short:

    • Set “Enable Linking With Shared Libraries” to Yes. Setting this to No is the single most pervasive piece of bad advice out there about developing AIR native extensions.
    • Use ADT’s -platformsdk option to point to the iOS SDK provided by Apple (example: -platformsdk /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk). This will alleviate the unexpected srelocation type 9 warnings. Adobe’s documentation states that -platformsdk is only for Android, but that’s a lie.
    • When packaging the extension (that is, when building the ANE file), use the undocumented -platformoptions option to specify an xml file containing additional linker arguments. The format of this XML file is also undocumented, but a template can be found in the AIR SDK directory under templates/extensions/ios/platform-descriptor-template.xml. There’s also an xsd schema in the same location. This file allows you to specify whatever additional frameworks your extension uses, so you won’t be limited to the default frameworks that the AIR SDK supports.
    • Expect to see a new linker warning: ld: warning: ARM function not 4-byte aligned. This can apparently be safely ignored. Adobe is reportedly aware of the issue. I imagine that you can silence this warning by passing -w to the linker in the platformoptions file, but be aware that -w silences all warnings, not just that one.

    Further information can be found in these two blog posts by Rajorshi Ghosh, one of the Adobe engineers:

    • iOS5 support for AIR/Using external SDKs to package apps
    • Debugging Native Extensions for AIR iOS

    This still doesn’t explain the weird interaction between “Enable Linking With Shared Libraries”, externally defined functions, and destructors, but that’s now reduced to a matter of curiosity rather than a blocking issue.

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

Sidebar

Related Questions

After several hours test, in iOS 4.0 and above I found if I draw
So, after several hours of reading the Apple walkthrough I finally managed to deploy
After browsing for several hours, I'm completely stumped on how to prevent Windows 7
The example code of section 10.6, the expected result is: after several iterations, the
I am so frustrated right now after several hours trying to find where shared_ptr
This should be relatively easy to do, but after several hours straight programming my
I am trying to install PIL on Mac OSX 10.7.4 but after several hours
I'm trying to write some custom Facelets 2.0 tags, after several hours work, I
After several hours of tinkering I cannot seem to figure this out. I have
I've just started playing with IoC containers and therefore chosed Ninject. After several hours

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.