[swift-users] Swift Package Manager: Linker Flags

Greg Parker gparker at apple.com
Tue Feb 23 17:45:27 CST 2016


> On Feb 23, 2016, at 1:51 PM, Stephen Celis via swift-users <swift-users at swift.org> wrote:
> 
>> On Feb 23, 2016, at 4:35 PM, Fabio Kaminski <fabiokaminski at gmail.com> wrote:
>> 
>> Looking at the definition in the header file, it looks that it doesnt
>> declare any export definition for the functions like:
>> 
>> __attribute__((__visibility__("default")))
>> 
>> So maybe it would only work via static linking?
>> 
>> Im working in something here where theres a binding for a dinamic
>> library, and given is a dynamic linking
>> theres o way the swift runtime will "see" the symbols without it.
> [snip]
>>>  ~ $ nm -g /usr/local/opt/llvm/lib/libLLVMCore.a | grep LLVMGetGlobalContext
>>>  0000000000000081 T _LLVMGetGlobalContext
> 
> Thanks for the reply! The `-g` flag on `nm` should only print out external symbols, so I unfortunately don't think that's it :/

Use `nm -m` to get a readable description of symbol attributes like visibility. In this case "T" is an exported symbol in the __TEXT segment so visibility should not be a problem. If the symbol were not exported then it would be labeled "t".


-- 
Greg Parker     gparker at apple.com     Runtime Wrangler




More information about the swift-users mailing list