-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: correctly detect clang version #5553
Conversation
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL.
I install clang through homebrew -- think you have to potentially run both checks on darwin? |
@jbergstroem I didn't replace the original check (which would catch clang), instead I just added an "or" checking for Xcode after it, in your case I believe it will short circuit after the first check (for "clang version"). |
just skimmed it; python and indentation :) |
@@ -454,7 +454,7 @@ def get_llvm_version(cc): | |||
''' | |||
sys.exit() | |||
|
|||
match = re.search(r"(^clang version|based on LLVM) ([3-9]\.[0-9]+)", | |||
match = re.search(regexp, | |||
proc.communicate()[1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fits on one line now.
LGTM with style nits. CI: https://ci.nodejs.org/job/node-test-pull-request/1847/ |
@bnoordhuis Thanks. Updated to reflect your comments, I've tried to follow https://www.python.org/dev/peps/pep-0008/#indentation with respect to breaking the argument list. |
681f9f6
to
a25fd93
Compare
Thanks Stefan, landed in 1792470. |
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Does this need to land on v4.x also? |
Looks like it. I've added the tag. |
@jasnell @bnoordhuis Yep, it should, thanks! |
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Use the "Apple LLVM" version number since the banner has changed in newer versions of Mac OS X, resulting in the obsolete assembler path being used to compile OpenSSL. PR-URL: #5553 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Pull Request check-list
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)? Yes
test (or a benchmark) included? n/a
existing APIs, or introduces new ones)? n/a
Affected core subsystem(s)
build
Description of change
We provide our own build system on top of OpenSSL's, part of which is responsible for detecting support for newer assembly instructions (AVX2, etc). The optimized assembly is located in the deps/openssl/asm folder, whereas the fallback path is in deps/openssl/asm_obsolete.
The configuration script relies on scraping "cc -v" to obtain the LLVM version number on Mac OS X. However, as of Xcode 7 this information is no longer included in the banner, see here for a history of the banners: https://gist.github.com/yamaya/2924292
As a result, on systems with Xcode 7 OpenSSL will be compiled with the obsolete assembly path, regardless of actual hardware capability. I've resolved this issue by separately checking for the Xcode version. Note that there doesn't seem to be a way of obtaining the LLVM version, other than manually encoding it in a table such as this https://en.wikipedia.org/wiki/Xcode#Version_comparison_table. Storing this information is not reasonable for the config script, so verifying the Xcode version is a better way.
Note that both the get_llvm_version and get_xcode_version functions rely on minimum versions to return a match. Please see here for more details: #5550 (comment)
I've tested this change on Ubuntu 14.04 and Mac OS 10.11.3.