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

set no-PIC no-PIE compile options explicitly #1075

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anzz1
Copy link
Contributor

@anzz1 anzz1 commented Jan 13, 2025

In some distros gcc is compiled with -fpic -pie as default, so clearing cxxflags is not enough to prevent PIC/PIE

  • set compile flags -fno-pic -fno-pie
  • set link flags -no-pie -Wl,--no-export-dynamic

for gcc in all CMakeLists explicitly

Also set -fno-strict-aliasing and -fno-strict-overflow.
Modern GCC no longer use these as default which will lead to bugs caused by wrong optimizations.

anzz1 added 2 commits January 13, 2025 05:58
in some distros gcc is compiled with -fpic -pie as default, so clearing cxxflags is not enough to prevent PIC/PIE
set compile flags '-fno-pic -fno-pie'
set link flags '-no-pie -Wl,--no-export-dynamic'
for gcc in all CMakeLists
Modern GCC no longer use these as default which will lead to bugs caused
by wrong optimizations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant