This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PA-6383) Enable PIE for RHEL,Ubuntu and Debian
(PA-6383) Exclude ppc64 architecture (PA-6383) Fix Spaces (PA-6383) Exclude ppc64 arch (PA-6383) created compiler setting separately (PA-6383) Changes to runtime-bolt
- Loading branch information
Showing
7 changed files
with
34 additions
and
22 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
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
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
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
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
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
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,24 @@ | ||
# Define default CFLAGS and LDFLAGS for most platforms, and then | ||
# tweak or adjust them as needed. | ||
proj.setting(:cppflags, "-I#{proj.includedir} -I/opt/pl-build-tools/include") | ||
proj.setting(:cflags, "#{proj.cppflags}") | ||
proj.setting(:ldflags, "-L#{proj.libdir} -L/opt/pl-build-tools/lib -Wl,-rpath=#{proj.libdir}") | ||
|
||
# Platform specific overrides or settings, which may override the defaults | ||
|
||
# Harden Linux ELF binaries by compiling with PIE (Position Independent Executables) support, | ||
# stack canary and full RELRO. | ||
# We only do this on platforms that use their default OS toolchain since pl-gcc versions | ||
# are too old to support these flags. | ||
|
||
if((platform.is_sles? && platform.os_version.to_i >= 15) || | ||
(platform.is_el? && platform.os_version.to_i >= 8 && platform.architecture !~ /ppc64/) || | ||
(platform.is_debian? && platform.os_version.to_i >= 10) || | ||
(platform.is_ubuntu? && platform.os_version.to_i >= 20) || | ||
platform.is_fedora? | ||
) | ||
proj.setting(:supports_pie, true) | ||
proj.setting(:cppflags, "-I#{proj.includedir} -D_FORTIFY_SOURCE=2") | ||
proj.setting(:cflags, '-fstack-protector-strong -fno-plt -O2') | ||
proj.setting(:ldflags, "-L#{proj.libdir} -Wl,-rpath=#{proj.libdir},-z,relro,-z,now") | ||
end |