Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add USES=elfctl to change an ELF binary's feature control note. Example: USES= elfctl ELF_FEATURES= +noaslr,wxneeded:foo Reported by: emaste Approved by: brooks, tcberner (portmgr) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34125
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Change an ELF binary's feature control note | ||
# | ||
# Feature: elfctl | ||
# Usage: USES=elfctl | ||
# Valid ARGS: none | ||
# | ||
# Variables | ||
# | ||
# ELF_FEATURES= featurelist:path/to/file1 \ | ||
# featurelist:path/to/file1 \ | ||
featurelist:path/to/file2 | ||
# | ||
# The file paths listed in ELF_FEATURES are relative to ${BUILD_WRKSRC}. | ||
# | ||
|
||
.if !defined(_INCLUDE_USES_ELFCTL_MK) | ||
_INCLUDE_USES_ELFCTL_MK= yes | ||
|
||
. if ! empty(ELF_FEATURES) | ||
_USES_build+= 720:elfctl-post-build | ||
elfctl-post-build: | ||
. for feat in ${ELF_FEATURES} | ||
${ELFCTL} -i -e ${feat:C/:.*//} ${BUILD_WRKSRC}/${feat:C/.*://} | ||
. endfor | ||
. endif | ||
|
||
.endif |
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