\s
\S+ # Filename without extension.
\.
- ([^\\.\s]+) # File extension.
+ ([^\\.,;:\s]+) # File extension.
(?=\s|\\) # At end of word. Can't use \b because some files have non
# word characters at the end and because \b matches double
# extensions (like .cpp.o). Works always as all lines are
}
# Ignore lines with no compiler commands.
- next if $line !~ /\b$cc_regex(?:\s|\\)/o and not $non_verbose;
+ next if not $non_verbose
+ and not $line =~ /\b$cc_regex(?:\s|\\)/o;
+ # Ignore lines with no filenames with extensions. May miss
+ # some non-verbose builds (e.g. "gcc -o test" [sic!]), but
+ # shouldn't be a problem as the log will most likely contain
+ # other non-verbose commands which are detected.
+ next if not $non_verbose
+ and not $line =~ /$file_extension_regex/o;
# Ignore false positives.
#
# `./configure` output.
next if not $non_verbose
and $line =~ /^(?:checking|(?:C|c)onfigure:) /;
- next if $line =~ /^\s*(?:Host\s+)?(?:C\s+)?
- (?:C|c)ompiler[\s.]*:?\s+
- $cc_regex_full
- (?:\s-std=[a-z0-9:+]+)?\s*$
- /xo
- or $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o
- or $line =~ /^\s*-- Check for working (?:C|CXX) compiler: /
- or $line =~ /^\s*(?:echo )?Using [A-Z_]+\s*=\s*/;
- # `make` output.
- next if $line =~ /^Making [a-z]+ in \S+/; # e.g. "[...] in c++"
+ next if $line =~ /^\s*(?:- )?(?:HOST_)?(?:CC|CXX)\s*=\s*$cc_regex_full\s*$/o;
# Check if additional hardening options were used. Used to
# ensure they are used for the complete build.
Compiler: s390x-linux-gnu-gcc
Compiler: sparc-linux-gnu-gcc
+ C++ Compiler...: g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -D_FORTIFY_SOURCE=2
+
- General Compile FLAGS
- CC = mpicc
- CXX = g++
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Check for working CXX compiler: /usr/bin/c++ -- works
+-- Use g++ visibility support..... YES
+
+ setting CPP to "sparc-linux-gnu-gcc -E"
+
+Looking for compiler... gcc is executable.
+Looking for compiler... cc is executable.
configure: using CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC
configure: using LDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--as-needed
echo Using LDFLAGS="-Wl,-z,relro -Wl,--as-needed -fPIE -pie -Wall"
Using LDFLAGS=-Wl,-z,relro -Wl,--as-needed -fPIE -pie -Wall
++ CC=cc CFLAGS=-g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -Wformat LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed
+
CC = cc
CC=gcc
gcc -E -D_FORTIFY_SOURCE=2 test.c
gcc -Wl,-z,relro -o test test.cpp.o
+
+command --cc test
Making all in c++
Making install in c++
+
+make CC="gcc -Wall -Wextra" CFLAGS="-fPIE"
+
+CC=gcc /usr/bin/program
+
+/usr/bin/make CC=g++ DBGFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wl,-z,relro -Wl,--as-needed"
use strict;
use warnings;
-use Test::More tests => 102;
+use Test::More tests => 104;
sub is_blhc {
'W-compiler-flags-hidden 1 (of 5) hidden
';
+is_blhc 'make', '--buildd', 1,
+ 'W-no-compiler-commands
+';
+
# multiple files