We're building a large C++ application on OS X Yosemite 10.10. This application relies on a number of third-party libraries which we install using Homebrew prior to building our application. Our release script picks up all the dependencies and include them in the final package.
Several of our users reported that our application didn't work on their Mac. For instance a user running macOS 10.12.6 on a late 2012 27-inch iMac is getting llegal instruction: 4
(all details here).
It looks like the crash occurs in one of the third-party dependency we bundle, OpenImageIO, which was installed on the build machine with the following commands:
brew tap homebrew/science
brew install openimageio
brew info openimageio
reports that it was indeed built from source:
/usr/local/Cellar/openimageio/1.7.17_1 (66 files, 16.0MB) *
Built from source on 2017-11-27 at 19:15:19
I suspect that Homebrew enables advanced x86 instruction sets when compiling on the build machine.
Here is the Homebrew formula for OpenImageIO:
https://github.com/Homebrew/homebrew-science/blob/master/openimageio.rb
Is there a way to find out which flags or which command lines Homebrew is using?
Alternatively, is there a way to globally set clang's default flags on macOS?
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) frame #0: 0x0000000100392f78 postgres`pg_comp_crc32c_sse42 + 20 postgres`pg_comp_crc32c_sse42: -> 0x100392f78 <+20>: crc32q (%rsi), %rax