Page MenuHomePhabricator

[CMAKE] Add an option to enable/disable hardening
ClosedPublic

Authored by Fabien on Fri, Mar 8, 13:36.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC75fc67cefe02: [CMAKE] Add an option to enable/disable hardening
Summary

Tis mimics the --enable-hardening and --disable-hardening from
autotools. The default is to enable hardening.

Depends on D2653

Test Plan
mkdir buildcmake && cd buildcmake
cmake -GNinja ..
ninja -v

Check the -fPIE flags is added on the compile lines.
Check the -pie flag is added on the linker lines.

rm -rf *
cmake -GNinja .. -DENABLE_HARDENING=ON
ninja -v

Check the -fPIE flags is added on the compile lines.
Check the -pie flag is added on the linker lines.

rm -rf *
cmake -GNinja .. -DENABLE_HARDENING=OFF
ninja -v

Check the -fPIE flags is no longer on the compile lines.
Check the -pie flag is no longer on the linker lines.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Fri, Mar 8, 13:36
Herald added a reviewer: Restricted Project. · View Herald TranscriptFri, Mar 8, 13:36
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix accepted this revision.Fri, Mar 8, 21:25
This revision is now accepted and ready to land.Fri, Mar 8, 21:25
This revision was automatically updated to reflect the committed changes.