robbiehanson / XMPPFramework

An XMPP Framework in Objective-C for Mac and iOS
Other
5.91k stars 2.09k forks source link

Enable Bitcode = NO #689

Open nieyu opened 8 years ago

nieyu commented 8 years ago

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?

sahara108 commented 8 years ago

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

efimovdk commented 8 years ago

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!

sahara108 commented 8 years ago

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}" \

efimovdk commented 8 years ago

@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

sahara108 commented 8 years ago

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

NishantTiwarins commented 4 years ago

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

sahara108 commented 4 years ago

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

NishantTiwarins commented 4 years ago

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