blhc-0.05 000700 001750 001750 0 12374753057 12006 5 ustar 00simon simon 000000 000000 blhc-0.05/Build.PL 000444 001750 001750 3075 12374753057 13456 0 ustar 00simon simon 000000 000000 #!/usr/bin/perl
# Copyright (C) 2012-2014 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
use strict;
use warnings;
use Module::Build;
my $build = Module::Build->new(
module_name => 'blhc',
dist_author => 'Simon Ruderich ',
dist_version_from => 'bin/blhc',
license => 'gpl', # gpl_3 is spec 2, not used by Module::Build
requires => {
# Debian specific (for now).
'Dpkg::Arch' => 0,
'Dpkg::Version' => 0,
# Bundled with perl.
'Getopt::Long' => 0,
'Pod::Usage' => 0,
'Term::ANSIColor' => '2.01',
'Text::ParseWords' => 0,
},
configure_requires => {
'Module::Build' => 0,
},
);
$build->create_build_script;
blhc-0.05/COPYING 000444 001750 001750 104513 12374753057 13254 0 ustar 00simon simon 000000 000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
blhc-0.05/NEWS 000444 001750 001750 5165 12374753057 12663 0 ustar 00simon simon 000000 000000 NEWS
====
Version 0.05
------------
- Fix false positive in configure output if $CC contains options (Debian bug
#710135), reported by Bastien Roucariès.
- Handle another case of Qt's `moc` (Debian bug #710780), reported by Felix
Geyer.
- Fix detection of build dependencies for buildd logs (Debian bug #719656),
reported by Nicolas Boulenguez.
- Fix buildd architecture detection. Only relevant if the chroot setup fails
and dpkg-buildpackage is never run; therefore a minor issue.
- Fix false positive when "compiling" python files (Debian bugs #714630 and
#753080), reported by Matthias Klose, patch by James McCoy.
- Don't check for hardening flags in non-verbose compiler commands spanning
multiple lines.
- Better handling of libtool commands (Debug bug #717598), reported by Stefan
Fritsch.
- Sync architecture specific hardening support with dpkg 1.17.13.
- Check for -fstack-protector-strong on supported platforms (since dpkg
1.17.11) (Debian bug #757885), reported by Markus Koschany.
- Consider lines with -O0 or -Og debug builds and disable checks for -O2
(Debian bug #714628), reported by Matthias Klose. Also don't check for
fortification in those lines as it requires optimization (Debian bug
#757683), also reported by Matthias Klose.
Version 0.04
------------
- Fix many false positives, this includes compiled header files, lines with
only CC=gcc but no other compiler commands and `moc-qt4`/`moc-qt5` commands.
- Accept -Wformat=2 because it implies -Wformat.
- Accept --param ssp-buffer-size=4 (space instead of equals sign).
- Fix build dependency related checks (Ada, hardening-wrapper) for pbuilder
build logs.
- Fix architecture detection in old buildd build logs which use an additional
"is" in the "dpkg-buildpackage: host architecture" field.
- Updated output in buildd mode.
- Only return non-zero exit codes for errors in buildd mode, not for warnings.
- Minor performance improvements.
- Support for Ada files.
Version 0.03
------------
- Fix --ignore-flag with -fPIE.
- Detect overwrite of -D_FORTIFY_SOURCE=2 with -D_FORTIFY_SOURCE=0 or 1 or
-U_FORTIFY_SOURCE.
- Add --ignore-arch-flag and --ignore-arch-line options to ignore flags and
lines on certain architectures only.
- Buildd tags "no-compiler-commands" and "invalid-cmake-used" are now
information ('I-') instead of warning ('W-').
- Ignore false positives when using moc-qt4.
Version 0.02
------------
- Fix --version, --help.
- Remove -Wformat-security from expected CFLAGS because it's already implied
by -Werror=format-security (removed in dpkg-dev >= 1.16.3).
Version 0.01
------------
- Initial release.
// vim: ft=asciidoc
blhc-0.05/MANIFEST 000444 001750 001750 2276 12374753057 13315 0 ustar 00simon simon 000000 000000 bin/blhc
Build.PL
COPYING
MANIFEST This list of files
META.json
META.yml
NEWS
README
t/logs/ada
t/logs/ada-pbuilder
t/logs/arch-amd64
t/logs/arch-avr32
t/logs/arch-i386
t/logs/arch-ia64
t/logs/arch-mipsel
t/logs/bad
t/logs/bad-cflags
t/logs/bad-cppflags
t/logs/bad-ldflags
t/logs/bad-library
t/logs/bad-multiline
t/logs/buildd-architecture
t/logs/buildd-architecture-old
t/logs/buildd-dpkg-dev
t/logs/buildd-dpkg-dev-missing
t/logs/buildd-dpkg-dev-old
t/logs/buildd-dpkg-fstack-protector
t/logs/buildd-dpkg-fstack-protector-missing
t/logs/buildd-package-details
t/logs/buildd-verbose-build
t/logs/c++
t/logs/cc
t/logs/configure
t/logs/configure-check
t/logs/debian
t/logs/debian-cmake
t/logs/debian-cmake-2
t/logs/debian-cmake-ok
t/logs/debian-hardening-wrapper
t/logs/debian-hardening-wrapper-old-build-depends
t/logs/debian-hardening-wrapper-pbuilder
t/logs/debug-build
t/logs/dpkg-buildpackage-architecture-old
t/logs/empty
t/logs/false-positives
t/logs/g++
t/logs/gcc
t/logs/good
t/logs/good-all
t/logs/good-bindnow
t/logs/good-library
t/logs/good-multiline
t/logs/good-pie
t/logs/ignore-flag
t/logs/ignore-flag-ldflags
t/logs/ignore-line
t/logs/libtool
t/logs/make
t/logs/qt4
t/logs/verbose-build
t/tests.t
blhc-0.05/README 000444 001750 001750 14027 12374753057 13061 0 ustar 00simon simon 000000 000000 README
======
blhc (build log hardening check) is a small tool which checks build logs for
missing hardening flags. It's licensed under the GPL 3 or later.
Hardening flags enable additional security features in the compiler to prevent
e.g. stack overflows, format string vulnerabilities, GOT overwrites, etc.
Because most build systems are quite complicated there are many places where
compiler flags from the environment might be ignored. The parser verifies that
all compiler commands use the correct hardening flags and thus all hardening
features are correctly used.
It's designed to check build logs generated by Debian's dpkg-buildpackage (or
tools using dpkg-buildpackage like pbuilder or sbuild (which is used for the
official buildd build logs)) to help maintainers detect missing hardening
flags in their packages.
At the moment it works only on Debian and derivatives but it should be easily
extendable to other systems as well. Patches are welcome.
Only gcc is detected as compiler at the moment. If other compilers support
hardening flags as well, please report them.
For more information about hardening flags have a look at [1].
[1]: https://wiki.debian.org/Hardening
DEPENDENCIES
------------
- Perl
- Dpkg::Arch
- Dpkg::Version
- Term::ANSIColor >= 2.01
Bundled with perl. A recent version is only necessary for build logs with
ANSI colors which is rare, blhc works fine without if the build log
doesn't use colors. Not required for buildd mode.
USAGE
-----
blhc path/to/log/file
blhc can be run directly from the source tree (`bin/blhc`) or copied anywhere
on the system. It doesn't have to be explicitly installed. To read the man
page use `perldoc bin/blhc`.
If there's no output, no flags are missing and the build log is fine.
For more examples see the man page.
CHECKS
------
blhc checks all compiler lines (lines matching `gcc`) for hardening flags
(same as set by `dpkg-buildflags`). If a compiler flag is missing a warning
with the missing flags is printed.
Consider the following compiler line:
gcc -g -O2 -o test test.c
blhc generates the following warnings because all hardening flags are missing:
CFLAGS missing (-fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security): gcc -g -O2 -o test test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -o test test.c
LDFLAGS missing (-Wl,-z,relro): gcc -g -O2 -o test test.c
Preprocessing, linking and compiling is automatically detected:
gcc -MM test.c > test.d
gcc -E test.c
gcc -o test test.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
LDFLAGS missing (-Wl,-z,relro): gcc -o test test.o
blhc differentiates the following flags:
- CPPFLAGS: preprocessor flags
- CFLAGS: C compiler flags
- CXXFLAGS: C++ compiler flags
- LDFLAGS: linker flags
Both '-O2' and '-O3' are recognized as valid, even though only '-O2' is
printed in warnings.
It handles all file extensions as documented by gcc regarding preprocessing,
linking, compiling.
The architecture of the build log is automatically detected by looking for the
following line (output of dpkg-buildpackage):
dpkg-buildpackage: host architecture
The available hardening flags are adapted to the architecture because some
architectures don't support certain hardening options.
Some checks check the build dependencies for certain packages. The following
lines are used to get the build dependencies. The first two are used in buildd
build logs (the second was used in older logs), the third by pbuilder logs,
all are detected:
Filtered Buildd-Depends: ...
Build-Depends: ...
Depends: ...
LIMITATIONS
-----------
The build log must contain the following line which marks the beginning of the
real compile process (output of dpkg-buildpackage):
dpkg-buildpackage: ...
If it's not present no compiler commands are detected. In case you don't use
dpkp-buildpackage but still want to check a build log, adding it as first line
should work fine.
To prevent false positives when checking debug builds, compiler lines
containing '-OO' or '-Og' are considered debug builds and are not checked for
'-O2', even though fortification doesn't work without '-O2'.
The following non-verbose builds can't be detected:
gcc -o test
This is not detected because `test` has no file extension. A file extension is
required on a compiler line to prevent many false positives. As the build will
most likely contain other non-verbose build commands (e.g. `gcc test.c`) which
are correctly detected as non-verbose this shouldn't be a problem.
Some CMake non-verbose linker commands are also not correctly detected at the
moment.
blhc still creates a few false positives. Patches to fix them are very welcome
as long as they won't cause any false negatives.
BUILDD MODE
-----------
Buildd mode is enabled if '--buildd' is used. It's designed to check build
logs from Debian's buildds.
Instead of normal warning messages only tags are printed at the end of the
check. See the man page for possible tags.
BUGS
----
If you find any bugs not mentioned in this document please report them to
with blhc in the subject.
AUTHORS
-------
Written by Simon Ruderich .
Thanks to Bernhard R. Link and Jaria Alto
for their valuable input and suggestions.
LICENSE
-------
blhc is licensed under GPL version 3 or later.
Copyright (C) 2012-2014 Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
blhc-0.05/META.yml 000444 001750 001750 1177 12374753057 13434 0 ustar 00simon simon 000000 000000 ---
abstract: 'build log hardening check, checks build logs for missing hardening flags'
author:
- 'Simon Ruderich '
build_requires: {}
configure_requires:
Module::Build: '0'
dynamic_config: 1
generated_by: 'Module::Build version 0.4206, CPAN::Meta::Converter version 2.140640'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: blhc
requires:
Dpkg::Arch: '0'
Dpkg::Version: '0'
Getopt::Long: '0'
Pod::Usage: '0'
Term::ANSIColor: '2.01'
Text::ParseWords: '0'
resources:
license: http://opensource.org/licenses/gpl-license.php
version: '0.05'
blhc-0.05/META.json 000444 001750 001750 1711 12374753057 13576 0 ustar 00simon simon 000000 000000 {
"abstract" : "build log hardening check, checks build logs for missing hardening flags",
"author" : [
"Simon Ruderich "
],
"dynamic_config" : 1,
"generated_by" : "Module::Build version 0.4206",
"license" : [
"gpl_1"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "blhc",
"prereqs" : {
"configure" : {
"requires" : {
"Module::Build" : "0"
}
},
"runtime" : {
"requires" : {
"Dpkg::Arch" : "0",
"Dpkg::Version" : "0",
"Getopt::Long" : "0",
"Pod::Usage" : "0",
"Term::ANSIColor" : "2.01",
"Text::ParseWords" : "0"
}
}
},
"release_status" : "stable",
"resources" : {
"license" : [
"http://opensource.org/licenses/gpl-license.php"
]
},
"version" : "0.05"
}
blhc-0.05/bin 000700 001750 001750 0 12374753057 12556 5 ustar 00simon simon 000000 000000 blhc-0.05/bin/blhc 000555 001750 001750 145041 12374753057 13630 0 ustar 00simon simon 000000 000000 #!/usr/bin/perl
# Build log hardening check, checks build logs for missing hardening flags.
# Copyright (C) 2012-2014 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
use strict;
use warnings;
use Getopt::Long ();
use Text::ParseWords ();
our $VERSION = '0.05';
# CONSTANTS/VARIABLES
# Regex to catch compiler commands.
my $cc_regex = qr/
(? 1 } (
# There's no @header_no_preprocess.
@source_no_preprocess,
);
my %extensions_preprocess = map { $_ => 1 } (
@header_preprocess,
@source_preprocess,
);
my %extensions_compile_link = map { $_ => 1 } (
@source_preprocess,
@source_no_preprocess,
);
my %extensions_compile = map { $_ => 1 } (
@source_preprocess_compile,
@source_no_preprocess_compile,
);
my %extensions_no_compile = map { $_ => 1 } (
@source_preprocess_no_compile,
@source_no_preprocess_no_compile,
);
my %extensions_compile_cpp = map { $_ => 1 } (
@source_preprocess_compile_cpp,
@source_no_preprocess_compile_cpp,
);
my %extensions_object = map { $_ => 1 } (
@object,
);
my %extension = map { $_ => 1 } (
@source_no_preprocess,
@header_preprocess,
@source_preprocess,
@object,
);
# Regexp to match file extensions.
my $file_extension_regex = qr/
\s
\S+ # Filename without 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
# terminated with "\n".
/x;
# Expected (hardening) flags. All flags are used as regexps (and compiled to
# real regexps below for better execution speed).
my @def_cflags = (
'-g',
'-O(?:2|3)', # keep at index 1, search for @def_cflags_debug to change it
);
my @def_cflags_debug = (
# These flags indicate a debug build which disables checks for -O2.
'-O0',
'-Og',
);
my @def_cflags_format = (
'-Wformat(?:=2)?', # -Wformat=2 implies -Wformat, accept it too
'-Werror=format-security', # implies -Wformat-security
);
my @def_cflags_fortify = (
# fortify needs at least -O1, but -O2 is recommended anyway
);
my @def_cflags_stack = (
'-fstack-protector',
'--param[= ]ssp-buffer-size=4',
);
my @def_cflags_stack_strong = (
'-fstack-protector-strong',
);
my @def_cflags_pie = (
'-fPIE',
);
my @def_cxxflags = (
@def_cflags,
);
# @def_cxxflags_* is the same as @def_cflags_*.
my @def_cppflags = ();
my @def_cppflags_fortify = (
'-D_FORTIFY_SOURCE=2', # must be first, see cppflags_fortify_broken()
# If you add another flag fix hack below (search for "Hack to fix") and
# $def_cppflags_fortify[0].
);
my @def_cppflags_fortify_bad = (
# These flags may overwrite -D_FORTIFY_SOURCE=2.
'-U_FORTIFY_SOURCE',
'-D_FORTIFY_SOURCE=0',
'-D_FORTIFY_SOURCE=1',
);
my @def_ldflags = ();
my @def_ldflags_relro = (
'-Wl,(?:-z,)?relro',
);
my @def_ldflags_bindnow = (
'-Wl,(?:-z,)?now',
);
my @def_ldflags_pie = (
'-fPIE',
'-pie',
);
my @def_ldflags_pic = (
'-fPIC',
'-fpic',
'-shared',
);
# References to all flags checked by the flag checker.
my @flag_refs = (
\@def_cflags,
\@def_cflags_format,
\@def_cflags_fortify,
\@def_cflags_stack,
\@def_cflags_stack_strong,
\@def_cflags_pie,
\@def_cxxflags,
\@def_cppflags,
\@def_cppflags_fortify,
\@def_ldflags,
\@def_ldflags_relro,
\@def_ldflags_bindnow,
\@def_ldflags_pie,
);
# References to all used flags.
my @flag_refs_all = (
@flag_refs,
\@def_cflags_debug,
\@def_cppflags_fortify_bad,
\@def_ldflags_pic,
);
# Renaming rules for the output so the regex parts are not visible. Also
# stores string values of flag regexps above, see compile_flag_regexp().
my %flag_renames = (
'-O(?:2|3)' => '-O2',
'-Wformat(?:=2)?' => '-Wformat',
'--param[= ]ssp-buffer-size=4' => '--param=ssp-buffer-size=4',
'-Wl,(?:-z,)?relro' => '-Wl,-z,relro',
'-Wl,(?:-z,)?now' => '-Wl,-z,now',
);
my %exit_code = (
no_compiler_commands => 1 << 0,
# used by POD::Usage => 1 << 1,
non_verbose_build => 1 << 2,
flags_missing => 1 << 3,
hardening_wrapper => 1 << 4,
invalid_cmake => 1 << 5,
);
my %buildd_tag = (
no_compiler_commands => 'I-no-compiler-commands',
non_verbose_build => 'W-compiler-flags-hidden',
flags_missing => 'W-dpkg-buildflags-missing',
hardening_wrapper => 'I-hardening-wrapper-used',
invalid_cmake => 'I-invalid-cmake-used',
);
# Statistics of missing flags and non-verbose build commands. Used for
# $option_buildd.
my %statistics = (
preprocess => 0,
preprocess_missing => 0,
compile => 0,
compile_missing => 0,
compile_cpp => 0,
compile_cpp_missing => 0,
link => 0,
link_missing => 0,
commands => 0,
commands_nonverbose => 0,
);
# Use colored (ANSI) output?
my $option_color;
# FUNCTIONS
# Only works for single-level arrays with no undef values. Thanks to perlfaq4.
sub array_equal {
my ($first_ref, $second_ref) = @_;
return 0 if scalar @{$first_ref} != scalar @{$second_ref};
my $length = scalar @{$first_ref};
for (my $i = 0; $i < $length; $i++) {
return 0 if $first_ref->[$i] ne $second_ref->[$i];
}
return 1;
}
sub error_flags {
my ($message, $missing_flags_ref, $flag_renames_ref, $line) = @_;
# Get string value of qr//-escaped regexps and if requested rename them.
my @missing_flags = map {
$flag_renames_ref->{$_}
} @{$missing_flags_ref};
my $flags = join ' ', @missing_flags;
printf '%s (%s)%s %s',
error_color($message, 'red'), $flags, error_color(':', 'yellow'),
$line;
return;
}
sub error_non_verbose_build {
my ($line) = @_;
printf '%s%s %s',
error_color('NONVERBOSE BUILD', 'red'),
error_color(':', 'yellow'),
$line;
return;
}
sub error_invalid_cmake {
my ($version) = @_;
printf "%s%s %s\n",
error_color('INVALID CMAKE', 'red'),
error_color(':', 'yellow'),
$version;
return;
}
sub error_hardening_wrapper {
printf "%s%s %s\n",
error_color('HARDENING WRAPPER', 'red'),
error_color(':', 'yellow'),
'no checks possible, aborting';
return;
}
sub error_color {
my ($message, $color) = @_;
if ($option_color) {
return Term::ANSIColor::colored($message, $color);
} else {
return $message;
}
}
sub any_flags_used {
my ($line, @flags) = @_;
foreach my $flag (@flags) {
return 1 if $line =~ /$flag/;
}
return 0;
}
sub all_flags_used {
my ($line, $missing_flags_ref, @flags) = @_;
my @missing_flags = ();
foreach my $flag (@flags) {
if (not $line =~ /$flag/) {
push @missing_flags, $flag;
}
}
return 1 if scalar @missing_flags == 0;
@{$missing_flags_ref} = @missing_flags;
return 0;
}
sub cppflags_fortify_broken {
my ($line, $missing_flags) = @_;
# This doesn't take the position into account, but is a simple solution.
# And if the build system tries to force -D_FORTIFY_SOURCE=0/1, something
# is wrong anyway.
if (any_flags_used($line, @def_cppflags_fortify_bad)) {
# $def_cppflags_fortify[0] must be -D_FORTIFY_SOURCE=2!
push @{$missing_flags}, $def_cppflags_fortify[0];
return 1;
}
return 0;
}
# Modifies $missing_flags_ref array.
sub pic_pie_conflict {
my ($line, $pie, $missing_flags_ref, @flags_pie) = @_;
return 0 if not $pie;
return 0 if not any_flags_used($line, @def_ldflags_pic);
my %flags = map { $_ => 1 } @flags_pie;
# Remove all PIE flags from @missing_flags as they are not required with
# -fPIC.
my @result = grep {
not exists $flags{$_}
} @{$missing_flags_ref};
@{$missing_flags_ref} = @result;
# We got a conflict when no flags are left, thus only PIE flags were
# missing. If other flags were missing abort because the conflict is not
# the problem.
return scalar @result == 0;
}
sub is_non_verbose_build {
my ($line, $next_line, $skip_ref) = @_;
if ($line =~ /$libtool_regex/o) {
# libtool's --silent hides the real compiler flags.
if ($line =~ /\s--silent/) {
return 1;
# If --silent is not present, skip this line as some compiler flags
# might be missing (e.g. -fPIE) which are handled correctly by libtool
# internally. libtool displays the real compiler command on the next
# line, so the flags are checked as usual.
} else {
${$skip_ref} = 1;
return 0;
}
}
if (not (index($line, 'checking if you want to see long compiling messages... no') == 0
or $line =~ /^\s*\[?(?:CC|CCLD|C\+\+|CXX|CXXLD|LD|LINK)\]?\s+(.+?)$/
or $line =~ /^\s*[Cc]ompiling\s+(.+?)(?:\.\.\.)?$/
or $line =~ /^\s*[Bb]uilding (?:program|shared library)\s+(.+?)$/
or $line =~ /^\s*\[[\d ]+%\] Building (?:C|CXX) object (.+?)$/)) {
return 0;
}
# False positives.
#
# C++ compiler setting.
return 0 if $line =~ /^\s*C\+\+.+?:\s+(?:yes|no)\s*$/;
return 0 if $line =~ /^\s*C\+\+ Library: stdc\+\+$/;
# "Compiling" non binary files.
return 0 if $line =~ /^\s*Compiling \S+\.(?:py|el)['"]?\s*(?:\.\.\.)?$/;
# "Compiling" with no file name.
if ($line =~ /^\s*[Cc]ompiling\s+(.+?)(?:\.\.\.)?$/) {
# $file_extension_regex may need spaces around the filename.
return 0 if not " $1 " =~ /$file_extension_regex/o;
}
my $file = $1;
# On the first pass we only check if this line is verbose or not.
return 1 if not defined $next_line;
# Second pass, we have access to the next line.
${$skip_ref} = 0;
# CMake and other build systems print the non-verbose messages also when
# building verbose. If a compiler and the file name occurs in the next
# line, treat it as verbose build.
if (defined $file) {
# Get filename, we can't use the complete path as only parts of it are
# used in the real compiler command.
$file =~ m{/([^/\s]+)$};
$file = $1;
if (index($next_line, $file) != -1 and $next_line =~ /$cc_regex/o) {
# Not a non-verbose line, but we still have to skip the current line
# as it doesn't contain any compiler commands.
${$skip_ref} = 1;
return 0;
}
}
return 1;
}
# Remove @flags from $flag_refs_ref, uses $flag_renames_ref as reference.
sub remove_flags {
my ($flag_refs_ref, $flag_renames_ref, @flags) = @_;
my %removes = map { $_ => 1 } @flags;
foreach my $flags (@{$flag_refs_ref}) {
@{$flags} = grep {
# Flag found as string.
not exists $removes{$_}
# Flag found as string representation of regexp.
and (not defined $flag_renames_ref->{$_}
or not exists $removes{$flag_renames_ref->{$_}})
} @{$flags};
}
return;
}
# Modifies $flag_renames_ref hash.
sub compile_flag_regexp {
my ($flag_renames_ref, @flags) = @_;
my @result = ();
foreach my $flag (@flags) {
# Compile flag regexp for faster execution.
my $regex = qr/\s$flag(?:\s|\\)/;
# Store flag name in replacement string for correct flags in messages
# with qr//ed flag regexps.
$flag_renames_ref->{$regex}
= (exists $flag_renames_ref->{$flag})
? $flag_renames_ref->{$flag}
: $flag;
push @result, $regex;
}
return @result;
}
# Does any extension in @extensions exist in %{$extensions_ref}?
sub extension_found {
my ($extensions_ref, @extensions) = @_;
foreach my $extension (@extensions) {
if (exists $extensions_ref->{$extension}) {
return 1;
}
}
return 0;
}
# MAIN
# Parse command line arguments.
my $option_help = 0;
my $option_version = 0;
my $option_pie = 0;
my $option_bindnow = 0;
my @option_ignore_arch = ();
my @option_ignore_flag = ();
my @option_ignore_arch_flag = ();
my @option_ignore_line = ();
my @option_ignore_arch_line = ();
my $option_all = 0;
my $option_arch = undef;
my $option_buildd = 0;
$option_color = 0;
if (not Getopt::Long::GetOptions(
'help|h|?' => \$option_help,
'version' => \$option_version,
# Hardening options.
'pie' => \$option_pie,
'bindnow' => \$option_bindnow,
'all' => \$option_all,
# Ignore.
'ignore-arch=s' => \@option_ignore_arch,
'ignore-flag=s' => \@option_ignore_flag,
'ignore-arch-flag=s' => \@option_ignore_arch_flag,
'ignore-line=s' => \@option_ignore_line,
'ignore-arch-line=s' => \@option_ignore_arch_line,
# Misc.
'color' => \$option_color,
'arch=s' => \$option_arch,
'buildd' => \$option_buildd,
)) {
require Pod::Usage;
Pod::Usage::pod2usage(2);
}
if ($option_help) {
require Pod::Usage;
Pod::Usage::pod2usage(1);
}
if ($option_version) {
print <<"EOF";
blhc $VERSION Copyright (C) 2012-2014 Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
EOF
exit 0;
}
# Arguments missing.
if (scalar @ARGV == 0) {
require Pod::Usage;
Pod::Usage::pod2usage(2);
}
# Don't load Term::ANSIColor in buildd mode because Term::ANSIColor is not
# installed on Debian's buildds.
if (not $option_buildd) {
require Term::ANSIColor;
}
if ($option_all) {
$option_pie = 1;
$option_bindnow = 1;
}
# Precompiled ignores for faster lookup.
my %option_ignore_arch_flag = ();
my %option_ignore_arch_line = ();
# Strip flags which should be ignored.
if (scalar @option_ignore_flag > 0) {
remove_flags(\@flag_refs, \%flag_renames, @option_ignore_flag);
}
# Same for arch specific ignore flags, but only prepare here.
if (scalar @option_ignore_arch_flag > 0) {
foreach my $ignore (@option_ignore_arch_flag) {
my ($ignore_arch, $ignore_flag) = split /:/, $ignore, 2;
if (not $ignore_arch or not $ignore_flag) {
printf STDERR 'Value "%s" invalid for option ignore-arch-flag '
. '("arch:flag" expected)' . "\n", $ignore;
require Pod::Usage;
Pod::Usage::pod2usage(2);
}
push @{$option_ignore_arch_flag{$ignore_arch}}, $ignore_flag;
}
}
# Precompile all flag regexps. any_flags_used(), all_flags_used() get a lot
# faster with this.
foreach my $flags (@flag_refs_all) {
@{$flags} = compile_flag_regexp(\%flag_renames, @{$flags});
}
# Precompile ignore line regexps, also anchor at beginning and end of line.
foreach my $ignore (@option_ignore_line) {
$ignore = qr/^$ignore$/;
}
# Same for arch specific ignore lines.
if (scalar @option_ignore_arch_line > 0) {
foreach my $ignore (@option_ignore_arch_line) {
my ($ignore_arch, $ignore_line) = split /:/, $ignore, 2;
if (not $ignore_arch or not $ignore_line) {
printf STDERR 'Value "%s" invalid for option ignore-arch-line '
. '("arch:line" expected)' . "\n", $ignore;
require Pod::Usage;
Pod::Usage::pod2usage(2);
}
push @{$option_ignore_arch_line{$ignore_arch}}, qr/^$ignore_line$/;
}
}
# Final exit code.
my $exit = 0;
FILE:
foreach my $file (@ARGV) {
print "checking '$file'...\n" if scalar @ARGV > 1;
-f $file or die "No such file: $file";
open my $fh, '<', $file or die $!;
# Architecture of this file.
my $arch = $option_arch;
# Hardening options. Not all architectures support all hardening options.
my $harden_format = 1;
my $harden_fortify = 1;
my $harden_stack = 1;
my $harden_stack_strong = 1;
my $harden_relro = 1;
my $harden_bindnow = $option_bindnow; # defaults to 0
my $harden_pie = $option_pie; # defaults to 0
# Does this build log use ada? Ada also uses gcc as compiler but uses
# different CFLAGS. But only perform ada checks if an ada compiler used
# for performance reasons.
my $ada = 0;
while (my $line = <$fh>) {
# Detect architecture automatically unless overridden. For buildd logs
# only, doesn't use the dpkg-buildpackage header. Necessary to ignore
# build logs which aren't built (wrong architecture, build error,
# etc.).
if (not $arch) {
if (index($line, 'Build Architecture: ') == 0) {
$arch = substr $line, 20, -1; # -1 to ignore '\n' at the end
# For old logs (sbuild << 0.63.0-1).
} elsif (index($line, 'Architecture: ') == 0) {
$arch = substr $line, 14, -1; # -1 to ignore '\n' at the end
}
}
# dpkg-buildflags only provides hardening flags since 1.16.1, don't
# check for hardening flags in buildd mode if an older dpkg-dev is
# used. Default flags (-g -O2) are still checked.
#
# Packages which were built before 1.16.1 but used their own hardening
# flags are not checked.
#
# Strong stack protector is used since dpkg 1.17.11.
if ($option_buildd
and index($line, 'Toolchain package versions: ') == 0) {
require Dpkg::Version;
my $disable = 1;
my $disable_strong = 1;
if ($line =~ /\bdpkg-dev_(\S+)/) {
if (Dpkg::Version::version_compare($1, '1.16.1') >= 0) {
$disable = 0;
}
if (Dpkg::Version::version_compare($1, '1.17.11') >= 0) {
$disable_strong = 0;
}
}
if ($disable) {
$harden_format = 0;
$harden_fortify = 0;
$harden_stack = 0;
$harden_relro = 0;
$harden_bindnow = 0;
$harden_pie = 0;
}
if ($disable_strong) {
$harden_stack_strong = 0;
}
}
# The following two versions of CMake in Debian obeyed CPPFLAGS, but
# this was later dropped because upstream rejected the patch. Thus
# build logs with these versions will have fortify hardening flags
# enabled, even though they may be not correctly set and are missing
# when build with later CMake versions. Thanks to Aron Xu for letting
# me know.
if (index($line, 'Package versions: ') == 0
and $line =~ /\bcmake_(\S+)/
and ($1 eq '2.8.7-1' or $1 eq '2.8.7-2')) {
if (not $option_buildd) {
error_invalid_cmake($1);
$exit |= $exit_code{invalid_cmake};
} else {
print "$buildd_tag{invalid_cmake}|$1|\n";
}
}
# Debian's build daemons use "Filtered Build-Depends:" (or just
# "Build-Depends:" in older versions) for the build dependencies, but
# pbuilder uses "Depends:"; support both.
if (index($line, 'Filtered Build-Depends: ') == 0
or 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.
if ($line =~ /\bhardening-wrapper\b/) {
if (not $option_buildd) {
error_hardening_wrapper();
$exit |= $exit_code{hardening_wrapper};
} else {
print "$buildd_tag{hardening_wrapper}||\n";
}
next FILE;
}
# Ada compiler.
if ($line =~ /\bgnat\b/) {
$ada = 1;
}
}
# We skip over unimportant lines at the beginning of the log to
# prevent false positives.
last if index($line, 'dpkg-buildpackage: ') == 0;
}
# Input lines, contain only the lines with compiler commands.
my @input = ();
# Non-verbose lines in the input. Used to reduce calls to
# is_non_verbose_build() (which is quite slow) in the second loop when
# it's already clear if a line is non-verbose or not.
my @input_nonverbose = ();
my $continuation = 0;
my $complete_line = undef;
my $non_verbose;
while (my $line = <$fh>) {
# And stop at the end of the build log. Package details (reported by
# the buildd logs) are not important for us. This also prevents false
# positives.
last if index($line, 'Build finished at ') == 0
and $line =~ /^Build finished at \d{8}-\d{4}$/;
if (not $continuation) {
$non_verbose = 0;
}
# Detect architecture automatically unless overridden.
if (not $arch
and index($line, 'dpkg-buildpackage: host architecture ') == 0) {
$arch = substr $line, 37, -1; # -1 to ignore '\n' at the end
# Old buildd logs use e.g. "host architecture is alpha", remove
# the "is", otherwise debarch_to_debtriplet() will not detect the
# architecture.
if (index($arch, 'is ') == 0) {
$arch = substr $arch, 3;
}
}
# Ignore compiler warnings for now.
next if $line =~ /$warning_regex/o;
if (not $option_buildd and index($line, "\033") != -1) { # \033 = esc
# Remove all ANSI color sequences which are sometimes used in
# non-verbose builds.
$line = Term::ANSIColor::colorstrip($line);
# Also strip '\0xf' (delete previous character), used by Elinks'
# build system.
$line =~ s/\x0f//g;
# And "ESC(B" which seems to be used on armhf and hurd (not sure
# what it does).
$line =~ s/\033\(B//g;
}
# Check if this line indicates a non verbose build.
my $skip = 0;
$non_verbose |= is_non_verbose_build($line, undef, \$skip);
next if $skip;
# One line may contain multiple commands (";"). Treat each one as
# single line. parse_line() is slow, only use it when necessary.
my @line = (index($line, ';') == -1)
? ($line)
: map {
# Ensure newline at the line end - necessary for
# correct parsing later.
$_ =~ s/\s+$//;
$_ .= "\n";
} Text::ParseWords::parse_line(';', 1, $line);
foreach my $line (@line) {
if ($continuation) {
$continuation = 0;
# Join lines, but leave the "\" in place so it's clear where
# the original line break was.
chomp $complete_line;
$complete_line .= ' ' . $line;
}
# Line continuation, line ends with "\".
if ($line =~ /\\$/) {
$continuation = 1;
# Start line continuation.
if (not defined $complete_line) {
$complete_line = $line;
}
next;
}
# Use the complete line if a line continuation occurred.
if (defined $complete_line) {
$line = $complete_line;
$complete_line = undef;
}
# Ignore lines with no compiler commands.
next if not $non_verbose
and not $line =~ /$cc_regex_normal/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|[Cc]onfigure:) /;
next if $line =~ /^\s*(?:Host\s+)?(?:C(?:\+\+)?\s+)?
[Cc]ompiler[\s.]*:?\s+
/x;
next if $line =~ m{^\s*(?:-\s)?(?:HOST_)?(?:CC|CXX)
\s*=\s*$cc_regex_full
# optional compiler options, don't allow
# "everything" here to prevent false negatives
\s*(?:\s-\S+)*\s*$}xo;
# `moc-qt4`/`moc-qt5` contain '-I.../linux-g++' in their command
# line (or similar for other architectures) which gets recognized
# as a compiler line, but `moc-qt*` is only a preprocessor for Qt
# C++ files. No hardening flags are relevant during this step,
# thus ignore `moc-qt*` lines. The resulting files will be
# compiled in a separate step (and therefore checked).
next if $line =~ m{^\S+/bin/moc(?:-qt[45])?
\s.+\s
-I\S+/mkspecs/[a-z]+-g\++(?:-64)?
\s}x;
# Ignore false positives when the line contains only CC=gcc but no
# other gcc command.
if ($line =~ /(.*)CC=$cc_regex_full(.*)/o) {
my $before = $1;
my $after = $2;
next if not $before =~ /$cc_regex_normal/o
and not $after =~ /$cc_regex_normal/o;
}
# Check if additional hardening options were used. Used to ensure
# they are used for the complete build.
$harden_pie = 1 if any_flags_used($line, @def_cflags_pie,
@def_ldflags_pie);
$harden_bindnow = 1 if any_flags_used($line, @def_ldflags_bindnow);
push @input, $line;
push @input_nonverbose, $non_verbose;
}
}
close $fh or die $!;
# Ignore arch if requested.
if (scalar @option_ignore_arch > 0 and $arch) {
foreach my $ignore (@option_ignore_arch) {
if ($arch eq $ignore) {
print "ignoring architecture '$arch'\n";
next FILE;
}
}
}
if (scalar @input == 0) {
if (not $option_buildd) {
print "No compiler commands!\n";
$exit |= $exit_code{no_compiler_commands};
} else {
print "$buildd_tag{no_compiler_commands}||\n";
}
next FILE;
}
if ($option_buildd) {
$statistics{commands} += scalar @input;
}
# Option or auto detected.
if ($arch) {
# The following was partially copied from dpkg-dev 1.17.11
# (/usr/share/perl5/Dpkg/Vendor/Debian.pm, add_hardening_flags()),
# copyright Raphaël Hertzog , Kees Cook
# , Canonical, Ltd. licensed under GPL version 2 or
# later. Keep it in sync.
require Dpkg::Arch;
my ($abi, $os, $cpu) = Dpkg::Arch::debarch_to_debtriplet($arch);
# Disable unsupported hardening options.
if ($os !~ /^(?:linux|knetbsd|hurd)$/ or
$cpu =~ /^(?:hppa|mips|mipsel|avr32)$/) {
$harden_pie = 0;
}
if ($cpu =~ /^(?:ia64|alpha|mips|mipsel|hppa)$/ or $arch eq 'arm') {
$harden_stack = 0;
$harden_stack_strong = 0;
}
if ($cpu =~ /^(?:ia64|hppa|avr32)$/) {
$harden_relro = 0;
$harden_bindnow = 0;
}
}
# Default values.
my @cflags = @def_cflags;
my @cxxflags = @def_cxxflags;
my @cppflags = @def_cppflags;
my @ldflags = @def_ldflags;
# Check the specified hardening options, same order as dpkg-buildflags.
if ($harden_pie) {
@cflags = (@cflags, @def_cflags_pie);
@cxxflags = (@cxxflags, @def_cflags_pie);
@ldflags = (@ldflags, @def_ldflags_pie);
}
if ($harden_stack_strong) {
@cflags = (@cflags, @def_cflags_stack_strong);
@cxxflags = (@cxxflags, @def_cflags_stack_strong);
} elsif ($harden_stack) {
@cflags = (@cflags, @def_cflags_stack);
@cxxflags = (@cxxflags, @def_cflags_stack);
}
if ($harden_fortify) {
@cflags = (@cflags, @def_cflags_fortify);
@cxxflags = (@cxxflags, @def_cflags_fortify);
@cppflags = (@cppflags, @def_cppflags_fortify);
}
if ($harden_format) {
@cflags = (@cflags, @def_cflags_format);
@cxxflags = (@cxxflags, @def_cflags_format);
}
if ($harden_relro) {
@ldflags = (@ldflags, @def_ldflags_relro);
}
if ($harden_bindnow) {
@ldflags = (@ldflags, @def_ldflags_bindnow);
}
# Stores normal CFLAGS when @cflags_ada are temporarily used.
my @cflags_backup;
# Ada CFLAGS, only set if ada is used.
my @cflags_ada;
# Ada doesn't support format hardening flags, see #680117 for more
# information. Filter them out if ada is used.
if ($ada and $harden_format) {
@cflags_ada = grep {
my $ok = 1;
foreach my $flag (@def_cflags_format) {
$ok = 0 if $_ eq $flag;
}
$ok;
} @cflags;
}
# Hack to fix cppflags_fortify_broken() if --ignore-flag
# -D_FORTIFY_SOURCE=2 is used to ignore missing fortification. Only works
# as long as @def_cppflags_fortify contains only one variable.
if (scalar @def_cppflags_fortify == 0) {
$harden_fortify = 0;
}
# Ignore flags for this arch if requested.
if ($arch and exists $option_ignore_arch_flag{$arch}) {
my @local_flag_refs = (\@cflags, \@cxxflags, \@cppflags, \@ldflags);
remove_flags(\@local_flag_refs,
\%flag_renames,
@{$option_ignore_arch_flag{$arch}});
}
my @ignore_line = @option_ignore_line;
# Ignore lines for this arch if requested.
if ($arch and exists $option_ignore_arch_line{$arch}) {
@ignore_line = (@ignore_line, @{$option_ignore_arch_line{$arch}});
}
LINE:
for (my $i = 0; $i < scalar @input; $i++) {
my $line = $input[$i];
# Ignore line if requested.
foreach my $ignore (@ignore_line) {
next LINE if $line =~ /$ignore/;
}
my $skip = 0;
if ($input_nonverbose[$i]
and is_non_verbose_build($line, $input[$i + 1], \$skip)) {
if (not $option_buildd) {
error_non_verbose_build($line);
$exit |= $exit_code{non_verbose_build};
} else {
$statistics{commands_nonverbose}++;
}
next;
}
# Even if it's a verbose build, we might have to skip this line (see
# is_non_verbose_build()).
next if $skip;
# 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 at the line end.
$line =~ s/['")]+$//;
# Skip unnecessary tests when only preprocessing.
my $flag_preprocess = 0;
my $dependency = 0;
my $preprocess = 0;
my $compile = 0;
my $link = 0;
# Preprocess, compile, assemble.
if ($line =~ /\s(-E|-S|-c)\b/) {
$preprocess = 1;
$flag_preprocess = 1 if $1 eq '-E';
$compile = 1 if $1 eq '-S' or $1 eq '-c';
# Dependency generation for Makefiles. The other flags (-MF -MG -MP
# -MT -MQ) are always used with -M/-MM.
} elsif ($line =~ /\s(?:-M|-MM)\b/) {
$dependency = 1;
# Otherwise assume we are linking.
} else {
$link = 1;
}
# -MD/-MMD also cause dependency generation, but they don't imply -E!
if ($line =~ /\s(?:-MD|-MMD)\b/) {
$dependency = 0;
$flag_preprocess = 0;
}
# Dependency generation for Makefiles, no preprocessing or other flags
# needed.
next if $dependency;
# Get all file extensions on this line.
my @extensions = $line =~ /$file_extension_regex/go;
# Ignore all unknown extensions to speedup the search below.
@extensions = grep { exists $extension{$_} } @extensions;
# These file types don't require preprocessing.
if (extension_found(\%extensions_no_preprocess, @extensions)) {
$preprocess = 0;
}
# These file types require preprocessing.
if (extension_found(\%extensions_preprocess, @extensions)) {
$preprocess = 1;
}
if (not $flag_preprocess) {
# If there are source files then it's compiling/linking in one
# step and we must check both. We only check for source files
# here, because header files cause too many false positives.
if (extension_found(\%extensions_compile_link, @extensions)) {
# Assembly files don't need CFLAGS.
if (not extension_found(\%extensions_compile, @extensions)
and extension_found(\%extensions_no_compile, @extensions)) {
$compile = 0;
# But the rest does.
} else {
$compile = 1;
}
# No compilable extensions found, either linking or compiling
# header flags.
#
# If there are also no object files we are just compiling headers
# (.h -> .h.gch). Don't check for linker flags in this case. Due
# to our liberal checks for compiler lines, this also reduces the
# number of false positives considerably.
} elsif ($link
and not extension_found(\%extensions_object, @extensions)) {
$link = 0;
}
}
my $compile_cpp = 0;
my $compile_ada = 0;
# Assume CXXFLAGS are required when a C++ file is specified in the
# compiler line.
if ($compile
and extension_found(\%extensions_compile_cpp, @extensions)) {
$compile = 0;
$compile_cpp = 1;
# Ada needs special CFLAGS, use them if only ada files are compiled.
} elsif ($ada
and $compile
and array_equal(\@extensions,
\@source_no_preprocess_compile_ada)) {
$compile_ada = 1;
@cflags_backup = @cflags;
@cflags = @cflags_ada;
}
if ($option_buildd) {
$statistics{preprocess}++ if $preprocess;
$statistics{compile}++ if $compile;
$statistics{compile_cpp}++ if $compile_cpp;
$statistics{link}++ if $link;
}
# Check if there are flags indicating a debug build. If that's true,
# skip the check for -O2. This prevents fortification, but that's fine
# for a debug build.
if (any_flags_used($line, @def_cflags_debug)) {
remove_flags([\@cflags], \%flag_renames, $def_cflags[1]);
remove_flags([\@cppflags], \%flag_renames, $def_cppflags_fortify[0]);
}
# Check hardening flags.
my @missing;
if ($compile and not all_flags_used($line, \@missing, @cflags)
# Libraries linked with -fPIC don't have to (and can't) be
# linked with -fPIE as well. It's no error if only PIE flags
# are missing.
and not pic_pie_conflict($line, $harden_pie, \@missing, @def_cflags_pie)
# Assume dpkg-buildflags returns the correct flags.
and index($line, '`dpkg-buildflags --get CFLAGS`') == -1) {
if (not $option_buildd) {
error_flags('CFLAGS missing', \@missing, \%flag_renames, $input[$i]);
$exit |= $exit_code{flags_missing};
} else {
$statistics{compile_missing}++;
}
} elsif ($compile_cpp and not all_flags_used($line, \@missing, @cflags)
# Libraries linked with -fPIC don't have to (and can't) be
# linked with -fPIE as well. It's no error if only PIE flags
# are missing.
and not pic_pie_conflict($line, $harden_pie, \@missing, @def_cflags_pie)
# Assume dpkg-buildflags returns the correct flags.
and index($line, '`dpkg-buildflags --get CXXFLAGS`') == -1) {
if (not $option_buildd) {
error_flags('CXXFLAGS missing', \@missing, \%flag_renames, $input[$i]);
$exit |= $exit_code{flags_missing};
} else {
$statistics{compile_cpp_missing}++;
}
}
if ($preprocess
and (not all_flags_used($line, \@missing, @cppflags)
# The fortify flag might be overwritten, detect that.
or ($harden_fortify
and cppflags_fortify_broken($line, \@missing)))
# Assume dpkg-buildflags returns the correct flags.
and index($line, '`dpkg-buildflags --get CPPFLAGS`') == -1) {
if (not $option_buildd) {
error_flags('CPPFLAGS missing', \@missing, \%flag_renames, $input[$i]);
$exit |= $exit_code{flags_missing};
} else {
$statistics{preprocess_missing}++;
}
}
if ($link and not all_flags_used($line, \@missing, @ldflags)
# Same here, -fPIC conflicts with -fPIE.
and not pic_pie_conflict($line, $harden_pie, \@missing, @def_ldflags_pie)
# Assume dpkg-buildflags returns the correct flags.
and index($line, '`dpkg-buildflags --get LDFLAGS`') == -1) {
if (not $option_buildd) {
error_flags('LDFLAGS missing', \@missing, \%flag_renames, $input[$i]);
$exit |= $exit_code{flags_missing};
} else {
$statistics{link_missing}++;
}
}
# Restore normal CFLAGS.
if ($compile_ada) {
@cflags = @cflags_backup;
}
}
}
# Print statistics for buildd mode, only output in this mode.
if ($option_buildd) {
my @warning;
if ($statistics{preprocess_missing}) {
push @warning, sprintf 'CPPFLAGS %d (of %d)',
$statistics{preprocess_missing},
$statistics{preprocess};
}
if ($statistics{compile_missing}) {
push @warning, sprintf 'CFLAGS %d (of %d)',
$statistics{compile_missing},
$statistics{compile};
}
if ($statistics{compile_cpp_missing}) {
push @warning, sprintf 'CXXFLAGS %d (of %d)',
$statistics{compile_cpp_missing},
$statistics{compile_cpp};
}
if ($statistics{link_missing}) {
push @warning, sprintf 'LDFLAGS %d (of %d)',
$statistics{link_missing},
$statistics{link};
}
if (scalar @warning) {
local $" = ', '; # array join string
print "$buildd_tag{flags_missing}|@warning missing|\n";
}
if ($statistics{commands_nonverbose}) {
printf "$buildd_tag{non_verbose_build}|%d (of %d) hidden|\n",
$statistics{commands_nonverbose},
$statistics{commands},
}
}
exit $exit;
__END__
=head1 NAME
blhc - build log hardening check, checks build logs for missing hardening flags
=head1 SYNOPSIS
B [I] I<< .. >>
=head1 DESCRIPTION
blhc is a small tool which checks build logs for missing hardening flags. It's
licensed under the GPL 3 or later.
It's designed to check build logs generated by Debian's dpkg-buildpackage (or
tools using dpkg-buildpackage like pbuilder or sbuild (which is used for the
official buildd build logs)) to help maintainers detect missing hardening
flags in their packages.
Only gcc is detected as compiler at the moment. If other compilers support
hardening flags as well, please report them.
If there's no output, no flags are missing and the build log is fine.
See F for details about performed checks, auto-detection and
limitations.
=head1 OPTIONS
=over 8
=item B<--all>
Force check for all +all (+pie, +bindnow) hardening flags. By default it's
auto detected.
=item B<--arch> I
Set the specific architecture (e.g. amd64, armel, etc.), automatically
disables hardening flags not available on this architecture. Is detected
automatically if dpkg-buildpackage is used.
=item B<--bindnow>
Force check for all +bindnow hardening flags. By default it's auto detected.
=item B<--buildd>
Special mode for buildds when automatically parsing log files. The following
changes are in effect:
=over 2
=item *
Print tags instead of normal warnings, see L"BUILDD TAGS"> for a list of
possible tags.
=item *
Don't check hardening flags in old log files (if dpkg-dev << 1.16.1 is
detected).
=item *
Don't require Term::ANSIColor.
=item *
Return exit code 0, unless there was a error (-I, -W messages don't count as
error).
=back
=item B<--color>
Use colored (ANSI) output for warning messages.
=item B<--ignore-arch> I
Ignore build logs from architectures matching I. I is a string.
Used to prevent false positives. This option can be specified multiple times.
=item B<--ignore-arch-flag> I:I
Like B<--ignore-flag>, but only ignore flag on I.
=item B<--ignore-arch-line> I:I
Like B<--ignore-line>, but only ignore line on I.
=item B<--ignore-flag> I
Don't print an error when the specific flag is missing in a compiler line.
I is a string.
Used to prevent false positives. This option can be specified multiple times.
=item B<--ignore-line> I
Ignore lines matching the given Perl regex. I is automatically anchored
at the beginning and end of the line to prevent false negatives.
B: Not the input lines are checked, but the lines which are displayed in
warnings (which have line continuation resolved).
Used to prevent false positives. This option can be specified multiple times.
=item B<--pie>
Force check for all +pie hardening flags. By default it's auto detected.
=item B<-h -? --help>
Print available options.
=item B<--version>
Print version number and license.
=back
Auto detection for B<--pie> and B<--bindnow> only works if at least one
command uses the required hardening flag (e.g. -fPIE). Then it's required for
all other commands as well.
=head1 EXAMPLES
Normal usage, parse a single log file.
blhc path/to/log/file
If there's no output, no flags are missing and the build log is fine.
Parse multiple log files. The exit code is ORed over all files.
blhc path/to/directory/with/log/files/*
Don't treat missing C<-g> as error:
blhc --ignore-flag -g path/to/log/file
Don't treat missing C<-pie> on kfreebsd-amd64 as error:
blhc --ignore-arch-flag kfreebsd-amd64:-pie path/to/log/file
Ignore lines consisting exactly of C<./script gcc file> which would cause a
false positive.
blhc --ignore-line '\./script gcc file' path/to/log/file
Ignore lines matching C<./script gcc file> somewhere in the line.
blhc --ignore-line '.*\./script gcc file.*' path/to/log/file
Use blhc with pbuilder.
pbuilder path/to/package.dsc | tee path/log/file
blhc path/to/file || echo flags missing
=head1 BUILDD TAGS
The following tags are used in I<--buildd> mode. In braces the additional data
which is displayed.
=over 2
=item B
The package uses hardening-wrapper which intercepts calls to gcc and adds
hardening flags. The build log doesn't contain any hardening flags and thus
can't be checked by blhc.
=item B (summary of hidden lines)
Build log contains lines which hide the real compiler flags. For example:
CC test-a.c
CC test-b.c
CC test-c.c
LD test
Most of the time either C or C in
F fixes builds with hidden compiler flags. Sometimes C<.SILENT>
in a F must be removed. And as last resort the F must be
patched to remove the C<@>s hiding the real compiler commands.
=item B (summary of missing flags)
CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS missing.
=item B (version)
By default CMake ignores CPPFLAGS thus missing those hardening flags. Debian
patched CMake in versions 2.8.7-1 and 2.8.7-2 to respect CPPFLAGS, but this
patch was rejected by upstream and later reverted in Debian. Thus those two
versions show correct usage of CPPFLAGS even if the package doesn't correctly
handle them (for example by passing them to CFLAGS). To prevent false
negatives just blacklist those two versions.
=item B
No compiler commands were detected. Either the log contains none or they were
not correctly detected by blhc (please report the bug in this case).
=back
=head1 EXIT STATUS
The exit status is a "bit mask", each listed status is ORed when the error
condition occurs to get the result.
=over 4
=item B<0>
Success.
=item B<1>
No compiler commands were found.
=item B<2>
Invalid arguments/options given to blhc.
=item B<4>
Non verbose build.
=item B<8>
Missing hardening flags.
=item B<16>
Hardening wrapper detected, no tests performed.
=item B<32>
Invalid CMake version used. See B under L"BUILDD
TAGS"> for a detailed explanation.
=back
=head1 AUTHOR
Simon Ruderich, Esimon@ruderich.orgE
Thanks to to Bernhard R. Link Ebrlink@debian.orgE and Jaria Alto
Ejari.aalto@cante.netE for their valuable input and suggestions.
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2012-2014 by Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
=head1 SEE ALSO
L, L
=cut
blhc-0.05/t 000700 001750 001750 0 12374753057 12251 5 ustar 00simon simon 000000 000000 blhc-0.05/t/tests.t 000444 001750 001750 204243 12374753057 14014 0 ustar 00simon simon 000000 000000 # Tests for blhc.
#
# Copyright (C) 2012-2014 Simon Ruderich
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
use strict;
use warnings;
use Test::More tests => 218;
sub is_blhc {
my ($file, $options, $exit, $expected) = @_;
# Multiple files as array references.
if (ref $file eq 'ARRAY') {
local $" = ' ./t/logs/';
$file = "@{$file}";
}
$file = "./t/logs/$file" if $file;
my $output = `./bin/blhc $options $file 2>&1`;
if ($options) {
$options = ' '. $options;
}
is $? >> 8, $exit, "$file$options (exit code)";
# Perform regex or string match.
my $cmd = (ref $expected eq 'Regexp')
? \&like
: \&is;
&$cmd($output, $expected, "$file$options (output)");
}
# Usage, invalid arguments.
my $usage =
'Usage:
blhc [*options*] *..*
';
is_blhc '', '--invalid', 2,
"Unknown option: invalid\n"
. $usage;
is_blhc '', '', 2,
$usage;
is_blhc '', '--version', 0,
'blhc 0.05 Copyright (C) 2012-2014 Simon Ruderich
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
';
is_blhc '', '--help', 1,
qr/^Usage:
blhc \[\*options\*\] \*\.\.\*
Options:
/s;
is_blhc 'doesnt-exist', '', 2,
qr{^No such file: \./t/logs/doesnt-exist at \./bin/blhc line \d+\.$};
# No compiler commands found.
my $empty = "No compiler commands!\n";
is_blhc 'empty', '', 1,
$empty;
# ANSI colored output.
is_blhc 'arch-avr32', '--color', 8,
"\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
";
# Ignore missing compiler flags.
is_blhc 'ignore-flag', '--ignore-flag -g', 8,
'CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
';
is_blhc 'ignore-flag', '--ignore-flag -g --ignore-flag -O2', 0,
'';
is_blhc 'ignore-flag-ldflags', '--ignore-flag -fPIE', 0,
'';
# Ignore missing compiler flags for specific architectures.
# Invalid option.
is_blhc 'ignore-flag', '--ignore-arch-flag -g', 2,
'Value "-g" invalid for option ignore-arch-flag ("arch:flag" expected)
Usage:
blhc [*options*] *..*
';
is_blhc 'ignore-flag', '--ignore-arch-flag -g:', 2,
'Value "-g:" invalid for option ignore-arch-flag ("arch:flag" expected)
Usage:
blhc [*options*] *..*
';
is_blhc 'ignore-flag', '--ignore-arch-flag :amd64', 2,
'Value ":amd64" invalid for option ignore-arch-flag ("arch:flag" expected)
Usage:
blhc [*options*] *..*
';
# Wrong architecture.
is_blhc 'ignore-flag', '--ignore-arch-flag amd64:-g', 8,
'CFLAGS missing (-g): gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
';
is_blhc 'arch-i386', '--ignore-arch-flag i386:-fstack-protector-strong', 8,
'LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-flag i386:-pie', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
';
is_blhc 'arch-i386', '--ignore-arch-flag i386:-fstack-protector-strong --ignore-arch-flag i386:-pie', 0,
'';
# Wrong architecture.
is_blhc 'arch-i386', '--ignore-arch-flag amd64:-fstack-protector-strong', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-flag amd64:-pie', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-flag amd64:-fstack-protector-strong --ignore-arch-flag amd64:-pie', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
# Ignore certain lines.
is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c"', 8,
'CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
';
is_blhc 'ignore-line', '--ignore-line "\./prepare-script gcc test-[a-z]\.c" --ignore-line "\s*\./prepare-script gcc test-[a-z]\.c .+"', 0,
'';
# Ignore certain lines for specific architectures.
# Invalid option.
is_blhc 'ignore-line', '--ignore-arch-line .+', 2,
'Value ".+" invalid for option ignore-arch-line ("arch:line" expected)
Usage:
blhc [*options*] *..*
';
is_blhc 'ignore-line', '--ignore-arch-line .+:', 2,
'Value ".+:" invalid for option ignore-arch-line ("arch:line" expected)
Usage:
blhc [*options*] *..*
';
is_blhc 'ignore-line', '--ignore-arch-line :amd64', 2,
'Value ":amd64" invalid for option ignore-arch-line ("arch:line" expected)
Usage:
blhc [*options*] *..*
';
# Wrong architecture.
is_blhc 'ignore-line', '--ignore-arch-line "amd64:.+"', 8,
'CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-b.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-b.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-c.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-c.c
';
# Line regex anchored at beginning/end of the line.
is_blhc 'arch-i386', '--ignore-arch-line "i386:-fPIE"', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -fPIE .+ test\.c"', 8,
'LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
';
is_blhc 'arch-i386', '--ignore-arch-line "i386:gcc .+ -fPIE .+ test\.c" --ignore-arch-line "i386:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 0,
'';
# Wrong architecture.
is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -fPIE .+ test\.c"', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '--ignore-arch-line "amd64:gcc .+ -fPIE .+ test\.c" --ignore-arch-line "amd64:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
# Correct build logs.
is_blhc 'good', '', 0,
'';
is_blhc 'good-pie', '', 0,
'';
is_blhc 'good-pie', '--pie', 0,
'';
is_blhc 'good-bindnow', '', 0,
'';
is_blhc 'good-bindnow', '--bindnow', 0,
'';
is_blhc 'good-all', '', 0,
'';
is_blhc 'good-all', '--all', 0,
'';
is_blhc 'good-all', '--pie --bindnow', 0,
'';
is_blhc 'good-multiline', '', 0,
'';
is_blhc 'good-library', '--all', 0,
'';
# Build logs with missing flags.
is_blhc 'bad', '', 8,
'CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
LDFLAGS missing (-Wl,-z,relro): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
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
LDFLAGS missing (-Wl,-z,relro): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-Wl,-z,relro): gcc test.c
CXXFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
';
is_blhc 'bad', '--pie', 8,
'CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
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
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
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
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.a
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc test.c
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
';
is_blhc 'bad', '--bindnow', 8,
'CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
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
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
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
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
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc test.c
CXXFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
';
my $bad_pie_bindnow =
'CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-b.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-b.c
CFLAGS missing (-fPIE -fstack-protector-strong -Wformat -Werror=format-security): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): x86_64-linux-gnu-gcc -g -O2 -c test-c.c
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
CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
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
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
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
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.a
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -o test test.S
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -E test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -S test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -S test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc test.c
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MD -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MD -MF test.d -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MMD -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MMD -c test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -MT -MMD -MF test.d -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -MT -MMD -MF test.d -c test.c
';
is_blhc 'bad', '--pie --bindnow', 8,
$bad_pie_bindnow;
is_blhc 'bad', '--all', 8,
$bad_pie_bindnow;
is_blhc 'bad-cflags', '', 8,
'CFLAGS missing (-Wformat): gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
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
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -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-strong -Wformat -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-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fPIE -Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
LDFLAGS missing (-fPIE -pie): gcc -Wl,-z,relro -o test test.c -ltest
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -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-strong -Wformat -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-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
LDFLAGS missing (-Wl,-z,now): gcc -Wl,-z,relro -o test test.c -ltest
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
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
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -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-strong -Wformat -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-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fPIE -Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc -Wl,-z,relro -o test test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wl,-z,relro -o test test.c -ltest
LDFLAGS missing (-fPIE -pie -Wl,-z,now): gcc -Wl,-z,relro -o test test.c -ltest
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -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-strong -Wformat -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,
'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-c.c
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
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-b.c
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
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
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
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -U_FORTIFY_SOURCE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-g.c
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
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
';
is_blhc 'bad-cppflags', '--ignore-flag -D_FORTIFY_SOURCE=2', 0,
'';
my $bad_ldflags =
'LDFLAGS missing (-Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
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
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
';
is_blhc 'bad-ldflags', '', 8,
$bad_ldflags;
is_blhc 'bad-ldflags', '--pie', 8,
'CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro): gcc -o test test-a.o test-b.o test-c.o -ltest
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
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
';
is_blhc 'bad-ldflags', '--bindnow', 8,
'LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
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
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
';
is_blhc 'bad-ldflags', '--pie --bindnow', 8,
'CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc -o test test-a.o test-b.o test-c.o -ltest
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
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
';
is_blhc 'bad-multiline', '', 8,
'CFLAGS missing (-Wformat): gcc \ -g -O2 -fstack-protector-strong\ -Wformat-security\ -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security\ -D_FORTIFY_SOURCE=2\ -c test-b.c
CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
LDFLAGS missing (-Wl,-z,relro): gcc -o\ test test-c.o test-a.o test-b.o\ -ltest
LDFLAGS missing (-Wl,-z,relro): gcc -o \ test test-c.o test-b.o test-a.o\
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -o \ test test-b.o test-a.o test-c.c\
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -o \ test test-b.o test-a.o test-c.c\
LDFLAGS missing (-Wl,-z,relro): gcc -o \ test test-b.o test-a.o test-c.c\
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-Werror=format-security): gcc -g -O2 -fstack-protector-strong -Wformat -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat): gcc -Wformat-security -Werror=format-security -c test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -Wformat-security -Werror=format-security -c test-b.c
CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
CFLAGS missing (-g -fstack-protector-strong -Wformat -Werror=format-security): \ gcc -O2 -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fstack-protector-strong): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -c test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -c test-a.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): \ gcc -D_FORTIFY_SOURCE=2 -c test-b.c
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
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
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
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
';
is_blhc 'bad-library', '--all', 8,
'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
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
LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,--as-needed -o libtest.so
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so
LDFLAGS missing (-Wl,-z,now): gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0
LDFLAGS missing (-Wl,-z,relro): gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): /usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz
LDFLAGS missing (-Wl,-z,relro -Wl,-z,now): gcc -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt
CFLAGS missing (-fPIE): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
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
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
';
# check the build log is verbose
is_blhc 'verbose-build', '', 12,
'NONVERBOSE BUILD: checking if you want to see long compiling messages... no
NONVERBOSE BUILD: CC libtest-a.lo
NONVERBOSE BUILD: CC libtest-b.lo
NONVERBOSE BUILD: CC libtest_c.lo
NONVERBOSE BUILD: CC libtest-d.lo
NONVERBOSE BUILD: CCLD libtest.la
NONVERBOSE BUILD: LINK libtest.la
NONVERBOSE BUILD: CXX libtest-a.lo
NONVERBOSE BUILD: CXX libtest-b.lo
NONVERBOSE BUILD: CXX libtest_c.lo
NONVERBOSE BUILD: CXX libtest-d.lo
NONVERBOSE BUILD: CXXLD libtest.la
NONVERBOSE BUILD: [CC] src/test-a.o
NONVERBOSE BUILD: [CC] src/test-b.o
NONVERBOSE BUILD: [CC] src/test_c.o
NONVERBOSE BUILD: [CXX] src/test-d.o
NONVERBOSE BUILD: [LD] src/test.o
NONVERBOSE BUILD: [CC] src/test-a.o
NONVERBOSE BUILD: [CC] src/test-b.o
NONVERBOSE BUILD: [CC] src/test_c.o
NONVERBOSE BUILD: [LD] src/test.o
NONVERBOSE BUILD: [CC] src/test-a.o
NONVERBOSE BUILD: [CC] src/test-b.o
NONVERBOSE BUILD: [CC] src/test_c.o
NONVERBOSE BUILD: [LD] src/test.o
NONVERBOSE BUILD: CC modules/server/test.c
NONVERBOSE BUILD: C++ test/test.o
NONVERBOSE BUILD: C++ test.cpp
NONVERBOSE BUILD: Building program ../build/bin/test
NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
NONVERBOSE BUILD: Compiling test/test.cc to ../build/test/test.o
NONVERBOSE BUILD: Building shared library ../build/test/libtest.so.1.2.3
NONVERBOSE BUILD: Compiling test.cc to ../build/test/test.o
NONVERBOSE BUILD: Building program ../build/bin/test
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
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
CXXFLAGS missing (-Wformat): g++ -c -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
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
LDFLAGS missing (-Wl,-z,relro): g++ ../build/obj/test/test.o -o /../build/bin/test
NONVERBOSE BUILD: Compiling test_file.cxx...
CXXFLAGS missing (-fstack-protector-strong): g++ -g -O2 -fPIC -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test_file.cxx
NONVERBOSE BUILD: [ 22%] Building CXX object src/CMakeFiles/test/test.cpp.o
NONVERBOSE BUILD: [ 82%] Building C object src/CMakeFiles/test/test.c.o
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
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
NONVERBOSE BUILD: Compiling test.c \ gcc test.c
';
# handle debug builds
is_blhc 'debug-build', '', 0, '';
# configure/make
is_blhc 'configure', '', 1,
$empty;
is_blhc 'configure-check', '', 4,
'NONVERBOSE BUILD: CC = gcc -std=gnu99 -std=gnu99 test.c
';
is_blhc 'make', '', 1,
$empty;
# qt4
is_blhc 'qt4', '', 1,
$empty;
# cc
is_blhc 'cc', '--pie --bindnow', 8,
'CXXFLAGS missing (-fPIE -Wformat): cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cc
CFLAGS missing (-fPIE -Wformat): cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
CFLAGS missing (-fPIE -fstack-protector-strong): cc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-fPIE -Werror=format-security): cc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
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
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): cc\ test.cc
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc\ test.cc
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): cc\ test.cc
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): cc\ test.cc
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): cc\ test.cc
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): cc\ test.cc
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
';
# gcc
is_blhc 'gcc', '--pie --bindnow', 8,
'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
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
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
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
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc\ test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc\ test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc\ test.c
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): gcc\ test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc\ test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): gcc\ test.c
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
';
# c++
is_blhc 'c++', '--pie --bindnow', 8,
'CXXFLAGS missing (-fPIE -Wformat): c++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
CXXFLAGS missing (-fPIE -fstack-protector-strong): c++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
CXXFLAGS missing (-fPIE -Werror=format-security): c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
CXXFLAGS missing (-fPIE): c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
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
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c++
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c++
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c++
CXXFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): c++\ test.c++
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): c++\ test.c++
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): c++\ test.c++
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
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
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
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
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
';
# g++
is_blhc 'g++', '--pie --bindnow', 8,
'CXXFLAGS missing (-fPIE -Wformat): g++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
CXXFLAGS missing (-fPIE -fstack-protector-strong): g++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
CXXFLAGS missing (-fPIE -Werror=format-security): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
CXXFLAGS missing (-fPIE): g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
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
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
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
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
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
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
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): g++\ test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++\ test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,relro -Wl,-z,now): g++\ test.c
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
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
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
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
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
';
# ada
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
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-strong -Wformat -Werror=format-security): gcc -c -g -O2 test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c -g -O2 test.c
CFLAGS missing (-fstack-protector-strong -Wformat -Werror=format-security): gcc -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 'libtool', '--bindnow', 12,
'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
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
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
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
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
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z -Wl,relro -o test test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: cc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc-4.6 -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: x86_64-linux-gnu-g++ -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.o
NONVERBOSE BUILD: /bin/bash /tmp/test/build/libtool --silent --tag CC --mode=relink gcc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: relink: gcc -Wl,-z,relro -o test.so test.o
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: relink: g++ -Wl,-z,relro -o test.la test.o
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
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
CFLAGS missing (-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security): libtool: link: gcc -Wl,-z,relro -o test.so test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): libtool: link: gcc -Wl,-z,relro -o test.so test.c
LDFLAGS missing (-fPIE -pie -Wl,-z,now): libtool: link: gcc -Wl,-z,relro -o test.so test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): libtool: link: gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
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
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): libtool: link: gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
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
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
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
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
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
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
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
';
# different architectures
my $arch_avr32 =
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
';
is_blhc 'arch-avr32', '', 8,
$arch_avr32;
my $arch_i386 =
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
';
is_blhc 'arch-i386', '', 8,
$arch_i386;
my $arch_ia64 =
'CFLAGS missing (-fPIE): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -o test test.o
';
is_blhc 'arch-ia64', '', 8,
$arch_ia64;
is_blhc 'arch-mipsel', '', 8,
'CFLAGS missing (-Werror=format-security): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Wall -c test.c
LDFLAGS missing (-Wl,-z,relro): gcc -Wl,-z,now -o test test.o
';
is_blhc 'arch-ia64', '--arch i386', 8,
'CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-Wl,-z,relro): gcc -fPIE -pie -o test test.o
CFLAGS missing (-fPIE -fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie -Wl,-z,relro): gcc -fPIE -o test test.o
';
# architecture in older buildd logs
is_blhc 'dpkg-buildpackage-architecture-old', '', 0,
'';
# correct architecture detection
is_blhc 'buildd-architecture', '', 0, '';
is_blhc 'buildd-architecture-old', '', 0, '';
# ignore architecture
is_blhc ['arch-avr32', 'arch-i386', 'empty', 'arch-mipsel'],
'--ignore-arch avr32 --ignore-arch mipsel',
9,
"checking './t/logs/arch-avr32'...\n"
. "ignoring architecture 'avr32'\n"
. "checking './t/logs/arch-i386'...\n"
. $arch_i386
. "checking './t/logs/empty'...\n"
. $empty
. "checking './t/logs/arch-mipsel'...\n"
. "ignoring architecture 'mipsel'\n"
;
is_blhc 'buildd-dpkg-dev', '--ignore-arch i386', 0,
"ignoring architecture 'i386'\n";
# debian
is_blhc 'debian', '', 8,
'CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c `dpkg-buildflags --get CFLAGS` test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): g++ -c `dpkg-buildflags --get CXXFLAGS` test.cc
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): gcc -c `dpkg-buildflags --get LDFLAGS` test.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): gcc -c `dpkg-buildflags --get LDFLAGS` test.c
LDFLAGS missing (-Wl,-z,relro): gcc -o test test.o `dpkg-buildflags --get CFLAGS`
';
is_blhc 'debian-cmake', '', 32,
'INVALID CMAKE: 2.8.7-1
';
is_blhc 'debian-cmake-2', '', 32,
'INVALID CMAKE: 2.8.7-2
';
is_blhc 'debian-cmake-ok', '', 0,
'';
my $debian_hardening_wrapper =
'HARDENING WRAPPER: no checks possible, aborting
';
is_blhc 'debian-hardening-wrapper', '', 16,
$debian_hardening_wrapper;
is_blhc 'debian-hardening-wrapper-old-build-depends', '', 16,
$debian_hardening_wrapper;
is_blhc 'debian-hardening-wrapper-pbuilder', '', 16,
$debian_hardening_wrapper;
# false positives
is_blhc 'false-positives', '', 1,
$empty;
# buildd support
is_blhc 'empty', '--buildd', 0,
'I-no-compiler-commands||
';
is_blhc 'buildd-package-details', '--buildd', 0,
'';
is_blhc 'buildd-dpkg-dev', '--buildd', 0,
'W-dpkg-buildflags-missing|CPPFLAGS 7 (of 7), CFLAGS 6 (of 6), CXXFLAGS 1 (of 1), LDFLAGS 2 (of 2) missing|
';
is_blhc 'buildd-dpkg-dev-old', '--buildd', 0,
'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
';
is_blhc 'buildd-dpkg-dev-missing', '--buildd', 0,
'W-dpkg-buildflags-missing|CFLAGS 3 (of 6), CXXFLAGS 1 (of 1) missing|
';
# Older dpkg versions use -fstack-protector instead of -strong.
is_blhc 'buildd-dpkg-fstack-protector', '--buildd', 0,
'';
is_blhc 'buildd-dpkg-fstack-protector-missing', '--buildd', 0,
'W-dpkg-buildflags-missing|CFLAGS 5 (of 5) missing|
';
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|3 (of 5) hidden|
';
is_blhc 'make', '--buildd', 0,
'I-no-compiler-commands||
';
is_blhc 'debian-cmake', '--buildd', 0,
'I-invalid-cmake-used|2.8.7-1|
';
# multiple files
is_blhc ['good', 'good-pie', 'good-bindnow', 'good-all', 'good-multiline', 'good-library'], '', 0,
"checking './t/logs/good'...
checking './t/logs/good-pie'...
checking './t/logs/good-bindnow'...
checking './t/logs/good-all'...
checking './t/logs/good-multiline'...
checking './t/logs/good-library'...
";
is_blhc ['good-all', 'good-library'], '--all', 0,
"checking './t/logs/good-all'...
checking './t/logs/good-library'...
";
is_blhc ['arch-i386', 'arch-ia64'], '', 8,
"checking './t/logs/arch-i386'...\n"
. $arch_i386
. "checking './t/logs/arch-ia64'...\n"
. $arch_ia64;
# No exit when multiple files are specified.
is_blhc ['bad-ldflags', 'empty', 'arch-avr32', 'debian-hardening-wrapper'], '', 25,
"checking './t/logs/bad-ldflags'...\n"
. $bad_ldflags
. "checking './t/logs/empty'...\n"
. $empty
. "checking './t/logs/arch-avr32'...\n"
. $arch_avr32
. "checking './t/logs/debian-hardening-wrapper'...\n"
. $debian_hardening_wrapper
;
# Ignore works correctly with multiple architectures.
is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-flag'],
'--ignore-arch-flag i386:-fstack-protector-strong --ignore-arch-flag mipsel:-Werror=format-security', 8,
"checking './t/logs/arch-i386'...
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
checking './t/logs/arch-amd64'...
CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
checking './t/logs/arch-avr32'...
CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
checking './t/logs/ignore-flag'...
CFLAGS missing (-g): gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
CFLAGS missing (-O2): gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
"
;
is_blhc ['arch-i386', 'arch-amd64', 'arch-avr32', 'ignore-line'],
'--ignore-arch-line "i386:gcc .+ -fPIE .+" --ignore-arch-line "mipsel:gcc .+ -Wl,-z,relro -Wl,-z,now .+"', 8,
"checking './t/logs/arch-i386'...
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
checking './t/logs/arch-amd64'...
CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
LDFLAGS missing (-pie): gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
checking './t/logs/arch-avr32'...
CFLAGS missing (-fstack-protector-strong): gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
checking './t/logs/ignore-line'...
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c test-b.c test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c test-b.c test-c.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c test-b.c test-c.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-a.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-a.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-a.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-b.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-b.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-b.c
CFLAGS missing (-g -O2 -fstack-protector-strong -Wformat -Werror=format-security): ./prepare-script gcc test-c.c
CPPFLAGS missing (-D_FORTIFY_SOURCE=2): ./prepare-script gcc test-c.c
LDFLAGS missing (-Wl,-z,relro): ./prepare-script gcc test-c.c
"
;
blhc-0.05/t/logs 000700 001750 001750 0 12374753057 13215 5 ustar 00simon simon 000000 000000 blhc-0.05/t/logs/debian-hardening-wrapper-old-build-depends 000444 001750 001750 422 12374753057 23413 0 ustar 00simon simon 000000 000000 # Old buildd versions used Build-Depends instead of Filtered Build-Depends.
Build-Depends: .., hardening-wrapper, ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/buildd-dpkg-dev-missing 000444 001750 001750 505 12374753057 17700 0 ustar 00simon simon 000000 000000 Toolchain package versions: ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
gcc -g -c test-a.c
gcc -g -c test-b.c
gcc -g -c test-c.c
gcc -g -c test-d.cpp
gcc -o test test-a.o test-b.o test-c.o test-d.cpp.o -ltest
blhc-0.05/t/logs/buildd-dpkg-fstack-protector 000444 001750 001750 1650 12374753057 20767 0 ustar 00simon simon 000000 000000 Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# --parm=ssp-buffer-size=4 can also be written with a space.
gcc -g -O2 -fstack-protector --param ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c
Build finished at 20120308-1648
blhc-0.05/t/logs/good-pie 000444 001750 001750 745 12374753057 15000 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -fPIE -pie -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/ada 000444 001750 001750 1365 12374753057 14041 0 ustar 00simon simon 000000 000000 Filtered Build-Depends: ..., gnat, gnat-4.6, ...
dpkg-buildpackage: source package ada package
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-a.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-b.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-c.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -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
blhc-0.05/t/logs/ignore-flag 000444 001750 001750 615 12374753057 15463 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
blhc-0.05/t/logs/good 000444 001750 001750 6227 12374753057 14246 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
configure: running /bin/bash ./configure ... 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,defs -Wl,--as-needed' ...
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# -Wformat-security is implied by -Werror=format-security and no longer used
# since dpkg >= 1.16.3.
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# -Wformat=2 implies -Wformat.
gcc -g -O2 -fstack-protector-strong -Wformat=2 -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c
# Compiling and linking in one step must also check CFLAGS/CPPFLAGS.
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro -o test test.c -ltest
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
g++ -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram -Wl,-z,relro ../src/test/testProgram.cpp
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
g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -Wl,-z,relro ../src/test/objs/test.o -o ../src/test/bin/test
gcc -D_FORTIFY_SOURCE=2 -c -o test.o test.S
gcc -c -o test.o test.s
gcc -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c -D_FORTIFY_SOURCE=2 ../../../../src/test/test.c -o test.so.o
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -Wl,-z,relro test.c -o test.output
gcc -E -D_FORTIFY_SOURCE=2 test.c
gcc -S -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 test.c
gcc -Wl,-z,relro -o test test.cpp.o
command --cc test
gcc -MM test.c > test.d
gcc -MM -MT test.d test.c
blhc-0.05/t/logs/libtool 000444 001750 001750 16467 12374753057 15011 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
/bin/bash ../../libtool --tag=CC --mode=compile x86_64-linux-gnu-gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
libtool: compile: x86_64-linux-gnu-gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
/bin/bash ../../libtool --tag=CC --mode=compile x86_64-linux-gnu-g++ -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cpp
libtool: compile: x86_64-linux-gnu-g++ -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cpp
/bin/bash ../../libtool --tag=CC --mode=compile gcc-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
libtool: compile: gcc-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.c
/bin/bash ../../libtool --tag=CXX --mode=compile g++-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cc
libtool: compile: g++-4.6 -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -c test.cc
libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -pie -Wl,relro -Wl,now -o test.so
libtool: link: g++ -shared test-a.o test-b.o test-b.o test-c.o -O2 -Wl,relro -o test.so
libtool: link: gcc -Wl,-z -Wl,relro -o test test.o
/bin/bash ../../../libtool --mode=link cc -Wl,-z,relro -o test.so test.o
libtool: link: cc -Wl,-z,relro -o test.so test.o
/bin/bash ../../../libtool --mode=link gcc-4.6 -Wl,-z,relro -o test.so test.o
libtool: link: gcc-4.6 -Wl,-z,relro -o test.so test.o
/bin/bash ../libtool --tag=CXX --mode=link x86_64-linux-gnu-g++ -Wl,-z,relro -o test.so test.o
libtool: link: x86_64-linux-gnu-g++ -Wl,-z,relro -o test.so test.o
/bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o
libtool: link: gcc -Wl,-z,relro -o test.so test.o
/bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
libtool: link: gcc -Wl,-z,relro -o test/test-4.2~_4711/test.so test.o
/bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o
libtool: link: gcc -Wl,-z,relro -o test.so test.o
/bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.o
libtool: link: gcc -Wl,-z,relro -o test.so test.o
/bin/bash ../../libtool --tag=CC --preserve-dup-deps --mode=link gcc -Wl,-z,relro -o test.so test.o
libtool: link: gcc -Wl,-z,relro -o test.so test.o
/bin/bash /tmp/test/build/libtool --silent --tag CC --mode=relink gcc -Wl,-z,relro -o test.so test.o
libtool: relink: gcc -Wl,-z,relro -o test.so test.o
/bin/bash /tmp/test/build/libtool --tag CXX --mode=relink g++ -Wl,-z,relro -o test.la test.o
libtool: relink: g++ -Wl,-z,relro -o test.la test.o
# Make sure ".libs/test" is treated as a binary.
/bin/bash ../libtool --tag=CC --mode=link gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z,relro -o test test.o
libtool: link: gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z,relro -o test test.o
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z -Wl,relro -o .libs/test test.o
# Just to be sure, libtool won't do this. Note the test.c.
/bin/bash ../libtool --tag=CC --mode=link gcc -Wl,-z,relro -o test.so test.c
libtool: link: gcc -Wl,-z,relro -o test.so test.c
libtool: install: /usr/bin/install -c ...
/bin/bash ./libtool --mode=install /usr/bin/install -c ...
/bin/bash ../../libtool --mode=install /usr/bin/install -c ...
/bin/bash ../../libtool --mode=install /usr/bin/install -c ...
/bin/bash ../../../libtool --mode=install /usr/bin/install -c ...
/bin/sh ../libtool --mode=link gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
libtool: link: gcc -Wl,-z,relro -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
/bin/sh ../libtool --mode=link gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
libtool: link: gcc -o libtest.la test.h test-a.lo test-b.lo test-c.lo test-d.la
# Debian bug #717598:
/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
/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
/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
/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
/bin/bash ../libtool --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
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wconversion -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -MT coloredstderr.lo -MD -MP -MF .deps/coloredstderr.Tpo -c coloredstderr.c -fPIC -DPIC -o .libs/coloredstderr.o
mv -f .deps/coloredstderr.Tpo .deps/coloredstderr.Plo
/bin/bash ../libtool --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
libtool: link: gcc -shared -fPIC -DPIC .libs/coloredstderr.o -ldl -O2 -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-soname -Wl,libcoloredstderr.so.0 -o .libs/libcoloredstderr.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libcoloredstderr.so.0" && ln -s "libcoloredstderr.so.0.0.0" "libcoloredstderr.so.0")
libtool: link: (cd ".libs" && rm -f "libcoloredstderr.so" && ln -s "libcoloredstderr.so.0.0.0" "libcoloredstderr.so")
libtool: link: ( cd ".libs" && rm -f "libcoloredstderr.la" && ln -s "../libcoloredstderr.la" "libcoloredstderr.la" )
/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
mv -f .deps/coloredstderr.Tpo .deps/coloredstderr.Plo
/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
blhc-0.05/t/logs/debian 000444 001750 001750 2134 12374753057 14531 0 ustar 00simon simon 000000 000000 Filtered Build-Depends: .., gcc (>= 4:4.4.3), g++ (>= 4:4.4.3), ...
Toolchain package versions: ...
Package versions: ...
dpkg-buildpackage: source package test
dh_auto_configure -- CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security" LDFLAGS="-Wl,-z,relro -Wl,-z,defs -Wl,--as-needed" ...
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
# `...` isn't expanded by the Makefile, assume dpkg-buildflags returns the
# correct flags.
gcc -c `dpkg-buildflags --get CFLAGS` test.c
g++ -c `dpkg-buildflags --get CXXFLAGS` test.cc
gcc -c `dpkg-buildflags --get LDFLAGS` test.c
gcc -c `dpkg-buildflags --get CFLAGS` `dpkg-buildflags --get CPPFLAGS` test.c
g++ -c `dpkg-buildflags --get CXXFLAGS` `dpkg-buildflags --get CPPFLAGS` test.cc
gcc -o test test.o `dpkg-buildflags --get LDFLAGS`
gcc -o test test.o `dpkg-buildflags --get CFLAGS`
Build finished at 20120308-1648
Depends: libc6 (>= 2.7), gcc
blhc-0.05/t/logs/arch-i386 000444 001750 001750 714 12374753057 14675 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture i386
# all hardening options
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test test.o
# missing flags
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
blhc-0.05/t/logs/debian-cmake-ok 000444 001750 001750 1234 12374753057 16216 0 ustar 00simon simon 000000 000000 Package versions: ... cmake_2.8.7-3 cmake-data_2.8.7-3 ...
dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
Build finished at 20120308-1648
blhc-0.05/t/logs/good-bindnow 000444 001750 001750 723 12374753057 15657 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -Wl,-z,relro -Wl,-z,now -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/cc 000444 001750 001750 1222 12374753057 13671 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cc
cc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
cc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
cc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
cc -Wl,-z,defs -o test test-a.o test-b.o test-c.o -ltest
rm cc-test.h
cc\
test.cc
cc\
test.cc
rm test.cc
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
blhc-0.05/t/logs/buildd-architecture-old 000444 001750 001750 354 12374753057 17770 0 ustar 00simon simon 000000 000000 # Old logs used Architecture instead of Build Architecture (sbuild <<
# 0.63.0-1).
Architecture: mipsel
dpkg-buildpackage: source package test
gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c
blhc-0.05/t/logs/arch-ia64 000444 001750 001750 617 12374753057 14751 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture ia64
# no stack protector and no relro,bindnow
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -pie -o test test.o
# missing flags
gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -o test test.o
blhc-0.05/t/logs/bad-ldflags 000444 001750 001750 1273 12374753057 15452 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
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
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
blhc-0.05/t/logs/buildd-verbose-build 000444 001750 001750 1112 12374753057 17305 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
CC libtest-a.lo
/bin/bash ../libtool --silent --tag=CC --mode=compile gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -W -Wall -c -o libtest-a.lo `test -f 'libtest-a.c' || echo './'`libtest-a.c
CC libtest-b.lo
/bin/bash ../libtool --silent --tag=CC --mode=compile gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -W -Wall -c -o libtest-b.lo `test -f 'libtest-b.c' || echo './'`libtest-b.c
CCLD libtest.la
blhc-0.05/t/logs/debian-cmake 000444 001750 001750 1234 12374753057 15607 0 ustar 00simon simon 000000 000000 Package versions: ... cmake_2.8.7-1 cmake-data_2.8.7-1 ...
dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
Build finished at 20120308-1648
blhc-0.05/t/logs/good-multiline 000444 001750 001750 4266 12374753057 16247 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Command over multiple lines.
gcc -g -O2 -fstack-protector-strong \
\
-Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc \
-g -O2 \
-fstack-protector-strong -Wformat \
-Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c\
test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc \
-Wl,-z,relro \
-o \
test \
test-a.o test-b.o test-c.o \
-ltest
gcc \
-Wl,-z,relro \
-o\
test \
test-a.o test-b.o test-c.o \
-ltest
gcc \
-Wl,-z,relro \
-o\
test\
test-a.o test-b.o test-c.o \
-ltest
# Multiple commands in a single line.
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c; gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c ; gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c;\
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c ; \
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
# Escaped ";" - not really useful, just to check it works.
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security \; -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed 's/.../; s/.../'` -D_FORTIFY_SOURCE=2 -o test.o
gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed "s/.../; s/.../"` -D_FORTIFY_SOURCE=2 -o test.o
blhc-0.05/t/logs/c++ 000444 001750 001750 2763 12374753057 13667 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... none
c++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
c++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
c++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
c++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
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
rm c++test.h
c++\
test.c
rm test.c++
c++\
test.c++
c++\
test.c++
c++-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
c++-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
c++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
c++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
c++-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
blhc-0.05/t/logs/ignore-flag-ldflags 000444 001750 001750 150 12374753057 17067 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -pie -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/bad-multiline 000444 001750 001750 3477 12374753057 16050 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Command over multiple lines.
gcc \
-g -O2 -fstack-protector-strong\
-Wformat-security\
-Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -Wformat -Wformat-security -Werror=format-security\
-D_FORTIFY_SOURCE=2\
-c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o\
-ltest
gcc -o\
test test-c.o test-a.o test-b.o\
-ltest
gcc -o \
test test-c.o test-b.o test-a.o\
gcc -o \
test test-b.o test-a.o test-c.c\
# Multiple commands in a single line.
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c; gcc -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -D_FORTIFY_SOURCE=2 -c test-a.c ; gcc -Wformat-security -Werror=format-security -c test-b.c
gcc -g -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c;\
gcc -O2 -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -c test-a.c ; \
gcc -D_FORTIFY_SOURCE=2 -c test-b.c
# Escaped ";" - not really useful, just to check it works.
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security \; -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-a.c
if ./bin-aux/missing --run makeinfo \
test.texi > test.info; \
then \
echo good; \
else
echo bad; \
fi; \
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-b.c
gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed 's/.../; s/.../'` -o test.o
gcc -c test.c `echo -g -O2 -fstack-protector-strong echo -Wformat -Wformat-security -Werror=format-security | sed "s/.../; s/.../"` -o test.o
blhc-0.05/t/logs/make 000444 001750 001750 521 12374753057 14202 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Output by make which should be ignored.
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-strong -Wformat -Wformat-security -Werror=format-security -Wl,-z,relro -Wl,--as-needed"
blhc-0.05/t/logs/buildd-dpkg-dev 000444 001750 001750 571 12374753057 16234 0 ustar 00simon simon 000000 000000 Build Architecture: i386
Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -g -O2 -c test-d.cpp
gcc -o test test-a.o test-b.o test-c.o -test-d.cpp.o -ltest
gcc -g -c test-a.c
gcc -g -c test-b.c
gcc -g -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/empty 000444 001750 001750 0 12374753057 14353 0 ustar 00simon simon 000000 000000 blhc-0.05/t/logs/gcc 000444 001750 001750 1340 12374753057 14041 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
checking for x86_64-linux-gnu-gcc... gcc-4.6
gcc-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cc
gcc-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o -ltest
rm gcc-test.h
gcc\
test.c
gcc\
test.c
rm test.gcc
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
blhc-0.05/t/logs/buildd-dpkg-dev-old 000444 001750 001750 534 12374753057 17007 0 ustar 00simon simon 000000 000000 Toolchain package versions: ... dpkg-dev_1.15.8.10 ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
gcc -g -c test-a.c
gcc -g -c test-b.c
gcc -g -c test-c.c
gcc -g -c test-d.cpp
gcc -o test test-a.o test-b.o test-c.o test-d.cpp.o -ltest
blhc-0.05/t/logs/debug-build 000444 001750 001750 3161 12374753057 15473 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# -D_FORTIFY_SOURCE=2 requires -O2 to work, therfore ignore it for debug
# lines.
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-b.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-c.c
gcc -g -O0 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
gcc -g -Og -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -Og -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -Og -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -Og -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/buildd-architecture 000444 001750 001750 237 12374753057 17214 0 ustar 00simon simon 000000 000000 Build Architecture: mipsel
dpkg-buildpackage: source package test
gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c
blhc-0.05/t/logs/arch-avr32 000444 001750 001750 573 12374753057 15144 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture avr32
# no relro,bindnow
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -o test test.o
# missing flags
gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -o test test.o
blhc-0.05/t/logs/g++ 000444 001750 001750 4132 12374753057 13663 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
g++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
g++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
g++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
x86_64-linux-gnu-g++ -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
x86_64-linux-gnu-g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
x86_64-linux-gnu-g++ -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
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
rm g++test.h
g++\
test.c
rm test.g++
g++-4.6 -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.cpp
g++-4.6 -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.cpp
g++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.cpp
g++-4.6 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.cc
test-d.cc:47:11: warning: unused variable 'test' [-Wunused-variable]
g++-4.6 -Wl,-z,defs -o test test-a.o test-b.o test-c.o test-d.o -ltest
blhc-0.05/t/logs/arch-mipsel 000444 001750 001750 561 12374753057 15475 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture mipsel
# no stack protector
gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -Wl,-z,relro -Wl,-z,now -o test test.o
# missing flags
gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Wall -c test.c
gcc -Wl,-z,now -o test test.o
blhc-0.05/t/logs/verbose-build 000444 001750 001750 7302 12374753057 16053 0 ustar 00simon simon 000000 000000 # We must ensure a verbose build is used.
dpkg-buildpackage: source package test
checking if you want to see long compiling messages... yes
checking if you want to see long compiling messages... no
# Possible false positive.
checking whether compiling and linking against OpenSSL works... yes
CC libtest-a.lo
CC libtest-b.lo
CC libtest_c.lo
CC libtest-d.lo
...
CCLD libtest.la
LINK libtest.la
CXX libtest-a.lo
CXX libtest-b.lo
CXX libtest_c.lo
CXX libtest-d.lo
...
CXXLD libtest.la
[CC] src/test-a.o
[CC] src/test-b.o
[CC] src/test_c.o
[CXX] src/test-d.o
...
[LD] src/test.o
# Colored build output.
[[36mCC[m] src/test-a.o
[[36mCC[m] src/test-b.o
[[36mCC[m] src/test_c.o
...
[[32mLD[m] src/test.o
# Colored build output (used on armhf and hurd).
[[36mCC(B[m] src/test-a.o
[[36mCC(B[m] src/test-b.o
[[36mCC(B[m] src/test_c.o
...
[[32mLD(B[m] src/test.o
CC modules/server/test.c
C++ test/test.o
C++ test.cpp
Byte-compiling python modules...
Byte-compiling python modules (optimized versions) ...
Byte-compiling python modules...
Byte-compiling python modules (optimized versions) ...
# Don't treat the ".cc" file extension as valid compiler.
Building program ../build/bin/test
Compiling test/test.cc to ../build/test/test.o
# Non verbose.
Compiling test/test.cc to ../build/test/test.o
Building shared library ../build/test/libtest.so.1.2.3
Compiling test.cc to ../build/test/test.o
Building program ../build/bin/test
# Verbose ...
Compiling test/test.cc to ../build/test/test.o
g++ -c -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -o ../build/test/test.o test/test.cc
Building shared library ../build/test/libtest.so.1.2.3
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
Compiling test.cc to ../build/test/test.o
g++ -c -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -o ../build/test/test.o test.cc
Building program ../build/bin/test
g++ ../build/obj/test/test.o -o /../build/bin/test
# Non verbose.
Compiling test_file.cxx...
# Verbose ...
Compiling test_file.cxx...
g++ -g -O2 -fPIC -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test_file.cxx
# Non verbose.
[ 22%] Building CXX object src/CMakeFiles/test/test.cpp.o
[ 82%] Building C object src/CMakeFiles/test/test.c.o
# Verbose ...
[ 45%] Building CXX object src/CMakeFiles/test-verbose.dir/verbose.cpp.o
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
[ 83%] Building C object src/CMakeFiles/test-verbose-c.dir/verbose-c.c.o
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
# Multi-line non-verbose-build.
Compiling test.c \
gcc test.c
# False positives.
Compiling Test properties
Compiling Test sources
Compiling with GCC now generates lots of new warnings.
Compiling outside source directory - copying needed files
Compiling the test favour in /build/buildd-test_42.47-11-amd64/test-42.47/debian/tmp-test
Compiling /«BUILDDIR»/emacs23-23.4+1/debian/build-x/src/../lisp/international/characters.el
Compiling '/«PKGBUILDDIR»/debian/tmp/usr/lib/python3.3/_markupbase.py'...
Compiling /«PKGBUILDDIR»/debian/tmp/usr/lib/python2.7/dist-packages/libsvn/__init__.py ...
blhc-0.05/t/logs/bad 000444 001750 001750 2760 12374753057 14042 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
configure: running /bin/bash ./configure ... 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security' 'CPPFLAGS=-D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security' 'LDFLAGS=-Wl,-z,relro -Wl,-z,defs -Wl,--as-needed' ...
checking for gcc... gcc
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
x86_64-linux-gnu-gcc -g -O2 -c test-a.c
x86_64-linux-gnu-gcc -g -O2 -c test-b.c
x86_64-linux-gnu-gcc -g -O2 -c test-c.c
x86_64-linux-gnu-gcc -o test test-a.o test-b.o test-c.o -ltest
g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -pthread -o ./testProgram ../src/test/testProgram.cpp
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
gcc -o test test-a.o test-b.o test-c.a
g++ -g -O2 -fstack-protector-strong -Wformat -Werror=format-security ../src/test/objs/test.o -o ../src/test/bin/test
gcc -c -o test test.S
gcc -c -o test test.s
gcc -E test.c
gcc -S test.c
gcc test.c
gcc -Wl,-z,relro -o test test-.cpp test-b.cpp.o
gcc -MD -c test.c
gcc -MT -MD -MF test.d -c test.c
gcc -MMD -c test.c
gcc -MT -MMD -MF test.d -c test.c
blhc-0.05/t/logs/ignore-line 000444 001750 001750 1034 12374753057 15515 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
./prepare-script gcc test-a.c test-b.c test-c.c
./prepare-script gcc test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
./prepare-script gcc test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
./prepare-script gcc test-c.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
blhc-0.05/t/logs/bad-library 000444 001750 001750 1324 12374753057 15477 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -D_FORTIFY_SOURCE=2 -g -O2 -Wformat -Wformat-security -Werror=format-security test.c -fPIC -DPIC -o libtest.so
gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,--as-needed -o libtest.so
gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,--as-needed -o libtest.so
gcc -shared -fPIC test.o -Wl,-z -Wl,relro -o .libs/libtest.so.1.0.0
gcc -shared -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,now -lpthread -ldl
/usr/bin/g++ -shared -fpic -o libtest-6.1.so.0 test.o -ltiff -lz
gcc -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
blhc-0.05/t/logs/buildd-dpkg-fstack-protector-missing 000444 001750 001750 1477 12374753057 22445 0 ustar 00simon simon 000000 000000 Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
dpkg-buildpackage: source package test
gcc -g -O2 --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# --parm=ssp-buffer-size=4 can also be written with a space.
gcc -g -O2 --param ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test.c
Build finished at 20120308-1648
blhc-0.05/t/logs/debian-hardening-wrapper-pbuilder 000444 001750 001750 365 12374753057 21734 0 ustar 00simon simon 000000 000000 # pbuilder uses Depends: for the build dependencies.
Depends: .., hardening-wrapper, ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/debian-hardening-wrapper 000444 001750 001750 317 12374753057 20125 0 ustar 00simon simon 000000 000000 Filtered Build-Depends: .., hardening-wrapper, ...
dpkg-buildpackage: source package test
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/configure-check 000444 001750 001750 212 12374753057 16316 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Safety checks to prevent false negatives.
CC = gcc -std=gnu99 -std=gnu99 test.c
blhc-0.05/t/logs/buildd-package-details 000444 001750 001750 1572 12374753057 17573 0 ustar 00simon simon 000000 000000 Toolchain package versions: ... dpkg-dev_1.16.1.2 ...
dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
Build finished at 20120308-1648
# Everything after this is ignored.
gcc -g -O2 -c test-a.c
gcc -g -O2 -c test-b.c
gcc -g -O2 -c test-c.c
gcc -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/good-library 000444 001750 001750 2565 12374753057 15711 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# -fPIC and -fPIE conflict with each other and -fPIE is not necessary for
# libraries.
gcc -D_FORTIFY_SOURCE=2 -g -Wl,relro -Wl,now -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -fPIC -DPIC -o libtest.so
gcc -D_FORTIFY_SOURCE=2 -g -Wl,relro -Wl,now -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.cc -fPIC -DPIC -o libtest.so
gcc -shared -fPIC -DPIC libtest.o -lpthread -O2 -Wl,relro -Wl,now -Wl,--as-needed -o libtest.so
gcc -shared -fPIC test.o -Wl,-z -Wl,relro -Wl,now -o .libs/libtest.so.1.0.0
gcc -shared -fPIE -pie -o libtest.so.0d ./test-a.o test/./test-b.o -Wl,-z,relro -Wl,-z,now -lpthread -ldl
/usr/bin/g++ -shared -fpic -Wl,-z,relro -Wl,-z,now -o libtest-6.1.so.0 test.o -ltiff -lz
gcc -Wl,-z,now -Wl,-z,relro -Wl,--as-needed -fPIE -pie -o test.cgi test.o -lgcrypt
gcc -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -fPIE -pie -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security test.c -o lib`basename test/test`.so
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test+test test+test.o
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test.test test.test.o
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test.bin test.test.o
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test.real test.test.o
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test.cgi test.test.o
blhc-0.05/t/logs/arch-amd64 000444 001750 001750 715 12374753057 15120 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture amd64
# all hardening options
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test test.o
# missing flags
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -Wl,-z,relro -Wl,-z,now -o test test.o
blhc-0.05/t/logs/configure 000444 001750 001750 12613 12374753057 15313 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Output by configure or similar tools which should be ignored.
Compiler: gcc
compiler : gcc -std=gnu99
C Compiler: gcc -std=gnu99
C compiler gcc
C compiler gcc
Host C compiler gcc
compiler cc
Compiler: i486-gnu-gcc
Compiler: arm-linux-gnueabi-gcc
Compiler: arm-linux-gnueabihf-gcc
Compiler: i486-linux-gnu-gcc
Compiler: ia64-linux-gnu-gcc
Compiler: x86_64-kfreebsd-gnu-gcc
Compiler: i486-kfreebsd-gnu-gcc
Compiler: mips-linux-gnu-gcc
Compiler: mipsel-linux-gnu-gcc
Compiler: powerpc-linux-gnu-gcc
Compiler: s390-linux-gnu-gcc
Compiler: s390x-linux-gnu-gcc
Compiler: sparc-linux-gnu-gcc
C++ Compiler...: g++ -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -D_FORTIFY_SOURCE=2
- General Compile FLAGS
- CC = mpicc
- CXX = g++
- FC = f95
- CPPFLAGS = -D_FORTIFY_SOURCE=2
- CFLAGS = -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security
- CXXFLAGS = -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security
- FCFLAGS = -g -O2
- LDLAGS = -Wl,--as-needed
- LIBS =
Configure summary:
Compiler....................: gcc -std=gnu99
Compiler Flags..............: -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -Wall -Wextra
Prefix......................: /usr
Coding style checks.........: no
Enable debug................: yes
Configuration:
Detected OS: linux-gnu
Install path: /usr
Compilation arch: linux
Compiler: x86_64-linux-gnu-gcc
Compiler flags: -g -O2 -fstack-protector -Wformat -Wformat-security -Werror=format-security
Linker flags: -rdynamic -Wl,-z,relro
Libraries: -lm
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check for working CXX compiler: /usr/bin/c++
-- 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.
Compiler version: gcc (Debian 4.6.3-1) 4.6.3
configure: using CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -fPIC
configure: using LDFLAGS=-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -Wl,--as-needed
configure: Compiling with gcc -fstack-protector-all et al.
C++ library: yes
echo Using CC="gcc"
Using CC=gcc
echo Using CXX="gcc"
Using CXX=gcc
echo Using ALL_CFLAGS="-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security"
Using ALL_CFLAGS=-D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security
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
CC_I386=$(CC) -m32
HOST_CC=gcc
# From kismet.
Configuration complete:
Compiling for: linux-gnu (i486)
C++ Library: stdc++
Installing as group: root
Man pages owned by: man
Installing into: /usr
Setuid group: kismet
Terminal Control: ncurses
Linux WEXT capture : yes
OSX/Darwin capture : n/a (only OSX/Darwin)
PCRE Regex Filters : yes
pcap capture: yes
airpcap control: n/a (only Cygwin/Win32)
PPI log format: yes
LibCapability (enhanced
privilege dropping): yes
Linux Netlink: yes (mac80211 VAP creation) - libnl-3.0 libnl-genl-3.0
# Debian #710135.
PREFIX = /usr
EXEC-PREFIX = /usr
VERSION = 6.8.5
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -I/usr/include/lqr-1 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -fopenmp -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -I/usr/include/ImageMagick-6
PCFLAGS = -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
DEFS = -DHAVE_CONFIG_H
LDFLAGS = -Wl,-z,relro -Wl,--as-needed -L/usr/lib/X11
MAGICK_LDFLAGS = -L/usr/lib/x86_64-linux-gnu -Wl,-z,relro -Wl,--as-needed -L/usr/lib/X11
LIBS = -lMagickCore -llcms2 -lfreetype -llqr-1 -lglib-2.0 -lfftw3 -lfontconfig -lXext -lSM -lICE -lX11 -lXt -llzma -lbz2 -lz -lltdl -lm -lgomp - lpthread
CXX = g++
CXXFLAGS = -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -pthread
FEATURES = DPC OpenMP Modules
DELEGATES = bzlib djvu mpeg fftw fontconfig freetype jbig jng jp2 jpeg lcms lqr lzma openexr pango png ps tiff wmf x xml zlib
blhc-0.05/t/logs/good-all 000444 001750 001750 760 12374753057 14770 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fPIE -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -fPIE -pie -Wl,-z,relro -Wl,-z,now -o test test-a.o test-b.o test-c.o -ltest
blhc-0.05/t/logs/bad-cppflags 000444 001750 001750 3245 12374753057 15636 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c test-c.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
gcc -fPIC -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -c ../../../../src/test/test.c -o test.so.o
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
gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-a.c
gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-b.c
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=1 -c test-c.c
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=0 -c test-d.c
gcc -D_FORTIFY_SOURCE=0 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-e.c
gcc -D_FORTIFY_SOURCE=1 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-f.c
gcc -U_FORTIFY_SOURCE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c test-g.c
gcc -U_FORTIFY_SOURCE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-h.c
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -c test-i.c
blhc-0.05/t/logs/debian-cmake-2 000444 001750 001750 1234 12374753057 15746 0 ustar 00simon simon 000000 000000 Package versions: ... cmake_2.8.7-2 cmake-data_2.8.7-2 ...
dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -g -O3 -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-d.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
Build finished at 20120308-1648
blhc-0.05/t/logs/bad-cflags 000444 001750 001750 1415 12374753057 15273 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
gcc -g -O2 -fstack-protector-strong -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-a.c
gcc -g -O2 -Wformat -Wformat-security -Werror=format-security -D_FORTIFY_SOURCE=2 -c test-b.c
gcc -g -O2 -fstack-protector-strong -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -c test-c.c
gcc -Wl,-z,relro -o test test-a.o test-b.o test-c.o -ltest
# Compiling and linking in one step must also check CFLAGS/CPPFLAGS.
gcc -Wl,-z,relro -o test test.c -ltest
gcc -shared -fPIC -Wl,-z,relro -o test.so test.c -ltest
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
gcc test.c -o test.output
(gcc -Wl,-z,relro -o test.output test.c)
blhc-0.05/t/logs/false-positives 000444 001750 001750 230 12374753057 16377 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# Some false positives.
swig -Wall -c++ -python test.i
+ CC=gcc CFLAGS=-g -O2 ... sh ../../build.sh -r -c lto
blhc-0.05/t/logs/dpkg-buildpackage-architecture-old 000444 001750 001750 523 12374753057 22061 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
dpkg-buildpackage: host architecture is ia64
# Old buildd logs use "host architecture is ia64" (note the "is"). Detect the
# architecture correctly for those logs.
gcc -D_FORTIFY_SOURCE=2 -g -O2 -fPIE -Wformat -Wformat-security -Werror=format-security -Wall -c test.c
gcc -fPIE -pie -o test test.o
blhc-0.05/t/logs/qt4 000444 001750 001750 11517 12374753057 14044 0 ustar 00simon simon 000000 000000 dpkg-buildpackage: source package test
# `moc-qt4`/`moc-qt5` are preprocessors and don't require any hardening flags.
/usr/bin/moc-qt4 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/usr/include/qt4/QtDBus -I/include -I.. -I. -I. test.h -o moc_test.cpp
/usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/glibc-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp
/usr/bin/moc-qt4 -DQT_NO_DEBUG_OUTPUT -DAPP_VERSION=1.1 -DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_DBUS_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -Ilocale -Ibuild/moc -o build/moc/moc_test.cpp
# Tests for Debian bug #678616.
/tmp/buildd/qt4-x11-4.8.3+dfsg/bin/moc-qt4 -DQT_OPENGL_SUPPORT -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -DQT_SHARED -I../../mkspecs/linux-g++-64 -I. -I../../include/QtCore -I../../include/QtNetwork -I../../include/QtGui -I../../include/QtOpenGL -I../../include/QtXml -I../../include/QtSql -I../../include/QtDeclarative -I../../include -I../../include/QtHelp -I/usr/X11R6/include -I/usr/X11R6/include -I.moc/release-shared demoitemanimation.h -o .moc/release-shared/moc_demoitemanimation.cpp
/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp
/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp
/tmp/buildd/qtbase-opensource-src-5.0.0~beta1/bin/moc-qt5 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++-64 -I. -I../../../../include -I../../../../include/QtWidgets -I../../../../include/QtGui -I../../../../include/QtCore -I.moc/release-shared norwegianwoodstyle.h -o .moc/release-shared/moc_norwegianwoodstyle.cpp
# From qtcreator (2.7.0-1), uses different paths.
/usr/lib/arm-linux-gnueabi/qt4/bin/moc -DQT_WEBKIT -DIDE_LIBRARY_BASENAME=\"lib/arm-linux-gnueabi\" -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQTCREATOR_UTILS_LIB -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../../../../src/libs/utils -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I../../../src -I../../../../src/libs -I/«PKGBUILDDIR»/tools -I../../../../src/plugins -I../../../../src/libs/utils -I.moc/release-shared -I.uic -I. ../../../../src/libs/utils/environmentmodel.h -o .moc/release-shared/moc_environmentmodel.cpp
/usr/lib/arm-linux-gnueabi/qt4/bin/moc -DQT_WEBKIT -DIDE_LIBRARY_BASENAME=\"lib/arm-linux-gnueabi\" -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -DQTCREATOR_UTILS_LIB -DQT_NO_DEBUG -DQT_SCRIPT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../../../../src/libs/utils -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtScript -I/usr/include/qt4 -I../../../src -I../../../../src/libs -I/«PKGBUILDDIR»/tools -I../../../../src/plugins -I../../../../src/libs/utils -I.moc/release-shared -I.uic -I. ../../../../src/libs/utils/qtcprocess.h -o .moc/release-shared/moc_qtcprocess.cpp
blhc-0.05/t/logs/ada-pbuilder 000444 001750 001750 1433 12374753057 15641 0 ustar 00simon simon 000000 000000 # 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-strong -Wformat -Wformat-security -Werror=format-security test.c
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-a.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-b.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -gnatn -gnatw.eH test-c.adb
gcc-4.6 -c -fPIC -g -O2 -fstack-protector-strong -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