3 # Copyright (C) 2012-2015 Simon Ruderich
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 use Test::More tests => 216;
26 my ($file, $options, $exit, $expected) = @_;
28 # Multiple files as array references.
29 if (ref $file eq 'ARRAY') {
30 local $" = ' ./t/logs/';
34 $file = "./t/logs/$file" if $file;
35 my $output = `./bin/blhc $options $file 2>&1`;
38 $options = ' '. $options;
40 is $? >> 8, $exit, "$file$options (exit code)";
41 # Perform regex or string match.
42 my $cmd = (ref $expected eq 'Regexp')
45 &$cmd($output, $expected, "$file$options (output)");
49 # Usage, invalid arguments.
53 blhc [*options*] *<dpkg-buildpackage build log file>..*
56 is_blhc '', '--invalid', 2,
57 "Unknown option: invalid\n"
63 is_blhc '', '--version', 0,
64 'blhc 0.05 Copyright (C) 2012-2015 Simon Ruderich
66 This program is free software: you can redistribute it and/or modify
67 it under the terms of the GNU General Public License as published by
68 the Free Software Foundation, either version 3 of the License, or
69 (at your option) any later version.
71 This program is distributed in the hope that it will be useful,
72 but WITHOUT ANY WARRANTY; without even the implied warranty of
73 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
74 GNU General Public License for more details.
76 You should have received a copy of the GNU General Public License
77 along with this program. If not, see <http://www.gnu.org/licenses/>.
80 is_blhc '', '--help', 1,
82 blhc \[\*options\*\] \*<dpkg-buildpackage build log file>\.\.\*
87 is_blhc 'doesnt-exist', '', 2,
88 qr{^No such file: \./t/logs/doesnt-exist at \./bin/blhc line \d+\.$};
91 # No compiler commands found.
93 my $empty = "No compiler commands!\n";
94 is_blhc 'empty', '', 1,
98 # ANSI colored output.
100 is_blhc 'arch-avr32', '--color', 8,
101 "\033[31mCFLAGS missing\033[0m (-fstack-protector-strong)\033[33m:\033[0m gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
105 # Ignore missing compiler flags.
107 is_blhc 'ignore-flag', '--ignore-flag -g', 8,
108 'CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
111 is_blhc 'ignore-flag', '--ignore-flag -g --ignore-flag -O2', 0,
114 is_blhc 'ignore-flag-ldflags', '--ignore-flag -fPIE', 0,
117 # Ignore missing compiler flags for specific architectures.
120 is_blhc 'ignore-flag', '--ignore-arch-flag -g', 2,
121 'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)
123 blhc [*options*] *<dpkg-buildpackage build log file>..*
126 is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2,
127 'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)
129 blhc [*options*] *<dpkg-buildpackage build log file>..*
132 is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
133 'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
135 blhc [*options*] *<dpkg-buildpackage build log file>..*
139 # Wrong architecture.
140 is_blhc 'ignore-flag', '--ignore-arch-flag amd64:-g', 8,
141 'CFLAGS missing (-g): gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
142 CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
145 is_blhc 'arch-i386', '--ignore-arch-flag i386:-fstack-protector-strong', 8,
146 'LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
148 is_blhc 'arch-i386', '--ignore-arch-flag i386:-pie', 8,
149 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
151 is_blhc 'arch-i386', '--ignore-arch-flag i386:-fstack-protector-strong --ignore-arch-flag i386:-pie', 0,
154 # Wrong architecture.
155 is_blhc 'arch-i386', '--ignore-arch-flag amd64:-fstack-protector-strong', 8,
156 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
157 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
159 is_blhc 'arch-i386', '--ignore-arch-flag amd64:-pie', 8,
160 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
161 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
163 is_blhc 'arch-i386', '--ignore-arch-flag amd64:-fstack-protector-strong --ignore-arch-flag amd64:-pie', 8,
164 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
165 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
169 # Ignore certain lines.
171 is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c"', 8,
172 'CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
173 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
174 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
177 is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c" --ignore-line "\s*\./prepare-script gcc test-[a-z]\.c .+"', 0,
180 # Ignore certain lines for specific architectures.
183 is_blhc 'ignore-line', '--ignore-arch-line .+', 2,
184 'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)
186 blhc [*options*] *<dpkg-buildpackage build log file>..*
189 is_blhc 'ignore-line', '--ignore-arch-line .+:', 2,
190 'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)
192 blhc [*options*] *<dpkg-buildpackage build log file>..*
195 is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
196 'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
198 blhc [*options*] *<dpkg-buildpackage build log file>..*
202 # Wrong architecture.
203 is_blhc 'ignore-line', '--ignore-arch-line "amd64:.+"', 8,
204 'CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
205 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
206 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
207 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c
208 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c
209 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c
210 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-b.c
211 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-b.c
212 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-b.c
213 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-c.c
214 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-c.c
215 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-c.c
218 # Line regex anchored at beginning/end of the line.
219 is_blhc 'arch-i386', '--ignore-arch-line "i386:-fPIE"', 8,
220 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
221 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
224 is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -fPIE .+ test\.c"', 8,
225 'LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
227 is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
228 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
230 is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -fPIE .+ test\.c" --ignore-arch-line "i386:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 0,
233 # Wrong architecture.
234 is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -fPIE .+ test\.c"', 8,
235 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
236 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
238 is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
239 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
240 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
242 is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -fPIE .+ test\.c" --ignore-arch-line "amd64:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
243 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
244 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
248 # Correct build logs.
250 is_blhc 'good', '', 0,
252 is_blhc 'good-pie', '', 0,
254 is_blhc 'good-pie', '--pie', 0,
256 is_blhc 'good-bindnow', '', 0,
258 is_blhc 'good-bindnow', '--bindnow', 0,
260 is_blhc 'good-all', '', 0,
262 is_blhc 'good-all', '--all', 0,
264 is_blhc 'good-all', '--pie --bindnow', 0,
267 is_blhc 'good-multiline', '', 0,
269 is_blhc 'good-library', '--all', 0,
273 # Build logs with missing flags.
275 is_blhc 'bad', '', 8,
276 'CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
277 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
278 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
279 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
280 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
281 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
282 LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
283 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
284 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
285 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
286 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
287 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
288 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
289 LDFLAGS missing (-Wl,-z,relro): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
290 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
291 LDFLAGS missing (-Wl,-z,relro): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
292 LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
293 LDFLAGS missing (-Wl,-z,relro): g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
294 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
295 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
296 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
297 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
298 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
299 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
300 LDFLAGS missing (-Wl,-z,relro): gcc test.c
301 CXXFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
302 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
303 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
304 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
305 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
306 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
307 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
308 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
309 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
310 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
312 is_blhc 'bad', '--pie', 8,
313 'CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
314 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
315 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
316 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
317 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
318 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
319 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
320 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
321 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
322 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
323 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
324 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
325 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
326 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
327 CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
328 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
329 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
330 LDFLAGS missing (-fPIE -pie): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
331 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
332 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
333 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
334 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
335 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
336 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
337 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
338 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
339 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c
340 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
341 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
342 LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
343 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
344 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
345 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
346 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
347 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
348 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
349 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
350 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
352 is_blhc 'bad', '--bindnow', 8,
353 'CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
354 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
355 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
356 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
357 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
358 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
359 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
360 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
361 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
362 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
363 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
364 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
365 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
366 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
367 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
368 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
369 LDFLAGS missing (-Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
370 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
371 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
372 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
373 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
374 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
375 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
376 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
377 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
378 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c
379 CXXFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
380 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
381 LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
382 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
383 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
384 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
385 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
386 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
387 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
388 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
389 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
391 my $bad_pie_bindnow =
392 'CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
393 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
394 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
395 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
396 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
397 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
398 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
399 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
400 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
401 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
402 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
403 CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
404 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
405 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
406 CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
407 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
408 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
409 LDFLAGS missing (-fPIE -pie -Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro -o ../src/test/bin/test ../src/test/objs/test.o
410 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
411 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
412 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
413 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
414 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
415 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
416 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
417 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
418 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c
419 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
420 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
421 LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
422 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
423 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
424 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
425 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
426 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
427 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
428 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
429 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
431 is_blhc 'bad', '--pie --bindnow', 8,
433 is_blhc 'bad', '--all', 8,
436 is_blhc 'bad-cflags', '', 8,
437 'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
438 CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
439 CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
440 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
441 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
442 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
443 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
444 CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
445 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c -o test.output
446 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
447 LDFLAGS missing (-Wl,-z,relro): gcc test.c -o test.output
448 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
449 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
451 is_blhc 'bad-cflags', '--pie', 8,
452 'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
453 CFLAGS missing (-fPIE -fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
454 CFLAGS missing (-fPIE -Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
455 LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
456 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
457 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
458 LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test.c -ltest
459 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
460 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
461 CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
462 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c -o test.output
463 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
464 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c -o test.output
465 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
466 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
467 LDFLAGS missing (-fPIE -pie): (gcc -Wl,-z,relro -o test.output test.c)
469 is_blhc 'bad-cflags', '--bindnow', 8,
470 'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
471 CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
472 CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
473 LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
474 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
475 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
476 LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test.c -ltest
477 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
478 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
479 LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
480 CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
481 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c -o test.output
482 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
483 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
484 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
485 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
486 LDFLAGS missing (-Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
488 is_blhc 'bad-cflags', '--pie --bindnow', 8,
489 'CFLAGS missing (-fPIE -Wformat): gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
490 CFLAGS missing (-fPIE -fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
491 CFLAGS missing (-fPIE -Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
492 LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
493 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
494 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
495 LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test.c -ltest
496 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
497 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
498 LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
499 CFLAGS missing (-Wformat): gcc -fPIC -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
500 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c -o test.output
501 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c -o test.output
502 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c -o test.output
503 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): (gcc -Wl,-z,relro -o test.output test.c)
504 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): (gcc -Wl,-z,relro -o test.output test.c)
505 LDFLAGS missing (-fPIE -pie -Wl,-z,now): (gcc -Wl,-z,relro -o test.output test.c)
508 is_blhc 'bad-cppflags', '', 8,
509 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
510 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-b.c
511 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-c.c
512 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c ../../../../src/test/test.c -o test.so.o
513 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -o test -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test-a.cxx test-b.o test-c.o -Wl,-z,relro
514 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-a.c
515 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-b.c
516 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-c.c
517 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=0 -c test-d.c
518 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-e.c
519 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-f.c
520 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -U_FORTIFY_SOURCE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-g.c
521 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -U_FORTIFY_SOURCE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-h.c
522 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -c test-i.c
525 is_blhc 'bad-cppflags', '--ignore-flag -D_FORTIFY_SOURCE=2', 0,
529 'LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
530 LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o
531 LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h
533 is_blhc 'bad-ldflags', '', 8,
535 is_blhc 'bad-ldflags', '--pie', 8,
536 'CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
537 CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
538 CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
539 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
540 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o
541 LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h
543 is_blhc 'bad-ldflags', '--bindnow', 8,
544 'LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
545 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o
546 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h
548 is_blhc 'bad-ldflags', '--pie --bindnow', 8,
549 'CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
550 CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
551 CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
552 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
553 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o
554 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -o test test-a.o test-b.o test-c.o test.h
557 is_blhc 'bad-multiline', '', 8,
558 'CFLAGS missing (-Wformat): gcc \ -g -O2 -fstack-protector-strong\ -Wformat-security\ -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
559 CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security\ -D_FORTIFY_SOURCE=2\ -c test-b.c
560 CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
561 LDFLAGS missing (-Wl,-z,relro): gcc -o\ test test-c.o test-a.o test-b.o\ -ltest
562 LDFLAGS missing (-Wl,-z,relro): gcc -o \ test test-c.o test-b.o test-a.o\
563 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -o \ test test-b.o test-a.o test-c.c\
564 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -o \ test test-b.o test-a.o test-c.c\
565 LDFLAGS missing (-Wl,-z,relro): gcc -o \ test test-b.o test-a.o test-c.c\
566 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
567 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -D_FORTIFY_SOURCE=2 -c test-b.c
568 CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -D_FORTIFY_SOURCE=2 -c test-a.c
569 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat): gcc -Wformat-security -Werror=format-security -c test-b.c
570 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wformat-security -Werror=format-security -c test-b.c
571 CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
572 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
573 CFLAGS missing (-g -fstack-protector-strong -Wformat -Werror=format-security): \ gcc -O2 -D_FORTIFY_SOURCE=2 -c test-b.c
574 CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -c test-a.c
575 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -c test-a.c
576 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): \ gcc -D_FORTIFY_SOURCE=2 -c test-b.c
577 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security \; -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-a.c
578 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): \ gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-b.c
579 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed \'s/.../; s/.../\'` -o test.o
580 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed "s/.../; s/.../"` -o test.o
583 is_blhc 'bad-library', '--all', 8,
584 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security test.c -fPIC -DPIC -o libtest.so
585 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security test.c -fPIC -DPIC -o libtest.so
586 LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,--as-needed -o libtest.so
587 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so
588 LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0
589 LDFLAGS missing (-Wl,-z,relro): gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl
590 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): /usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz
591 LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt
592 CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
593 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
594 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
598 # check the build log is verbose
600 is_blhc 'verbose-build', '', 12,
601 'NONVERBOSE BUILD: checking if you want to see long compiling messages... no
602 NONVERBOSE BUILD: CC libtest-a.lo
603 NONVERBOSE BUILD: CC libtest-b.lo
604 NONVERBOSE BUILD: CC libtest_c.lo
605 NONVERBOSE BUILD: CC libtest-d.lo
606 NONVERBOSE BUILD: CCLD libtest.la
607 NONVERBOSE BUILD: LINK libtest.la
608 NONVERBOSE BUILD: CXX libtest-a.lo
609 NONVERBOSE BUILD: CXX libtest-b.lo
610 NONVERBOSE BUILD: CXX libtest_c.lo
611 NONVERBOSE BUILD: CXX libtest-d.lo
612 NONVERBOSE BUILD: CXXLD libtest.la
613 NONVERBOSE BUILD: [CC] src/test-a.o
614 NONVERBOSE BUILD: [CC] src/test-b.o
615 NONVERBOSE BUILD: [CC] src/test_c.o
616 NONVERBOSE BUILD: [CXX] src/test-d.o
617 NONVERBOSE BUILD: [LD] src/test.o
618 NONVERBOSE BUILD: [CC] src/test-a.o
619 NONVERBOSE BUILD: [CC] src/test-b.o
620 NONVERBOSE BUILD: [CC] src/test_c.o
621 NONVERBOSE BUILD: [LD] src/test.o
622 NONVERBOSE BUILD: [CC] src/test-a.o
623 NONVERBOSE BUILD: [CC] src/test-b.o
624 NONVERBOSE BUILD: [CC] src/test_c.o
625 NONVERBOSE BUILD: [LD] src/test.o
626 NONVERBOSE BUILD: CC modules/server/test.c
627 NONVERBOSE BUILD: C++ test/test.o
628 NONVERBOSE BUILD: C++ test.cpp
629 NONVERBOSE BUILD: Building program ../build/bin/test
630 NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
631 NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
632 NONVERBOSE BUILD: Building shared library ../build/test/libtest.so.1.2.3
633 NONVERBOSE BUILD: Compiling test.cc to ../build/test/test.o
634 NONVERBOSE BUILD: Building program ../build/bin/test
635 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -o ../build/test/test.o test/test.cc
636 LDFLAGS missing (-Wl,-z,relro): g++ -fPIC -DPIC \ -o ../build/test/libtest.so.1.2.3 -shared \ ../build/obj/test/test-a.o ../build/obj/test/test-b.o ../build/obj/test/test-c.o
637 CXXFLAGS missing (-Wformat): g++ -c -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
638 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
639 LDFLAGS missing (-Wl,-z,relro): g++ ../build/obj/test/test.o -o /../build/bin/test
640 NONVERBOSE BUILD: Compiling test_file.cxx...
641 CXXFLAGS missing (-fstack-protector-strong): g++ -g -O2 -fPIC -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test_file.cxx
642 NONVERBOSE BUILD: [ 22%] Building CXX object src/CMakeFiles/test/test.cpp.o
643 NONVERBOSE BUILD: [ 82%] Building C object src/CMakeFiles/test/test.c.o
644 CXXFLAGS missing (-Wformat): cd /tmp/test/src && /usr/bin/c++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -o CMakeFiles/test-verbose.dir/verbose.cpp.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose/verbose.cpp
645 CFLAGS missing (-Werror=format-security): cd /tmp/test/src && /usr/bin/gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -o CMakeFiles/test-verbose-c.dir/verbose-c.c.o -c -D_FORTIFY_SOURCE=2 /tmp/test/src/test-verbose-c/verbose-c.c
646 NONVERBOSE BUILD: Compiling test.c \ gcc test.c
650 # handle debug builds
652 is_blhc 'debug-build', '', 0, '';
657 is_blhc 'configure', '', 1,
660 is_blhc 'configure-check', '', 4,
661 'NONVERBOSE BUILD: CC = gcc -std=gnu99 -std=gnu99 test.c
664 is_blhc 'make', '', 1,
670 is_blhc 'qt4', '', 1,
676 is_blhc 'cc', '--pie --bindnow', 8,
677 'CXXFLAGS missing (-fPIE -Wformat): cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cc
678 CFLAGS missing (-fPIE -Wformat): cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
679 CFLAGS missing (-fPIE -fstack-protector-strong): cc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
680 CFLAGS missing (-fPIE -Werror=format-security): cc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
681 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): cc -Wl,-z,defs -o test test-a.o test-b.o test-c.o -ltest
682 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): cc\ test.cc
683 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc\ test.cc
684 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): cc\ test.cc
685 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): cc\ test.cc
686 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc\ test.cc
687 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): cc\ test.cc
688 LDFLAGS missing (-fPIE -pie -Wl,-z,now): cc -Wl,-z,defs test-a.o test-b.o test-c.o -ltest -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
694 is_blhc 'gcc', '--pie --bindnow', 8,
695 'CXXFLAGS missing (-fPIE -Wformat): gcc-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cc
696 CFLAGS missing (-fPIE -Wformat): gcc-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
697 CFLAGS missing (-fPIE -fstack-protector-strong): gcc-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
698 CFLAGS missing (-fPIE -Werror=format-security): gcc-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
699 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o -ltest
700 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc\ test.c
701 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc\ test.c
702 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc\ test.c
703 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc\ test.c
704 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc\ test.c
705 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc\ test.c
706 LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc-4.6 -Wl,-z,defs test-a.o test-b.o test-c.o -ltest -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
712 is_blhc 'c++', '--pie --bindnow', 8,
713 'CXXFLAGS missing (-fPIE -Wformat): c++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
714 CXXFLAGS missing (-fPIE -fstack-protector-strong): c++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
715 CXXFLAGS missing (-fPIE -Werror=format-security): c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
716 CXXFLAGS missing (-fPIE): c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
717 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
718 LDFLAGS missing (-fPIE -pie -Wl,-z,now): c++ -Wl,-z,defs test-a.o test-b.o test-c.o -ltest -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
719 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c
720 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c
721 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c
722 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c++
723 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c++
724 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c++
725 CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c++
726 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c++
727 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c++
728 CXXFLAGS missing (-fPIE -Wformat): c++-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
729 CXXFLAGS missing (-fPIE -fstack-protector-strong): c++-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
730 CXXFLAGS missing (-fPIE -Werror=format-security): c++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
731 CXXFLAGS missing (-fPIE): c++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
732 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
738 is_blhc 'g++', '--pie --bindnow', 8,
739 'CXXFLAGS missing (-fPIE -Wformat): g++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
740 CXXFLAGS missing (-fPIE -fstack-protector-strong): g++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
741 CXXFLAGS missing (-fPIE -Werror=format-security): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
742 CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
743 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
744 CXXFLAGS missing (-fPIE -Wformat): x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
745 CXXFLAGS missing (-fPIE -fstack-protector-strong): x86_64-linux-gnu-g++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
746 CXXFLAGS missing (-fPIE -Werror=format-security): x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
747 CXXFLAGS missing (-fPIE): x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
748 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): x86_64-linux-gnu-g++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
749 LDFLAGS missing (-fPIE -pie -Wl,-z,now): g++ -Wl,-z,defs test-a.o test-b.o test-c.o -ltest -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
750 CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): g++\ test.c
751 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++\ test.c
752 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++\ test.c
753 CXXFLAGS missing (-fPIE -Wformat): g++-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
754 CXXFLAGS missing (-fPIE -fstack-protector-strong): g++-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
755 CXXFLAGS missing (-fPIE -Werror=format-security): g++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
756 CXXFLAGS missing (-fPIE): g++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
757 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
763 my $ada = 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c
764 LDFLAGS missing (-Wl,-z,relro): /usr/bin/gcc-4.6 -shared -lgnat-4.6 -o libtest.so.2 test-a.o test-b.o test-c.o -Wl,--as-needed
765 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -c -g -O2 test.c
766 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -g -O2 test.c
767 CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 test.c
768 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 test.c
769 LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 test.c
771 is_blhc 'ada', '', 8,
773 is_blhc 'ada-pbuilder', '', 8,
779 is_blhc 'libtool', '--bindnow', 12,
780 'CFLAGS missing (-fPIE -Wformat): libtool: compile: x86_64-linux-gnu-gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
781 CXXFLAGS missing (-fPIE -Wformat): libtool: compile: x86_64-linux-gnu-g++ -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cpp
782 CFLAGS missing (-fPIE -Wformat): libtool: compile: gcc-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
783 CXXFLAGS missing (-fPIE -Wformat): libtool: compile: g++-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cc
784 LDFLAGS missing (-Wl,-z,now): libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -Wl,relro -o test.so
785 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z -Wl,relro -o test test.o
786 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: cc -Wl,-z,relro -o test.so test.o
787 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc-4.6 -Wl,-z,relro -o test.so test.o
788 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: x86_64-linux-gnu-g++ -Wl,-z,relro -o test.so test.o
789 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
790 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
791 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
792 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
793 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
794 NONVERBOSE BUILD: /bin/bash /tmp/test/build/libtool --silent --tag CC --mode=relink gcc -Wl,-z,relro -o test.so test.o
795 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: relink: gcc -Wl,-z,relro -o test.so test.o
796 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: relink: g++ -Wl,-z,relro -o test.la test.o
797 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z,relro -o test test.o
798 LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z -Wl,relro -o .libs/test test.o
799 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: g++ -include ./include/CppUTest/MemoryLeakDetectorNewMacros.h -Wall -Wextra -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -pedantic -Wsign-conversion -Woverloaded-virtual -Wno-disabled-macro-expansion -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors -Wno-weak-vtables -Wno-old-style-cast -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z -Wl,relro -o CppUTestTests CppUTestTests-AllocationInCFile.o CppUTestTests-AllocationInCppFile.o CppUTestTests-AllocLetTestFree.o CppUTestTests-AllocLetTestFreeTest.o CppUTestTests-AllTests.o CppUTestTests-CheatSheetTest.o CppUTestTests-CommandLineArgumentsTest.o CppUTestTests-CommandLineTestRunnerTest.o CppUTestTests-JUnitOutputTest.o CppUTestTests-MemoryLeakDetectorTest.o CppUTestTests-MemoryLeakOperatorOverloadsTest.o CppUTestTests-MemoryLeakWarningTest.o CppUTestTests-PluginTest.o CppUTestTests-PreprocessorTest.o CppUTestTests-SetPluginTest.o CppUTest Tests-SimpleStringTest.o CppUTestTests-SimpleMutexTest.o CppUTestTests-TestFailureNaNTest.o CppUTestTests-TestFailureTest.o CppUTestTests-TestFilterTest.o CppUTestTests-TestHarness_cTest.o CppUTestTests-TestHarness_cTestCFile.o CppUTestTests-TestInstallerTest.o CppUTestTests-TestMemoryAllocatorTest.o CppUTestTests-TestOutputTest.o CppUTestTests-TestRegistryTest.o CppUTestTests-TestResultTest.o CppUTestTests-TestUTestMacro.o CppUTestTests-UtestTest.o CppUTestTests-UtestPlatformTest.o lib/libCppUTest.a -lpthread
800 LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
801 LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): libtool: link: gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
802 NONVERBOSE BUILD: /usr/share/apr-1.0/build/libtool --silent --mode=compile x86_64-linux-gnu-gcc -std=gnu99 -I/usr/include/libxml2 -pthread -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ... -prefer-pic -c mod_buffer.c
803 NONVERBOSE BUILD: /usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc -std=gnu99 -I/usr/include/libxml2 -pthread -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wl,--as-needed -Wl,-z,relro -o mod_buffer.la -rpath /usr/lib/apache2/modules -module -avoid-version mod_buffer.lo
804 NONVERBOSE BUILD: /usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc -std=gnu99 -pthread -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -lssl -lcrypto -pie -Wl,--as-needed -Wl,-z,relro -o ab ab.lo -lcap /usr/lib/libaprutil-1.la /usr/lib/libapr-1.la -lm
805 NONVERBOSE BUILD: /usr/share/apr-1.0/build/libtool --silent --mode=link x86_64-linux-gnu-gcc -std=gnu99 -pthread -pipe -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -lssl -lcrypto -pie \ -Wl,--as-needed -Wl,-z,relro -o ab ab.lo -lcap /usr/lib/libaprutil-1.la /usr/lib/libapr-1.la -lm
806 NONVERBOSE BUILD: /bin/bash ../libtool --silent --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -MT coloredstderr.lo -MD -MP -MF .deps/coloredstderr.Tpo -c -o coloredstderr.lo coloredstderr.c
807 NONVERBOSE BUILD: /bin/bash ../libtool --silent --tag=CC --mode=link gcc -Wall -Wextra -Wconversion -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fPIE -pie -Wl,-z,relro -Wl,-z,now -o libcoloredstderr.la -rpath /usr/local/lib coloredstderr.lo -ldl
811 # different architectures
814 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
816 is_blhc 'arch-avr32', '', 8,
820 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
821 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
823 is_blhc 'arch-i386', '', 8,
827 'CFLAGS missing (-fPIE): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
828 LDFLAGS missing (-pie): gcc -fPIE -o test test.o
830 is_blhc 'arch-ia64', '', 8,
833 is_blhc 'arch-ia64', '--arch i386', 8,
834 'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
835 LDFLAGS missing (-Wl,-z,relro): gcc -fPIE -pie -o test test.o
836 CFLAGS missing (-fPIE -fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
837 LDFLAGS missing (-pie -Wl,-z,relro): gcc -fPIE -o test test.o
841 # architecture in older buildd logs
843 is_blhc 'dpkg-buildpackage-architecture-old', '', 0,
847 # correct architecture detection
849 is_blhc 'buildd-architecture', '', 0, '';
850 is_blhc 'buildd-architecture-old', '', 0, '';
853 # ignore architecture
855 is_blhc ['arch-avr32', 'arch-i386', 'empty', 'arch-mipsel'],
856 '--ignore-arch avr32 --ignore-arch mipsel',
858 "checking './t/logs/arch-avr32'...\n"
859 . "ignoring architecture 'avr32'\n"
860 . "checking './t/logs/arch-i386'...\n"
862 . "checking './t/logs/empty'...\n"
864 . "checking './t/logs/arch-mipsel'...\n"
865 . "ignoring architecture 'mipsel'\n"
868 is_blhc 'buildd-dpkg-dev', '--ignore-arch i386', 0,
869 "ignoring architecture 'i386'\n";
874 is_blhc 'debian', '', 8,
875 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
876 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c `dpkg-buildflags --get CFLAGS` test.c
877 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c `dpkg-buildflags --get CXXFLAGS` test.cc
878 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -c `dpkg-buildflags --get LDFLAGS` test.c
879 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c `dpkg-buildflags --get LDFLAGS` test.c
880 LDFLAGS missing (-Wl,-z,relro): gcc -o test test.o `dpkg-buildflags --get CFLAGS`
883 is_blhc 'debian-cmake', '', 32,
884 'INVALID CMAKE: 2.8.7-1
886 is_blhc 'debian-cmake-2', '', 32,
887 'INVALID CMAKE: 2.8.7-2
889 is_blhc 'debian-cmake-ok', '', 0,
892 my $debian_hardening_wrapper =
893 'HARDENING WRAPPER: no checks possible, aborting
895 is_blhc 'debian-hardening-wrapper', '', 16,
896 $debian_hardening_wrapper;
897 is_blhc 'debian-hardening-wrapper-old-build-depends', '', 16,
898 $debian_hardening_wrapper;
899 is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
900 $debian_hardening_wrapper;
905 is_blhc 'false-positives', '', 0,
911 is_blhc 'empty', '--buildd', 0,
912 'I-no-compiler-commands||
915 is_blhc 'buildd-package-details', '--buildd', 0,
918 is_blhc 'buildd-dpkg-dev', '--buildd', 0,
919 'W-dpkg-buildflags-missing|CPPFLAGS 7 (of 7), CFLAGS 6 (of 6), CXXFLAGS 1 (of 1), LDFLAGS 2 (of 2) missing|
922 is_blhc 'buildd-dpkg-dev-old', '--buildd', 0,
923 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
926 is_blhc 'buildd-dpkg-dev-missing', '--buildd', 0,
927 'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
930 # Older dpkg versions use -fstack-protector instead of -strong.
931 is_blhc 'buildd-dpkg-fstack-protector', '--buildd', 0,
933 is_blhc 'buildd-dpkg-fstack-protector-missing', '--buildd', 0,
934 'W-dpkg-buildflags-missing|CFLAGS 5 (of 5) missing|
937 is_blhc 'debian-hardening-wrapper', '--buildd', 0,
938 'I-hardening-wrapper-used||
940 is_blhc 'debian-hardening-wrapper-pbuilder', '--buildd', 0,
941 'I-hardening-wrapper-used||
944 is_blhc 'buildd-verbose-build', '--buildd', 0,
945 'W-compiler-flags-hidden|3 (of 5) hidden|
948 is_blhc 'make', '--buildd', 0,
949 'I-no-compiler-commands||
952 is_blhc 'debian-cmake', '--buildd', 0,
953 'I-invalid-cmake-used|2.8.7-1|
959 is_blhc ['good', 'good-pie', 'good-bindnow', 'good-all', 'good-multiline', 'good-library'], '', 0,
960 "checking './t/logs/good'...
961 checking './t/logs/good-pie'...
962 checking './t/logs/good-bindnow'...
963 checking './t/logs/good-all'...
964 checking './t/logs/good-multiline'...
965 checking './t/logs/good-library'...
967 is_blhc ['good-all', 'good-library'], '--all', 0,
968 "checking './t/logs/good-all'...
969 checking './t/logs/good-library'...
972 is_blhc ['arch-i386', 'arch-ia64'], '', 8,
973 "checking './t/logs/arch-i386'...\n"
975 . "checking './t/logs/arch-ia64'...\n"
978 # No exit when multiple files are specified.
979 is_blhc ['bad-ldflags', 'empty', 'arch-avr32', 'debian-hardening-wrapper'], '', 25,
980 "checking './t/logs/bad-ldflags'...\n"
982 . "checking './t/logs/empty'...\n"
984 . "checking './t/logs/arch-avr32'...\n"
986 . "checking './t/logs/debian-hardening-wrapper'...\n"
987 . $debian_hardening_wrapper
990 # Ignore works correctly with multiple architectures.
991 is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-flag'],
992 '--ignore-arch-flag i386:-fstack-protector-strong --ignore-arch-flag mipsel:-Werror=format-security', 8,
993 "checking './t/logs/arch-i386'...
994 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
995 checking './t/logs/arch-amd64'...
996 CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
997 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
998 checking './t/logs/arch-avr32'...
999 CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
1000 checking './t/logs/ignore-flag'...
1001 CFLAGS missing (-g): gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
1002 CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
1006 is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-line'],
1007 '--ignore-arch-line "i386:gcc .+ -fPIE .+" --ignore-arch-line "mipsel:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
1008 "checking './t/logs/arch-i386'...
1009 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
1010 checking './t/logs/arch-amd64'...
1011 CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
1012 LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
1013 checking './t/logs/arch-avr32'...
1014 CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
1015 checking './t/logs/ignore-line'...
1016 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
1017 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
1018 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
1019 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c
1020 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c
1021 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c
1022 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-b.c
1023 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-b.c
1024 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-b.c
1025 CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-c.c
1026 CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-c.c
1027 LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-c.c