I’ve a cocoapods library.
- This library has some C capabilities that I’ve uncovered globally:
#outline EXPORT __attribute__((visibility("default"), used, retain)) extern "C"
EXPORT void ios_prepare_request(const char *url) {
// some obj-c code
}
- Then internally a dylib is loaded. This dylib tries to name these capabilities.
- When run through Xcode, the whole lot is working.
- Nevertheless, once I bundle the app to TestFlight/Debugging deployment. There’s a stripping step that removes my international symbols. Due to this fact when I attempt to name any of the capabilities from the dylib in some unspecified time in the future it will get a null pointer reference and the app crashes.
- I have been making an attempt to get round this with the assistance of one of many apple engineers, his suggestion is to make use of a linker flag -export_symbols_list, however it doesn’t matter what I attempted it would not work.
- I’ve managed to get it working by disabled international stripping within the consumer goal xcconfig, however this clearly just isn’t best because it messes with the consumer goal.
s.user_target_xcconfig = {
'STRIP_STYLE' => 'non-global'
}
- By default cocoapods creates a static lib, so export_symbol_list will not work as it’s meant for dylibs, I attempted to unravel this by turning the lib right into a dynamic framework
s.static_framework = false
s.preserve_paths="exports.exp"
s.pod_target_xcconfig= {
# 'OTHER_LDFLAGS' => '$(inherited) -Wl,-exported_symbols_list,$(PODS_TARGET_SRCROOT)/exports.exp',
}
- With the default config an a static lib, claude suggests utilizing a
-u
flag and passing every image I must preserve alive, however this additionally doesn’t work
s.user_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -Wl,-u,_ios_prepare_request'
}
At this level I am out of concepts find out how to forestall the worldwide symbols from being stripped. Sooner or later I attempted passing the capabilities in a initialization perform however by some means they had been nonetheless being stripped.
Any recommendations what might work?