nimarchive icon indicating copy to clipboard operation
nimarchive copied to clipboard

Dynamic linking

Open SolitudeSF opened this issue 6 years ago • 5 comments

Can this be linked dynamically?

SolitudeSF avatar Nov 18 '19 14:11 SolitudeSF

I haven't enabled it since there were some issues building the .so file. You can try enabling it by removing archiveStatic and all xxxStd lines from here - https://github.com/genotrance/nimarchive/blob/master/nimarchive/archive.nim#L11. Have to remove standard .a files since they aren't built with -fPIC which is required for the .so. Have to build dependencies from scratch.

Also, need to remove this multi-replace: https://github.com/genotrance/nimarchive/blob/master/nimarchive/archive.nim#L74 which disables building the .so.

genotrance avatar Nov 26 '19 19:11 genotrance

tried that ~~and it built fine~~ choosenim built fine. would be nice to have that as a switch.

also, why would i need building .so for that?

SolitudeSF avatar Nov 27 '19 21:11 SolitudeSF

Actually, the easiest way to do this is to install libarchive with your package manager, remove all instances of xxxStatic and add archiveStd.

I agree this should be an option for nimarchive and it shouldn't be hard-coded. However, covering every scenario is not trivial.

genotrance avatar Nov 27 '19 21:11 genotrance

well, doesn't look like its more complex than simple when

SolitudeSF avatar Nov 27 '19 21:11 SolitudeSF

the fact that static linking is used may be causing this https://github.com/dom96/choosenim/issues/122 see https://github.com/dom96/choosenim/issues/122#issuecomment-576043187

dyld: lazy symbol binding failed: Symbol not found: _futimens

/Users/travis/build/dom96/choosenim/src/choosenimpkg/utils.nim(47) extract /Users/travis/.nimble/pkgs/nimarchive-0.3.5/nimarchive.nim(84) extract SIGABRT: Abnormal termination.

timotheecour avatar Jan 19 '20 21:01 timotheecour