Is it possible to suppress standard lib and dlang symbols in dylib (macos)

David dangermouseb at forwarding.cc
Sat Mar 13 23:41:28 UTC 2021


On Friday, 12 March 2021 at 00:12:37 UTC, Guillaume Piolat wrote:
>
> Create a exports.lst file with:
>
> _addDD_D
>
>
> as the only line there.
> Build with:
>
> "lflags-osx-ldc": [ "-exported_symbols_list", "exports.lst", 
> "-dead_strip" ],

Thx that's really helpful.

I've hit a snag with LDC. After serveral hours of searching and 
reading I think it's coming down to sandboxing and needing to 
deploy libraries in a place that excel can find them.

The library DMD creates just references 
/usr/lib/libSystem.B.dylib and Excel can load my dylib.

LDC on the other hand additionally references:

@rpath/libphobos2-ldc-shared.95.dylib (compatibility version 
95.0.0, current version 2.0.95)
@rpath/libdruntime-ldc-shared.95.dylib (compatibility version 
95.0.0, current version 2.0.95)

So Excel complains that it can't load my library - presumably 
because libphobos2 and libdruntime are not in the sandbox.ly

Can anyone (either tell me how to fix this) or give me pointers 
pls? (I'm current reading up on DYLD_LIBRARY_PATH (shouldn't use 
that), sandboxing on Mac, and rpaths)

I suppose a solution that allows the additional libraries to be 
put in a subdirectory of my library would be idea as then I can 
deploy that within the sandbox.

Thx for the help


More information about the Digitalmars-d-learn mailing list