APP Store审核没通过,具体内容如下:
Dear developer,
Non-public API usage:
The app references non-public symbols in bandu: _getcontext, _makecontext, _setcontext
If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.
Regards,
The App Store team
经过分析查找定位到时应为openssl导致的问题;
我当前使用的openssl版本是:openssl-1.1.0c
# nm libcrypto.a | grep 'context'
0000000000000060 T _async_fibre_makecontext
U _getcontext
U _makecontext
U _async_fibre_makecontext
00000000000000b0 t _async_fibre_swapcontext
U _setcontext
0000000000000070 T _padlock_verify_context
然后源码查找getcontext,
# find ./crypto/async/ -name '*.*' | xargs grep 'getcontext'
./crypto/async//arch/async_posix.c: * Some platforms provide getcontext() but it does not work (notably
./crypto/async//arch/async_posix.c: * MacOSX PPC64). Check for a working getcontext();
./crypto/async//arch/async_posix.c: return getcontext(&ctx) == 0;
./crypto/async//arch/async_posix.c: if (getcontext(&fibre->fibre) == 0) {
定位到是在async_posix.c里面使用了这些函数。
分析crypto/async目录下的文件包含的布局及async_posix.h的内容:
#if (defined(OPENSSL_SYS_UNIX) || defined(OPENSSL_SYS_CYGWIN)) \
&& defined(OPENSSL_THREADS) && !defined(OPENSSL_NO_ASYNC) \
&& !defined(__ANDROID__) && !defined(__OpenBSD__)
发现一个宏定义:!defined(OPENSSL_NO_ASYNC) ,如果不使用异步功能,可以在编译的时候直接定义OPENSSL_NO_ASYNC
然后重新编译openssl
./Configure target no-shared -DOPENSSL_NO_ASYNC