Cannot compile project using BMI2 after updating to Xcode 12.2 - xcode

My computer auto-updated Xcode to 12.2 recently, and suddenly I couldn't compile code that is using Intel intrinsics (BMI2 in the case of this project). I got the error:
clang: error: the clang compiler does not support '-march=native'
But, of course it does support this, as it was working yesterday. Any idea what is going on and how to fix this?

Xcode 12.2 changed the default compiler settings. In their release notes they state:
Standard Architectures build setting defaults to Universal, and Xcode offers to upgrade your project if needed
Since Intel intrinsics are not supported on ARM, it will break your build if you are using them.
The solution is to go to your project build settings, show all settings, and then under architectures, add arm64 as an excluded architecture. Once this is done, everything should compile again. (Supporting ARM is a separate question.)

Related

XCode 12.0.1 and 12.1 Do not build universal applications

Using XCode 12.0.1 or 12.1 on MacOS 10.15.7 on a MacBook Pro, I cannot get my Mac OS application to compile for the arm64 architecture (i.e. make a Universal application). My project has evolved through many many many XCode versions, so I thought maybe it was corrupted somehow.
So, I created a new non-document-based app project in XCode. I then edited the scheme for Run to build for Release. The default build settings included the arm64 archtecture, and "Build Active Archtecture Only" set to NO for Release. I then set the tool bar scheme setting to buid for "Any Mac", built the project and looked at the build log. It built only for the x86_64 architecture.
Apple's documentaton says it should build for both architectures with these settings. What am I missing?
The problem is Apple's documentation, whoch clearly says XCode 12 builds universal. It does not, as of this writing, you MUST use the xcode 12 BETA.
I've had older Xcode-Projects that just wouldn't build universal binaries. It was due to a VALID_ARCHS user defined variable in one of the build settings (at the very bottom of the list). Once removed, universal binaries were created.

Loading OpenSSL dynamic libraries arm & x86 (FMX, C++)

I am able to use OpenSSL static libraries (libcrypto.a and libssl.a) in my iOS app thanks to this help. Now i can also use OpenSSL dynamic libraries (libcrypto.so and libssl.so) in my Android app version thanks to this info. I downloaded the files for Android in the OpenSSL_1.0.2g_Android.zip file from here. I just guessed and used the ARM files (armeabi-v7a folder) instead of the Intel files (x86 folder) and it worked on my Android test phone.
My question: How do I make an Android build that uses the correct library files on ARM devices AND also on Intel? I don't know how to deploy both sets of files for this. Below is snip of project window showing where i test added the second libcrytpo.so library file for x86.
But, this second libcrypto.so does not show up in the deployment window, only the first version i added (the ARM version) remains.
I was hoping i could somehow use compiler directives but maybe i just need 2 independent projects altogether? One built for Android ARM and other for Android x86? Further, all i'm needing in my code is an IdHTTP1->Get() so maybe their is a way i can use the built in BoringSSL fork? If so, how?
russ
C++Builder 10.3 Version 26.0.33219.4899
RAD Studio does not support producing Android apps for Intel, only for ARM, so don't even worry about trying to use the x86 libs on Android.
Also, Indy does not support BoringSSL at this time.

Intel Fortran Compiler in XCode 8.3.2

Did anyone try to add Intel Fortran Compiler to the latest XCode (version 8.3.2)? I can't find the compiler on the list. I tried to re-install the compiler entirely, linking it again to the XCode location, but nothing helped. Any idea why this happens? (I was also unable to run the simple code via terminal on Mac with the ifort command, seems like it can't link the libraries location, even though I updated the environmental variables)
The beta test compiler release notes do indicate that Xcode 8.2 is the latest supported version, as it is for the 2017u2 released compiler. Intention to offer an update 2 of the beta has been mentioned. Each minor update to Xcode apparently requires specific modifications and testing of Intel compilers.

How to Fix ChartBoost SDK 4.4 Error "libChartboost.a, missing required architecture x86_64"

After successfully integrating Chartboost SDK 4.2 into my Appstore published Apps, I'm encountering errors when upgrading to SDK 4.4 in Xcode: "libChartboost.a, missing required architecture x86_64". Currently the documentation at https://help.chartboost.com/documentation/ios is not yet updated for SDK 4.4.
While playing around with architectures (I'm not willing to remove "arm64" from my valid architectures as "arm64" worked fine with SDK 4.2, and I'd prefer to support 64-bit systems) am I left to conclude that SDK 4.4 does not support "arm64"?
Have tried re-installing SDK 4.4, and have cleaned build folder a few times. What am I missing? Thank you!
x86_64 is the architecture required for your Simulator not your devices, therefore, removing it doesn't affect your final product.
For more info :Arm64 architecture in xcode 5.1
Try changing your target simulator from x86_64 to x86. The 4.4 SDK should work with all devices (32 and 64 bits), but only with the 32 bits version of the simulator.
PS: A fix for this is on the way. Source: I work at Chartboost

SDL error in Xcode

I was trying to use SDL framework for jpg loading of opengl texture, but when i try to build i got this message:
ld: warning: in /Developer/SDKs/MacOSX10.5.sdk/Library/Frameworks//SDL.framework/SDL, missing required architecture ppc in file
What can i do to made SDL work in i386?
Have to download the source code and then make the file, or there is one already for i386?
The warning message says the version of the SDL framework on your machine is Intel-only, but you are building a universal (Intel and PowerPC) SDL application. The main Mac version of SDL 1.2.15 dropped PowerPC support. The simplest solution is to go to the SDL site and download the version of the SDL libraries that has support for PowerPC and Mac OS X 10.4.
Another solution is to modify the Architectures build setting in your project and tell Xcode to build for Intel only.

Resources