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

[cmake] Add noexecstack to compiler/linker flags #3392

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

terrelln
Copy link
Contributor

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.

@terrelln terrelln merged commit 31a703e into facebook:dev Dec 22, 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)
Copy link

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?

Copy link
Contributor

@Cyan4973 Cyan4973 Dec 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @jaimeMF !

edit : fixed in 6640377

Cyan4973 added a commit that referenced this pull request Dec 23, 2022
@Cyan4973 Cyan4973 mentioned this pull request Feb 9, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test playTests fails on ppc64 (openSUSE Tumbleweed)
4 participants