-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[cmake] Add noexecstack to compiler/linker flags #3392
Merged
Merged
Conversation
This file contains 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
Cyan4973
approved these changes
Dec 21, 2022
jaimeMF
reviewed
Dec 23, 2022
@@ -30,33 +38,39 @@ macro(ADD_ZSTD_COMPILATION_FLAGS) | |||
# EnableCompilerFlag("-std=c99" true false) # Set C compiation to c99 standard | |||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND MSVC) | |||
# clang-cl normally maps -Wall to -Weverything. | |||
EnableCompilerFlag("/clang:-Wall" true true) | |||
EnableCompilerFlag("/clang:-Wall" true true flase) |
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.
Shouldn't it be false
instead of flase
?
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.
Cyan4973
added a commit
that referenced
this pull request
Dec 23, 2022
reported by @jaimeMF in #3392 (comment)
Merged
kou
added a commit
to kou/zstd
that referenced
this pull request
Feb 14, 2023
fix facebook#3500 CMake 3.18 or later was required by facebook#3392. Because it uses `CheckLinkerFlag`. But requiring CMake 3.18 or later is a bit aggressive. Because Ubuntu 20.04 LTS still uses CMake 3.16.3: https://packages.ubuntu.com/search?keywords=cmake This change disables `-z noexecstack` check with old CMake. This will not break any existing users. Because users who need `-z nonexecstack` must already use CMake 3.18 or later.
kou
added a commit
to kou/zstd
that referenced
this pull request
Feb 14, 2023
fix facebook#3500 CMake 3.18 or later was required by facebook#3392. Because it uses `CheckLinkerFlag`. But requiring CMake 3.18 or later is a bit aggressive. Because Ubuntu 20.04 LTS still uses CMake 3.16.3: https://packages.ubuntu.com/search?keywords=cmake This change disables `-z noexecstack` check with old CMake. This will not break any existing users. Because users who need `-z noexecstack` must already use CMake 3.18 or later.
kou
added a commit
to kou/zstd
that referenced
this pull request
Feb 15, 2023
fix facebook#3500 CMake 3.18 or later was required by facebook#3392. Because it uses `CheckLinkerFlag`. But requiring CMake 3.18 or later is a bit aggressive. Because Ubuntu 20.04 LTS still uses CMake 3.16.3: https://packages.ubuntu.com/search?keywords=cmake This change disables `-z noexecstack` check with old CMake. This will not break any existing users. Because users who need `-z noexecstack` must already use CMake 3.18 or later.
terrelln
pushed a commit
that referenced
this pull request
Feb 16, 2023
fix #3500 CMake 3.18 or later was required by #3392. Because it uses `CheckLinkerFlag`. But requiring CMake 3.18 or later is a bit aggressive. Because Ubuntu 20.04 LTS still uses CMake 3.16.3: https://packages.ubuntu.com/search?keywords=cmake This change disables `-z noexecstack` check with old CMake. This will not break any existing users. Because users who need `-z noexecstack` must already use CMake 3.18 or later.
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.
Add
noexecstack
cflags and ldflags to cmake. We already use these flags in our Makefile starting in PR #2964.This is needed to pass PPC64 tests with ELFv1, because gcc will omit this note by default, unless the noexecstack flags are passed. That means that zstd on ppc64 wasn't broken before this PR, just our test was. This makes cmake a bit more zealous in setting noexecstack.
Fixes #3125.