Question

The instruction for building marmalade extension static lib-wrappers from the official site shows how to build only single architecture (armv6) extension. I tried to include many architectures into the project:

if {{defined I3D_OS_IPHONE}}
{
    includepath incoming

    files
    {
    ["MyTracker Library armv7"]
    (incoming/armv7)
    "*.o"

    ["MyTracker Library armv7s"]
    (incoming/armv7s)
    "*.o"

    ["MyTracker Library armv64"]
    (incoming/armv64)
    "*.o"    

        ["source"]
        (use_first_found, source/iphone, source/generic)
        MyTracker_platform.mm
        #Add any iphone-specific files here
    }
}

But I got many error messages after trying to build it:

Executing: '/usr/local/bin/scons -Q compiler=clang'

scons: warning: Support for pre-2.7.0 Python version (2.6.8) is deprecated.
    If this will cause hardship, contact dev@scons.tigris.org.
File "/usr/local/bin/scons", line 192, in <module>
Librarian [ar] /Users/misha/Documents/MyTracker/lib/iphone/libMyTracker.a
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib: archive member: /Users/misha/Documents/MyTracker/lib/iphone/libMyTracker.a(MyDispatcher.o) cputype (7) does not match previous archive members cputype (12) (all members must match)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib: archive member: /Users/misha/Documents/MyTracker/lib/iphone/libMyTracker.a(MyTracker.o) cputype (16777223) does not match previous archive members cputype (12) (all members must match)
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/ranlib: archive member: /Users/misha/Documents/MyTracker/lib/iphone/libMyTracker.a(MyNetwork.o) cputype (16777228) does not match previous archive members cputype (12) (all members must match)

....

malformed object (unknown load command 1)
ar: internal ranlib command failed
scons: *** [/Users/misha/Documents/MyTracker/lib/iphone/libMyTracker.a] Error 1
Executing 'scons -Q' failed. (return code 2). Retry
error: Executing 'scons -Q' failed. (return code 2)
FAILED (error code=3)

How to build an extension with multiple architectures support?

Was it helpful?

Solution

This is typically not the advised way to handle this. You look like you're trying to bring in symbols from those libs, something that the EDK does not support. Your best option is to include these libs (or most probably, just the arm6/7 lib, depending on how low you want to take it) at deploy time along with the compiled extension and instead, compile the extension using a header file (either supplied by the developer of any SDK you're using, or one you've written to compile those .o libs).

OTHER TIPS

Building for multiple targets is something that is being refactored. My understanding is that at some stage both the documentation and the underlying code has got stale. I believe the approach will be quite different from what you are trying to do - I'm not sure why you are pulling in .o files but generally that does work too well in marmalade.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top