Commit Graph

29 Commits

Author SHA1 Message Date
Bryan Drewery
5608fd23c2 Revert r267233 for now. PIE support needs to be reworked.
1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other
   build-only utility libraries.
2. Another 40% is fixed by generating _pic.a variants of various libraries.
3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR)
   where it never would work anyhow, such as csu or loader. This suggests
   there may be better ways of adding support to the tree. Many of these
   cases can be fixed such that -fPIE will work but there is really no
   reason to have it in those cases.
4. Some of the uses are working around hacks done to some Makefiles that are
   really building libraries but have been using bsd.prog.mk because the code
   is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have
   been needed.

We likely do want to enable PIE by default (opt-out) for non-tree consumers
(such as ports). For in-tree though we probably want to only enable PIE
(opt-in) for common attack targets such as remote service daemons and setuid
utilities. This is also a great performance compromise since ASLR is expected
to reduce performance. As such it does not make sense to enable it in all
utilities such as ls(1) that have little benefit to having it enabled.

Reported by:	kib
2014-08-19 15:04:32 +00:00
Bryan Drewery
864c53ead8 In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.
This is currently an opt-in build flag. Once ASLR support is ready and stable
it should changed to opt-out and be enabled by default along with ASLR.

Each application Makefile uses opt-out to ensure that ASLR will be enabled by
default in new directories when the system is compiled with PIE/ASLR. [2]

Mark known build failures as NO_PIE for now.

The only known runtime failure was rtld.

[1] http://www.bsdcan.org/2014/schedule/events/452.en.html
Submitted by:		Shawn Webb <lattera@gmail.com>
Discussed between:	des@ and Shawn Webb [2]
2014-06-08 17:29:31 +00:00
Warner Losh
3bdf775801 NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
and finish the job. ncurses is now the only Makefile in the tree that
uses it since it wasn't a simple mechanical change, and will be
addressed in a future commit.
2014-04-13 05:21:56 +00:00
Ed Schouten
7e659f9491 Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
Sergey Kandaurov
b94db03dca mdoc: point to an existing cross reference. 2012-10-02 09:53:50 +00:00
Baptiste Daroussin
5e2a209a27 Fix world after byacc import:
- old yacc(1) use to magicially append stdlib.h, while new one don't
- new yacc(1) do declare yyparse by itself, fix redundant declaration of
  'yyparse'

Approved by:	des (mentor)
2012-05-22 16:33:10 +00:00
Poul-Henning Kamp
818bc4157a Another couple of unsigned/ssize_t changes. 2011-03-01 08:52:10 +00:00
Poul-Henning Kamp
2f203e818f Type-change to ssize_t to (app|pl)ease ppc platform. 2011-02-28 14:48:00 +00:00
Poul-Henning Kamp
6e482ac5ad Update fifolog internals to match main version:
Rename ...write_bytes... to ...write_records..., that's what they do.

Move writer .h stuff into writer private .h file.

Change logic in writer to support both fifolog usage in FreeBSD and
Measured usage better, by always using an input buffer.

Various cleanups.
2011-02-28 09:11:46 +00:00
Poul-Henning Kamp
54a3365da2 Don't override the perfectly good default ->zalloc and ->zfree functions. 2011-02-28 08:59:35 +00:00
Poul-Henning Kamp
fb4f617201 Fix a bunch of trivial whitespace mistakes and update the miniobj.h
file before the real work starts.
2011-02-25 09:40:17 +00:00
Poul-Henning Kamp
5d964b5cc9 Use a "push" strategy to get data through libz, rather than a "pull" strategy. 2010-12-07 16:30:52 +00:00
Ulrich Spörlein
768e090da1 Typo fixes
PR:		docs/149314
Submitted by:	olgeni
MFC after:	3 days
2010-08-06 12:38:30 +00:00
Giorgos Keramidas
36dc373119 Fix reading of empty fifolog files. When we don't have anything
to inflate, skip the rest of the fifolog reader code to avoid
hitting the assert about Z_OK a bit further down.

Approved by:	phk
MFC after:	1 week
2010-07-10 11:40:31 +00:00
Poul-Henning Kamp
c6bfb71a6f Do not attempt to render a logrecord with length byte, until we have
decompressed all the bytes required.
2010-05-15 08:57:16 +00:00
Ulrich Spörlein
aa12cea2cc mdoc: order prologue macros consistently by Dd/Dt/Os
Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by:	ru
Approved by:	philip, ed (mentors)
2010-04-14 19:08:06 +00:00
Ed Schouten
71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Ed Schouten
10bc3a7f42 ANSIfy almost all applications that use WARNS=6.
I was considering committing all these patches one by one, but as
discussed with brooks@, there is no need to do this. If we ever
need/want to merge these changes back, it is still possible to do this
per application.
2009-12-29 22:53:27 +00:00
Jaakko Heinonen
89834b119e Unify fifolog_writer usage printout with fifolog_create and
fifolog_reader.

Approved by:	trasz (mentor)
2009-11-17 17:38:41 +00:00
Ruslan Ermilov
c022d15e0f Fixed NAME section. 2009-04-04 15:48:09 +00:00
Poul-Henning Kamp
9e7948d849 The last sector in the first segment might just be a sync, increment before
checking validity of segment two.
2009-02-02 14:30:07 +00:00
Poul-Henning Kamp
b183b801b5 Don't overwrite it, if only one sector is written yet.
Discovered by:	"Dewayne Geraghty" <dewayne.geraghty@heuristicsystems.com.au>
2009-02-02 14:29:15 +00:00
Poul-Henning Kamp
ba2b54296f Fix a cornercase during search 2008-12-09 09:25:03 +00:00
Poul-Henning Kamp
22d0b5dc8b Populate usage()
Submitted by:   Jaakko Heinonen <jh@saunalahti.fi>
2008-05-14 23:29:02 +00:00
Ruslan Ermilov
a1e0a00fd2 Clean up makefiles and a manpage.
OK'ed by:	phk
2008-04-10 14:02:00 +00:00
Poul-Henning Kamp
8d2888bc54 Accept empty -T arguments.
Proposed by:	clemens fischer <ino-qc@spotteswoode.de.eu.org>
2008-03-31 13:56:15 +00:00
Poul-Henning Kamp
103c0e21dd Fix two bugs introduced in conversion to FreeBSD source tree:
Off by one error in length calcuation of string records.
Don't attempt to free stack variable.
2008-03-19 10:56:51 +00:00
Poul-Henning Kamp
9371f06305 Remove trailing ';' on macros.
Spotted by:	antoine
2008-03-16 23:00:43 +00:00
Poul-Henning Kamp
662cb04c25 Add the fifolog tools to FreeBSD.
Quoth the man-page:

     Fifologs provide a compact round-robin circular storage for recording
     text and binary information to permanent storage in a bounded and pre-
     dictable fashion, time and space wise.

Not yet connected to the build, but feel free to test & review.
2008-03-09 19:14:36 +00:00