XMPPFramework icon indicating copy to clipboard operation
XMPPFramework copied to clipboard

Enable Bitcode = NO

Open nieyu opened this issue 8 years ago • 8 comments

I simply use Podfile below

platform :ios, '8.0' use_frameworks! pod 'MMXXMPPFramework', '~> 3.6.13'

to down the XMPPFramework.

And copied the framework to my test project through the six step.

Therefore, I've meet two trouble and had solved it.

And at the last, the project run perfect in simulator.

Then I tried a generic iOS device, iPhone 5s, it get a error, the description below

ld:'/Users/yunie/Documents/workSpace/TestProject/NewTestXMPP/NewTestXMPP/ThirdPart/MMXXMPPFramework/Vendor/libidn/libidn.a(stringprep.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

So I setted ENABLE_BITCODE = NO, the project run with no error.

What should I do while I need to set ENABLE_BITCODE = YES?

nieyu avatar Mar 03 '16 02:03 nieyu

You need to rebuild libidn.a. Look at build-libidn.sh, add OTHER_CFLAGS="-fembed-bitcode" into ./configure command and run it again. Hope that help

sahara108 avatar Mar 11 '16 05:03 sahara108

Hello, @sahara108! I am doing what you suggested, but receiving the following error in my bash:

default

I configured build script like so:

    ./configure --disable-shared --enable-static ${EXTRA_CONFIG} \
    --prefix="${INTERDIR}/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" \
    CC="${CCACHE}${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/usr/bin/gcc -arch ${ARCH}" \
    LDFLAGS="$LDFLAGS -L${OUTPUTDIR}/lib" \
    CFLAGS="$CFLAGS ${EXTRA_CFLAGS} -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk" \
    CPPFLAGS="$CPPFLAGS -I${OUTPUTDIR}/include -isysroot ${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}${SDKVERSION}.sdk"
    OTHER_CFLAGS="-fembed-bitcode"
    # Build the application and install it to the fake SDK intermediary dir
    # we have set up. Make sure to clean up afterward because we will re-use
    # this source tree to cross-compile other targets.
    make -j2
    make install
    make clean

What's wrong then? Thanks in advance!

efimovdk avatar Mar 25 '16 11:03 efimovdk

Xcode doesn't use gcc anymore. You need to change CC flag to use clang CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch ${ARCH}" \

sahara108 avatar Mar 25 '16 12:03 sahara108

@sahara108 I have changed compiler like you said, but the error is the same. It looks like it can't find some directory in archive that was downloaded

efimovdk avatar Mar 25 '16 12:03 efimovdk

Yes. It looks like the script get error when trying to download the library. You can manually download the source code and put it in Vendor/libidn/build/src and run the script again. Download link in the script: http://ftp.gnu.org/gnu/libidn/libidn-1.25.tar.gz

sahara108 avatar Mar 25 '16 13:03 sahara108

Hi @efimovdk @sahara108 Were you able to achieve libidn with bitcode enabled for arm64.

NishantTiwarins avatar Jan 17 '20 08:01 NishantTiwarins

Yes, I was able to compile and use it in my application. But too long ago, can't recall the detail

sahara108 avatar Jan 17 '20 08:01 sahara108

Hi @sahara108 Thanks for the early reply. If possible can you recall which command line tool you have used ? I am getting this error. configure: error: C compiler cannot create executables

NishantTiwarins avatar Jan 17 '20 09:01 NishantTiwarins