Segfault on iOS Simulator (x86_64)

Cameron G <[email protected]> Wed, 21 Sep 2022 00:41:53 -0700 (PDT)
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <[email protected]>
Hi, I'm receiving a segfault on iOS Simulator (x86_64) in some trivial code 
that works on other platforms. I think I may have built the library 
incorrectly, but I followed the wiki instructions and tried various 
combinations. The segfault happens when declaring

CryptoPP::AutoSeededRandomPool rng;

The stack frame is
[image: Screen Shot 2022-09-21 at 3.29.55 PM.png]

Here's how I built the library:

IOS_SDK=iPhoneSimulator IOS_CPU=x86_64 source ./setenv-ios.sh
Configuring for iPhoneSimulator (x86_64)
XCODE_TOOLCHAIN: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/
IOS_SDK: iPhoneSimulator
IOS_CPU: x86_64
IOS_CPPFLAGS:  -DCRYPTOPP_DISABLE_ASM
IOS_CFLAGS: -arch x86_64 -miphonesimulator-version-min=6 -fno-common
IOS_CXXFLAGS: -arch x86_64 -miphonesimulator-version-min=6 -stdlib=libc++ 
-fno-common
IOS_SYSROOT: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk

*******************************************************************************
It looks the the environment is set correctly. Your next step is build
the library with 'make -f GNUmakefile-cross'.
*******************************************************************************

Then, I ran 'make -f GNUmakefile-cross' :
Here's what we found... IS_X86: 0, IS_X64: 1, IS_ARM32: 0, IS_ARMV8: 0
Using testing flags: -g2 -O3 -fPIC -arch x86_64 
-miphonesimulator-version-min=6 -stdlib=libc++ -fno-common --sysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk

clang++ -DCRYPTOPP_DISABLE_ASM -isysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk 
-Wall -g2 -O3 -fPIC -arch x86_64 -miphonesimulator-version-min=6 
-stdlib=libc++ -fno-common --sysroot 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.5.sdk 
-Wall -c cryptlib.cpp

Most of the simulators use x86_64 now - especially iPhone ones, so that's 
why I'm compiling for that architecture.

Thanks for any help!
Cameron

-- 
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/91d650e2-5da6-47cf-96f2-f3829afc30d1n%40googlegroups.com.
Screen Shot 2022-09-21 at 3.29.55 PM.png (image/png, 168.2 KB) - not displayed