Skip to content
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

crypto/sha256: Use pragmas to enforce necessary intrinsics for GCC and Clang #13789

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@luke-jr
Copy link
Member

@luke-jr luke-jr commented Jul 28, 2018

This avoids problems when the user specifies CXXFLAGS explicitly disabling the relevant optimisations.

Partially fixes #13758, only for GCC/Clang.

NOTE: src/leveldb/port/port_posix_sse.cc has the same issue (only with our build system?), which is NOT addressed here.

@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Jul 28, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@luke-jr luke-jr force-pushed the luke-jr:bugfix_asm_pragmas branch 2 times, most recently to 8bca9cd Jul 29, 2018
@MarcoFalke MarcoFalke added this to the 0.17.0 milestone Jul 30, 2018
@laanwj
Copy link
Member

@laanwj laanwj commented Jul 31, 2018

Not sure this is the right way to go about it. IMO passing the correct compilation flags is something that needs to be fixed in the build system, not worked around with compiler-specific pragmas in the code.

@sipa
Copy link
Member

@sipa sipa commented Jul 31, 2018

crypto/sha256_sse4.cpp doesn't actually need this, as it's written using inline assembly rather than compiler intrinsics. The assembly is passed through to the assembler without the compiler interpreting or understanding.

@MarcoFalke MarcoFalke removed this from the 0.17.0 milestone Aug 4, 2018
@MarcoFalke
Copy link
Member

@MarcoFalke MarcoFalke commented Apr 8, 2019

@luke-jr Is this still relevant after the recent discussion?

@DrahtBot DrahtBot closed this Apr 28, 2019
@DrahtBot DrahtBot reopened this Apr 28, 2019
@DrahtBot DrahtBot closed this Mar 9, 2020
@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Mar 9, 2020

The last travis run for this pull request was 316 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.
@DrahtBot
Copy link
Contributor

@DrahtBot DrahtBot commented Apr 22, 2020

🐙 This pull request conflicts with the target branch and needs rebase.

@luke-jr luke-jr force-pushed the luke-jr:bugfix_asm_pragmas branch from 8bca9cd to 8072690 May 14, 2020
@luke-jr
Copy link
Member Author

@luke-jr luke-jr commented May 14, 2020

I haven't seen anything that would make this irrelevant.

Rebased

@sipa
Copy link
Member

@sipa sipa commented May 14, 2020

Concept ACK, I think this is cleaner than doing it in the build system, actually. Maybe it makes sense to add a macro in a util/ file so no compiler-specific code is needed here.

sha256_sse4.cpp does not need this, as it's written using inline assembly, not intrinsics.

…d Clang

This avoids problems when the user specifies CXXFLAGS explicitly disabling the relevant optimisations.
@luke-jr luke-jr force-pushed the luke-jr:bugfix_asm_pragmas branch from 8072690 to 14337d0 May 14, 2020
@luke-jr
Copy link
Member Author

@luke-jr luke-jr commented May 14, 2020

sha256_sse4.cpp does not need this, as it's written using inline assembly, not intrinsics.

Confirmed with -mno-sse4 and fixed/removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

6 participants