build: correctly detect clang version#5553
Closed
stefanmb wants to merge 2 commits intonodejs:masterfrom
Closed
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.
Member
|
I install clang through homebrew -- think you have to potentially run both checks on darwin? |
Contributor
Author
|
@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"). |
Member
|
just skimmed it; python and indentation :) |
Member
Contributor
Author
|
@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
Member
|
Thanks Stefan, landed in 1792470. |
bnoordhuis
pushed a commit
that referenced
this pull request
Mar 4, 2016
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 <[email protected]>
Member
|
Does this need to land on v4.x also? |
Member
|
Looks like it. I've added the tag. |
Contributor
Author
|
@jasnell @bnoordhuis Yep, it should, thanks! |
Merged
Fishrock123
pushed a commit
that referenced
this pull request
Mar 8, 2016
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 <[email protected]>
Fishrock123
pushed a commit
that referenced
this pull request
Mar 8, 2016
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 <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 17, 2016
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 <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 21, 2016
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 <[email protected]>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 21, 2016
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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.