Hi,

With xcode 7, bitcode is enabled by default and in order to have a project 
built, all third party libraries need to have bitcode included as well. I 
am trying build protobuf with bitcode. Normally, it should be able to 
compile with bitcode by including -fembed-bitcode in CFLAGS. However, I 
received the following linker error:

libtool: link: clang -D_THREAD_SAFE -Wall -Wwrite-strings 
-Woverloaded-virtual -Wno-sign-compare -Wno-unused-local-typedef 
-Wno-unused-function -DNDEBUG -g -O0 -pipe -fPIC -fcxx-exceptions 
-fembed-bitcode -std=c++11 -stdlib=libc++ -miphoneos-version-min=8.3 -arch 
armv7s -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk
 
-D_THREAD_SAFE -arch armv7s -miphoneos-version-min=8.3 -stdlib=libc++ -o 
protoc google/protobuf/compiler/main.o -Wl,-bind_at_load  
./.libs/libprotobuf.a ./.libs/libprotoc.a 
/tmp/protobuf/src/.libs/libprotobuf.a -lz -lc++ -lc++abi

ld: -bind_at_load and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) 
cannot be used together

clang: error: linker command failed with exit code 1 (use -v to see 
invocation)


Here is the configure command that I ran:


*./configure --build=x86_64-apple-darwin14.0.0 
--host=armv7s-apple-darwin14.0.0 --with-protoc=[link-to-protoc] 
--disable-shared --prefix=[my-prefix] --exec-prefix=[my-prefix] CC=clang 
CFLAGS="-Wno-unused-local-typedef -Wno-unused-function -DNDEBUG -g -O0 
-pipe -fPIC -fcxx-exceptions -fembed-bitcode -miphoneos-version-min=8.3 
-arch armv7s -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk"
 
CXX=clang CXXFLAGS="-Wno-unused-local-typedef -Wno-unused-function -DNDEBUG 
-g -O0 -pipe -fPIC -fcxx-exceptions -fembed-bitcode -std=c++11 
-stdlib=libc++ -miphoneos-version-min=8.3 -arch armv7s -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk"
 
LDFLAGS="-arch armv7s -miphoneos-version-min=8.3 -stdlib=libc++" 
LIBS="-lc++ -lc++abi"*


I would love to know if there is anything I can do to get around the error 
or do you plan to support bitcode anytime soon?


Thanks,
Ken

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to