our $VERSION = '0.01';
+# CONSTANTS/VARIABLES
+
+# Regex to catch compiler commands.
+my $cc_regex = qr/(?:x86_64-linux-gnu-)?(?:(?<!\.)cc|gcc|g\+\+|c\+\+)(?:-[\d.]+)?/;
+# Regex to catch (GCC) compiler warnings.
+my $warning_regex = qr/^(.+?):([0-9]+):[0-9]+: warning: (.+?) \[(.+?)\]$/;
+
+# Expected hardening flags. All flags are used as regexps.
+my @cflags = (
+ '-g',
+ '-O2',
+ '-fstack-protector',
+ '--param=ssp-buffer-size=4',
+ '-Wformat',
+ '-Wformat-security',
+ '-Werror=format-security',
+);
+my @cflags_pie = (
+ '-fPIE',
+);
+my @cppflags = (
+ '-D_FORTIFY_SOURCE=2',
+);
+my @ldflags = (
+ '-Wl,(-z,)?relro',
+);
+my @ldflags_pie = (
+ '-fPIE',
+ '-pie',
+);
+my @ldflags_bindnow = (
+ '-Wl,(-z,)?now',
+);
+# All (hardening) flags.
+my @flags = (@cflags, @cflags_pie,
+ @cppflags,
+ @ldflags, @ldflags_pie, @ldflags_bindnow);
+# Renaming rules for the output so the regex parts are not visible.
+my %flag_renames = (
+ '-Wl,(-z,)?relro' => '-Wl,-z,relro',
+ '-Wl,(-z,)?now' => '-Wl,-z,now',
+);
+
+
# FUNCTIONS
sub error_flags {
}
-# CONSTANTS/VARIABLES
-
-# Regex to catch compiler commands.
-my $cc_regex = qr/(?:x86_64-linux-gnu-)?(?:(?<!\.)cc|gcc|g\+\+|c\+\+)(?:-[\d.]+)?/;
-# Regex to catch (GCC) compiler warnings.
-my $warning_regex = qr/^(.+?):([0-9]+):[0-9]+: warning: (.+?) \[(.+?)\]$/;
-
-# Expected hardening flags. All flags are used as regexps.
-my @cflags = (
- '-g',
- '-O2',
- '-fstack-protector',
- '--param=ssp-buffer-size=4',
- '-Wformat',
- '-Wformat-security',
- '-Werror=format-security',
-);
-my @cflags_pie = (
- '-fPIE',
-);
-my @cppflags = (
- '-D_FORTIFY_SOURCE=2',
-);
-my @ldflags = (
- '-Wl,(-z,)?relro',
-);
-my @ldflags_pie = (
- '-fPIE',
- '-pie',
-);
-my @ldflags_bindnow = (
- '-Wl,(-z,)?now',
-);
-# All (hardening) flags.
-my @flags = (@cflags, @cflags_pie,
- @cppflags,
- @ldflags, @ldflags_pie, @ldflags_bindnow);
-# Renaming rules for the output so the regex parts are not visible.
-my %flag_renames = (
- '-Wl,(-z,)?relro' => '-Wl,-z,relro',
- '-Wl,(-z,)?now' => '-Wl,-z,now',
-);
-
-
# MAIN
# Additional hardening options.