简体   繁体   中英

how to compile openssl with fvisibility=hidden flag for iOS

I need to compile the openssl code with -fvisibility=hidden to hide the large number of symbols and then use in Xcode. Using below GitHub link.. I'm able get the libssl.a and libcrypto.a but there is no option I can see the build-libssl.sh (shell script) to add option "-fvisibility=hidden".

https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh

I did try adding "-fvisibility=hidden" in "Other C Flags" in Build Settings in Xcode but does not seem to work. Hence please suggest for this issue.

as per the GitHub link mentioned, go to scripts folder -> build-loop-archs.sh and then edit this file "build-loop-archs.sh" and replace the "-fembed-bitcode" with "-fvisibility=hidden" and then save it and run the script. It will work.

Embed bitcode for SDK >= 9

 if [ "${CONFIG_DISABLE_BITCODE}" != "true" ]; then
    if [[ "${SDKVERSION}" == 9.* || "${SDKVERSION}" == [0-9][0-9].* ]]; then
      LOCAL_CONFIG_OPTIONS="${LOCAL_CONFIG_OPTIONS} -fvisibility=hidden"
    fi
  fi

https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM