ios - Clang/LD function demangling? -


i have 2 working compilers, clang on mac, can target iphone, , clang on iphone, targets iphone. both work great, generating binaries , libraries. libraries produced on mac can linked on iphone. got strange issue, library not linking while trying link on iphone against library created on mac

undefined symbols:   "__z7js_initji", referenced from:       _main in test-cgdthx.o 

this call js_init, defined macro expands differently.

iphone-clang expand as:

extern jsruntime * js_init(uint32_t maxbytes, int); 

mac-clang expand as:

extern jsruntime * js_init(uint32_t maxbytes, jsusehelperthreads usehelperthreads); 

i not sure if macro expansion reason of linking failure.

ok, question, ji , z7 mean in __z7js_initji? can find table show me correspondence between argument types , mangling ids? must ld docs, unable find it. because not know query word this.

here's long reference on how (amongst other things) function name mangling works in gcc/clang:

http://mentorembedded.github.io/cxx-abi/abi.html#mangling

in section 5.1.5 type encodings, you'll see "ji" stands "unsigned int" , "int".

_z @ the start section 5.1.2 (prefix function names), "7" length of name "js_init".

hope helps!


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -