Note: I originally wrote the blog post while installing mitmproxy on OS X Mavericks, but it is relevant to the “unknown argument” error in general, so keep reading.
Having a Mac laptop is like going on a journey every single day… My latest issue happened today while trying to install mitmproxy. Python’s pip was exiting with the following error:
clang: error: unknown argument: ‘-mno-fused-madd’ [-Wunused-command-line-argument-hard-error-in-future]
Well, it turns out that the latest (5.1) version of Xcode ships with a compiler that treats unknown passed parameters as errors. From the changelog:
The Apple LLVM compiler in Xcode 5.1 treats unrecognized command-line options as errors. This issue has been seen when building both Python native extensions and Ruby Gems, where some invalid compiler options are currently specified.
Projects using invalid compiler options will need to be changed to remove those options. To help ease that transition, the compiler will temporarily accept an option to downgrade the error to a warning:
-Wno-error=unused-command-line-argument-hard-error-in-future
Note: This option will not be supported in the future.
To workaround this issue, set the ARCHFLAGS environment variable to downgrade the error to a warning. For example, you can install a Python native extension with:
$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName
Similarly, you can install a Ruby Gem with:
$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName 16214764 updated
So, basically you can install mitmproxy (or any other program with a similar error) by:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install mitmproxy
Bear in mind that you if you need to combine the above with sudo, you will need to add it at the beginning of the command and not before “pip”. Otherwise you can also run the above logged in as root user from the start.
Pingback: Security-Vision » Installing mitmproxy on OS X Maverics or bypassing “clang: error: unknown argument”()
Pingback: OS X Mavericks: Bypassing “clang: error: unknown argument” | prokrastinix()
Pingback: Kippo attack heatmap in seconds using Kibana and Kippo2ElasticSearch - BruteForce Lab's Blog()
Pingback: suntoucher.de » Building Softcover on Mavericks (Softcover.io)()
Pingback: It's a pain when you have to work around things like this on a development m… « iandouglas.com()
Pingback: Fix clang: error: unknown argument: ‘-mno-fused-madd’ after updating Xcode 5.1 or above | San Luthra()