summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0c04e10)
Necessary to detect cases like "(gcc test.c)".
# Remove everything until and including the compiler command. Makes
# checks easier and faster.
$line =~ s/^.*?$cc_regex//o;
# Remove everything until and including the compiler command. Makes
# checks easier and faster.
$line =~ s/^.*?$cc_regex//o;
+ # "([...] test.c)" is not detected as 'test.c' - fix this by removing
+ # the brace and similar characters.
+ $line =~ s/['")]+$//;
# Skip unnecessary tests when only preprocessing.
my $flag_preprocess = 0;
# Skip unnecessary tests when only preprocessing.
my $flag_preprocess = 0;
gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
gcc test.c -o test.output
gcc -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
gcc test.c -o test.output
+
+(gcc -Wl,-z,relro -o test.output test.c)
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-Wl,-z,relro): gcc test.c -o test.output
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-Wl,-z,relro): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
';
is_blhc 'bad-cflags', '--pie', 8,
'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
';
is_blhc 'bad-cflags', '--pie', 8,
'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c -o test.output
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-fPIE -pie): (gcc -Wl,-z,relro -o test.output test.c)
';
is_blhc 'bad-cflags', '--bindnow', 8,
'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
';
is_blhc 'bad-cflags', '--bindnow', 8,
'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
';
is_blhc 'bad-cflags', '--pie --bindnow', 8,
'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
';
is_blhc 'bad-cflags', '--pie --bindnow', 8,
'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc test.c -o test.output
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
+CFLAGS missing (-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
+CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
+LDFLAGS missing (-fPIE -pie -Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
';
is_blhc 'bad-cppflags', '', 8,
';
is_blhc 'bad-cppflags', '', 8,