From b619f0c74719d87f58b0ea0053805b7423cdab28 Mon Sep 17 00:00:00 2001 From: bdrewery Date: Tue, 19 Aug 2014 15:04:32 +0000 Subject: 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 --- usr.sbin/fifolog/fifolog_create/Makefile | 2 -- usr.sbin/fifolog/fifolog_reader/Makefile | 2 -- usr.sbin/fifolog/fifolog_writer/Makefile | 2 -- 3 files changed, 6 deletions(-) (limited to 'usr.sbin/fifolog') diff --git a/usr.sbin/fifolog/fifolog_create/Makefile b/usr.sbin/fifolog/fifolog_create/Makefile index 38a6623..8b59b25 100644 --- a/usr.sbin/fifolog/fifolog_create/Makefile +++ b/usr.sbin/fifolog/fifolog_create/Makefile @@ -12,8 +12,6 @@ MLINKS= fifolog.1 fifolog_create.1 \ fifolog.1 fifolog_reader.1 \ fifolog.1 fifolog_writer.1 -NO_PIE= yes - regress: rm -f /tmp/fifolog.? ./${PROG} /tmp/fifolog.0 diff --git a/usr.sbin/fifolog/fifolog_reader/Makefile b/usr.sbin/fifolog/fifolog_reader/Makefile index dfbb73f..c88f10e 100644 --- a/usr.sbin/fifolog/fifolog_reader/Makefile +++ b/usr.sbin/fifolog/fifolog_reader/Makefile @@ -9,8 +9,6 @@ MAN= DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} LDADD= ${LIBFIFOLOG} -lutil -lz -NO_PIE= yes - regress: ./${PROG} /tmp/fifolog.0 ./${PROG} -t /tmp/fifolog.0 diff --git a/usr.sbin/fifolog/fifolog_writer/Makefile b/usr.sbin/fifolog/fifolog_writer/Makefile index 3e6e377..9d802c7 100644 --- a/usr.sbin/fifolog/fifolog_writer/Makefile +++ b/usr.sbin/fifolog/fifolog_writer/Makefile @@ -9,8 +9,6 @@ MAN= DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} LDADD= ${LIBFIFOLOG} -lutil -lz -NO_PIE= yes - regress: date | ./${PROG} -z 0 /tmp/fifolog.0 lptest 65 | ./${PROG} -z 9 /tmp/fifolog.1 -- cgit v1.1 From 8f3d66d3767f46a54deb15c978d5ee6c94f40d67 Mon Sep 17 00:00:00 2001 From: bapt Date: Thu, 6 Nov 2014 13:12:12 +0000 Subject: fifolog_reader does not depend on libutil --- usr.sbin/fifolog/fifolog_reader/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/fifolog') diff --git a/usr.sbin/fifolog/fifolog_reader/Makefile b/usr.sbin/fifolog/fifolog_reader/Makefile index c88f10e..50575a9 100644 --- a/usr.sbin/fifolog/fifolog_reader/Makefile +++ b/usr.sbin/fifolog/fifolog_reader/Makefile @@ -6,8 +6,8 @@ CFLAGS+= -I${.CURDIR}/../lib MAN= -DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} -LDADD= ${LIBFIFOLOG} -lutil -lz +DPADD= ${LIBFIFOLOG} ${LIBZ} +LDADD= ${LIBFIFOLOG} -lz regress: ./${PROG} /tmp/fifolog.0 -- cgit v1.1 From cb2018accf478dc948ea9bf13f44701f10383ca4 Mon Sep 17 00:00:00 2001 From: bapt Date: Thu, 6 Nov 2014 13:13:47 +0000 Subject: fifolog_writer does not depend on libutil --- usr.sbin/fifolog/fifolog_writer/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin/fifolog') diff --git a/usr.sbin/fifolog/fifolog_writer/Makefile b/usr.sbin/fifolog/fifolog_writer/Makefile index 9d802c7..9806ec7 100644 --- a/usr.sbin/fifolog/fifolog_writer/Makefile +++ b/usr.sbin/fifolog/fifolog_writer/Makefile @@ -6,8 +6,8 @@ CFLAGS+= -I${.CURDIR}/../lib MAN= -DPADD= ${LIBFIFOLOG} ${LIBUTIL} ${LIBZ} -LDADD= ${LIBFIFOLOG} -lutil -lz +DPADD= ${LIBFIFOLOG} ${LIBZ} +LDADD= ${LIBFIFOLOG} -lz regress: date | ./${PROG} -z 0 /tmp/fifolog.0 -- cgit v1.1