}
}
- if (index($line, 'Build-Depends: ') == 0) {
+ # Debian's build daemons use Build-Depends: for the build
+ # dependencies, but pbuilder just uses Depends:; support both.
+ if (index($line, 'Build-Depends: ') == 0
+ or index($line, 'Depends: ') == 0) {
# If hardening wrapper is used (wraps calls to gcc and adds
# hardening flags automatically) we can't perform any checks,
# abort.
--- /dev/null
+# pbuilder uses Depends: for the build dependencies.
+Depends: ..., gnat, gnat-4.6, ...
+
+dpkg-buildpackage: source package ada package
+
+
+gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security test.c
+gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -gnatn -gnatw.eH test-a.adb
+gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -gnatn -gnatw.eH test-b.adb
+gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -gnatn -gnatw.eH test-c.adb
+gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -gnatn -gnatw.eH test-d.ads
+
+/usr/bin/gcc-4.6 -shared -lgnat-4.6 -o libtest.so.2 test-a.o test-b.o test-c.o -Wl,-z,relro -Wl,--as-needed
+/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
+
+gcc -c -g -O2 test.c
+gcc -g -O2 test.c
use strict;
use warnings;
-use Test::More tests => 196;
+use Test::More tests => 202;
sub is_blhc {
# ada
-is_blhc 'ada', '', 8,
- 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security test.c
+my $ada = 'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc-4.6 -c -fPIC -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security test.c
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
CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security): gcc -c -g -O2 test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -g -O2 test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 test.c
LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 test.c
';
+is_blhc 'ada', '', 8,
+ $ada;
+is_blhc 'ada-pbuilder', '', 8,
+ $ada;
# libtool
';
is_blhc 'debian-hardening-wrapper', '', 16,
$debian_hardening_wrapper;
+is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
+ $debian_hardening_wrapper;
# false positives
is_blhc 'debian-hardening-wrapper', '--buildd', 0,
'I-hardening-wrapper-used||
';
+is_blhc 'debian-hardening-wrapper-pbuilder', '--buildd', 0,
+ 'I-hardening-wrapper-used||
+';
is_blhc 'buildd-verbose-build', '--buildd', 0,
'W-compiler-flags-hidden|1 (of 5) hidden|