[cfe-dev] Can't use -Wa,--noexecstack with -fembed-bitcode

Ian Spence via cfe-dev cfe-dev at lists.llvm.org
Sat Jul 7 17:05:10 PDT 2018


Hello

I'm trying to compile OpenSSL 1.1.1-pre8 for iOS (arm64). This
questions may be better suited for the OpenSSL team, however the
specific problem I'm having is with Clang. I would like to enable
bitcode when compiling OpenSSL so my app can also benifit from the
reduced binary size, however I can't seem to figure out how to enable
bitcode as there's a conflicting argument that OpenSSL provides
"-Wa,--noexecstack"

The specific error I'm seeing is: "clang: error: -Wa, is not supported
with -fembed-bitcode"

The full command is (from output of "make -j4")

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
 -I. -Iinclude -fPIC -arch armv7 -mios-version-min=6.0.0 -fno-common
-Wa,--noexecstack -Qunused-arguments -arch armv7s -pipe -Os -gdwarf-2
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk
-miphoneos-version-min=9.3 -fembed-bitcode -DOPENSSL_PIC
-DOPENSSL_CPUID_OBJ -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m
-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DAES_ASM
-DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPOLY1305_ASM
-DOPENSSLDIR="\"/usr/local/ssl\""
-DENGINESDIR="\"/usr/local/lib/engines-1.1\"" -D_REENTRANT -DNDEBUG
-MMD -MF apps/app_rand.d.tmp -MT apps/app_rand.o -c -o apps/app_rand.o
apps/app_rand.c

As I'm building a shared library I don't want to remove the
"-Wa,--noexecstack" option, but I can't seem to find another way to
tell Clang to embed bitcode. What am I missing here?

Thanks,

- Ian



More information about the cfe-dev mailing list