diff options
author | bdrewery <bdrewery@FreeBSD.org> | 2014-08-19 15:04:32 +0000 |
---|---|---|
committer | bdrewery <bdrewery@FreeBSD.org> | 2014-08-19 15:04:32 +0000 |
commit | b619f0c74719d87f58b0ea0053805b7423cdab28 (patch) | |
tree | f5585fe1edc0507d12a8ac9729befa9b67327239 /gnu | |
parent | df507d931047ee5a6db9840d4f900c0ad539717c (diff) | |
download | FreeBSD-src-b619f0c74719d87f58b0ea0053805b7423cdab28.zip FreeBSD-src-b619f0c74719d87f58b0ea0053805b7423cdab28.tar.gz |
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
Diffstat (limited to 'gnu')
38 files changed, 0 insertions, 75 deletions
diff --git a/gnu/usr.bin/binutils/addr2line/Makefile b/gnu/usr.bin/binutils/addr2line/Makefile index 37649fa..2380738 100644 --- a/gnu/usr.bin/binutils/addr2line/Makefile +++ b/gnu/usr.bin/binutils/addr2line/Makefile @@ -14,6 +14,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/nm/Makefile b/gnu/usr.bin/binutils/nm/Makefile index 5945d25..4ef2b8f 100644 --- a/gnu/usr.bin/binutils/nm/Makefile +++ b/gnu/usr.bin/binutils/nm/Makefile @@ -15,6 +15,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/objcopy/Makefile b/gnu/usr.bin/binutils/objcopy/Makefile index c23e1e8..66d99f4 100644 --- a/gnu/usr.bin/binutils/objcopy/Makefile +++ b/gnu/usr.bin/binutils/objcopy/Makefile @@ -14,6 +14,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/objdump/Makefile b/gnu/usr.bin/binutils/objdump/Makefile index fb275ac..1a0d046 100644 --- a/gnu/usr.bin/binutils/objdump/Makefile +++ b/gnu/usr.bin/binutils/objdump/Makefile @@ -16,6 +16,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/readelf/Makefile b/gnu/usr.bin/binutils/readelf/Makefile index fd3110d..d90c3bc 100644 --- a/gnu/usr.bin/binutils/readelf/Makefile +++ b/gnu/usr.bin/binutils/readelf/Makefile @@ -17,6 +17,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/size/Makefile b/gnu/usr.bin/binutils/size/Makefile index a22e67f..c5c19c1 100644 --- a/gnu/usr.bin/binutils/size/Makefile +++ b/gnu/usr.bin/binutils/size/Makefile @@ -14,6 +14,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/strings/Makefile b/gnu/usr.bin/binutils/strings/Makefile index 0ff82eb..a432d51 100644 --- a/gnu/usr.bin/binutils/strings/Makefile +++ b/gnu/usr.bin/binutils/strings/Makefile @@ -14,6 +14,4 @@ DPADD+= ${RELTOP}/libbfd/libbfd.a DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/binutils/strip/Makefile b/gnu/usr.bin/binutils/strip/Makefile index 6d17067..d3cf8c4 100644 --- a/gnu/usr.bin/binutils/strip/Makefile +++ b/gnu/usr.bin/binutils/strip/Makefile @@ -15,6 +15,4 @@ DPADD+= ${RELTOP}/libiberty/libiberty.a LDADD= ${DPADD} INSTALLFLAGS= -S -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/gdb/gdb/Makefile b/gnu/usr.bin/gdb/gdb/Makefile index cf23804..900fbcc 100644 --- a/gnu/usr.bin/gdb/gdb/Makefile +++ b/gnu/usr.bin/gdb/gdb/Makefile @@ -14,7 +14,5 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} LDADD= ${GDBLIBS} ${BULIBS} -lm ${LDREADLINE} -ltermcapw -lgnuregex -NO_PIE= yes - .include <bsd.prog.mk> CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" diff --git a/gnu/usr.bin/gdb/gdbtui/Makefile b/gnu/usr.bin/gdb/gdbtui/Makefile index 1670173..4ee9415 100644 --- a/gnu/usr.bin/gdb/gdbtui/Makefile +++ b/gnu/usr.bin/gdb/gdbtui/Makefile @@ -15,6 +15,4 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} LDADD= ${GDBLIBS} ${BULIBS} -lm ${LDREADLINE} -ltermcapw -lgnuregex -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile index 076b7cd..04c14b3 100644 --- a/gnu/usr.bin/gdb/kgdb/Makefile +++ b/gnu/usr.bin/gdb/kgdb/Makefile @@ -17,6 +17,4 @@ LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LDREADLINE} -ltermcapw \ CFLAGS+= -Wl,-export-dynamic .endif -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grodvi/Makefile b/gnu/usr.bin/groff/src/devices/grodvi/Makefile index 7c88f04..3745440 100644 --- a/gnu/usr.bin/groff/src/devices/grodvi/Makefile +++ b/gnu/usr.bin/groff/src/devices/grodvi/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grohtml/Makefile b/gnu/usr.bin/groff/src/devices/grohtml/Makefile index 4d30338..321f1c8 100644 --- a/gnu/usr.bin/groff/src/devices/grohtml/Makefile +++ b/gnu/usr.bin/groff/src/devices/grohtml/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm MAN= -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grolbp/Makefile b/gnu/usr.bin/groff/src/devices/grolbp/Makefile index 69511e0..85a41c1 100644 --- a/gnu/usr.bin/groff/src/devices/grolbp/Makefile +++ b/gnu/usr.bin/groff/src/devices/grolbp/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grolj4/Makefile b/gnu/usr.bin/groff/src/devices/grolj4/Makefile index 51a003f..bb3f9e4 100644 --- a/gnu/usr.bin/groff/src/devices/grolj4/Makefile +++ b/gnu/usr.bin/groff/src/devices/grolj4/Makefile @@ -7,6 +7,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grops/Makefile b/gnu/usr.bin/groff/src/devices/grops/Makefile index 4933dbb..4511f69 100644 --- a/gnu/usr.bin/groff/src/devices/grops/Makefile +++ b/gnu/usr.bin/groff/src/devices/grops/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/devices/grotty/Makefile b/gnu/usr.bin/groff/src/devices/grotty/Makefile index 78d6498..d15ee8b 100644 --- a/gnu/usr.bin/groff/src/devices/grotty/Makefile +++ b/gnu/usr.bin/groff/src/devices/grotty/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBDRIVER} ${LIBGROFF} ${LIBM} LDADD= ${LIBDRIVER} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/eqn/Makefile b/gnu/usr.bin/groff/src/preproc/eqn/Makefile index 9e53be6..80871fe 100644 --- a/gnu/usr.bin/groff/src/preproc/eqn/Makefile +++ b/gnu/usr.bin/groff/src/preproc/eqn/Makefile @@ -11,8 +11,6 @@ SCRIPTS= neqn MAN= eqn.1 neqn.1 CLEANFILES= eqn.cpp eqn_tab.h ${SCRIPTS} ${MAN} y.tab.c y.tab.h -NO_PIE= yes - eqn_tab.h: eqn.cpp .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/grn/Makefile b/gnu/usr.bin/groff/src/preproc/grn/Makefile index d859270..58309d2 100644 --- a/gnu/usr.bin/groff/src/preproc/grn/Makefile +++ b/gnu/usr.bin/groff/src/preproc/grn/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/html/Makefile b/gnu/usr.bin/groff/src/preproc/html/Makefile index 4e82fd1..d46626b 100644 --- a/gnu/usr.bin/groff/src/preproc/html/Makefile +++ b/gnu/usr.bin/groff/src/preproc/html/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} MAN= -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/pic/Makefile b/gnu/usr.bin/groff/src/preproc/pic/Makefile index 2d14d0a..3b5939c 100644 --- a/gnu/usr.bin/groff/src/preproc/pic/Makefile +++ b/gnu/usr.bin/groff/src/preproc/pic/Makefile @@ -8,8 +8,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} pic.cpp pic_tab.h y.tab.c y.tab.h -NO_PIE= yes - pic_tab.h: pic.cpp .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/refer/Makefile b/gnu/usr.bin/groff/src/preproc/refer/Makefile index ce82c70..8a18f6f 100644 --- a/gnu/usr.bin/groff/src/preproc/refer/Makefile +++ b/gnu/usr.bin/groff/src/preproc/refer/Makefile @@ -7,6 +7,4 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= label.cpp label_tab.h ${MAN} y.tab.c y.tab.h -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/soelim/Makefile b/gnu/usr.bin/groff/src/preproc/soelim/Makefile index 8567a44..2c68b80 100644 --- a/gnu/usr.bin/groff/src/preproc/soelim/Makefile +++ b/gnu/usr.bin/groff/src/preproc/soelim/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/preproc/tbl/Makefile b/gnu/usr.bin/groff/src/preproc/tbl/Makefile index 83bde82..29e7ac2 100644 --- a/gnu/usr.bin/groff/src/preproc/tbl/Makefile +++ b/gnu/usr.bin/groff/src/preproc/tbl/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/roff/groff/Makefile b/gnu/usr.bin/groff/src/roff/groff/Makefile index 576507c..2ae541b 100644 --- a/gnu/usr.bin/groff/src/roff/groff/Makefile +++ b/gnu/usr.bin/groff/src/roff/groff/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/roff/troff/Makefile b/gnu/usr.bin/groff/src/roff/troff/Makefile index 5c3b837..802af2b 100644 --- a/gnu/usr.bin/groff/src/roff/troff/Makefile +++ b/gnu/usr.bin/groff/src/roff/troff/Makefile @@ -7,8 +7,6 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= majorminor.cpp ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> majorminor.cpp: ${GROFF_DIST}/VERSION ${GROFF_DIST}/REVISION diff --git a/gnu/usr.bin/groff/src/utils/addftinfo/Makefile b/gnu/usr.bin/groff/src/utils/addftinfo/Makefile index ea3b7a2..26fbb57 100644 --- a/gnu/usr.bin/groff/src/utils/addftinfo/Makefile +++ b/gnu/usr.bin/groff/src/utils/addftinfo/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} LDADD= ${LIBGROFF} CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile index 512ca1b..1376702 100644 --- a/gnu/usr.bin/groff/src/utils/hpftodit/Makefile +++ b/gnu/usr.bin/groff/src/utils/hpftodit/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/utils/indxbib/Makefile b/gnu/usr.bin/groff/src/utils/indxbib/Makefile index 86eb4fb..b2c59a2 100644 --- a/gnu/usr.bin/groff/src/utils/indxbib/Makefile +++ b/gnu/usr.bin/groff/src/utils/indxbib/Makefile @@ -6,8 +6,6 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - beforeinstall: ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${DIST_DIR}/eign ${DESTDIR}${SHAREDIR}/dict/ diff --git a/gnu/usr.bin/groff/src/utils/lkbib/Makefile b/gnu/usr.bin/groff/src/utils/lkbib/Makefile index 42fbd63..f30dc56 100644 --- a/gnu/usr.bin/groff/src/utils/lkbib/Makefile +++ b/gnu/usr.bin/groff/src/utils/lkbib/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/utils/lookbib/Makefile b/gnu/usr.bin/groff/src/utils/lookbib/Makefile index e2ea17d..18834a7 100644 --- a/gnu/usr.bin/groff/src/utils/lookbib/Makefile +++ b/gnu/usr.bin/groff/src/utils/lookbib/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBBIB} ${LIBGROFF} ${LIBM} LDADD= ${LIBBIB} ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile index 1b0434f..ba3bbc5 100644 --- a/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile +++ b/gnu/usr.bin/groff/src/utils/tfmtodit/Makefile @@ -6,6 +6,4 @@ DPADD= ${LIBGROFF} ${LIBM} LDADD= ${LIBGROFF} -lm CLEANFILES= ${MAN} -NO_PIE= yes - .include <bsd.prog.mk> diff --git a/gnu/usr.bin/rcs/Makefile.inc b/gnu/usr.bin/rcs/Makefile.inc index 912ae7b..a46437a 100644 --- a/gnu/usr.bin/rcs/Makefile.inc +++ b/gnu/usr.bin/rcs/Makefile.inc @@ -1,4 +1,3 @@ # $FreeBSD$ LIBRCS= ${.OBJDIR}/../lib/librcs.a -NO_PIE= yes diff --git a/gnu/usr.bin/texinfo/info/Makefile b/gnu/usr.bin/texinfo/info/Makefile index de95af6..adf7f91 100644 --- a/gnu/usr.bin/texinfo/info/Makefile +++ b/gnu/usr.bin/texinfo/info/Makefile @@ -13,8 +13,6 @@ CFLAGS+= -DINFODIR=\"${INFODIR}:/usr/local/info:.\" DPADD= ${LIBTERMCAPW} ${LIBTXI} LDADD= -ltermcapw ${LIBTXI} -NO_PIE= yes - .include <bsd.prog.mk> .PATH: ${TXIDIR}/info ${TXIDIR}/doc diff --git a/gnu/usr.bin/texinfo/infokey/Makefile b/gnu/usr.bin/texinfo/infokey/Makefile index d42406f..50be00d 100644 --- a/gnu/usr.bin/texinfo/infokey/Makefile +++ b/gnu/usr.bin/texinfo/infokey/Makefile @@ -6,8 +6,6 @@ SRCS= infokey.c key.c DPADD= ${LIBTXI} LDADD= ${LIBTXI} -NO_PIE= yes - .include <bsd.prog.mk> .PATH: ${TXIDIR}/info ${TXIDIR}/doc diff --git a/gnu/usr.bin/texinfo/install-info/Makefile b/gnu/usr.bin/texinfo/install-info/Makefile index 21ab9ea..325c909 100644 --- a/gnu/usr.bin/texinfo/install-info/Makefile +++ b/gnu/usr.bin/texinfo/install-info/Makefile @@ -5,8 +5,6 @@ PROG= install-info DPADD= ${LIBTXI} LDADD= ${LIBTXI} -NO_PIE= yes - .include <bsd.prog.mk> .PATH: ${TXIDIR}/util ${TXIDIR}/doc diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile b/gnu/usr.bin/texinfo/makeinfo/Makefile index 1c3b77d..373c326 100644 --- a/gnu/usr.bin/texinfo/makeinfo/Makefile +++ b/gnu/usr.bin/texinfo/makeinfo/Makefile @@ -8,8 +8,6 @@ SRCS= cmds.c defun.c files.c float.c footnote.c html.c \ DPADD= ${LIBTXI} LDADD= ${LIBTXI} -NO_PIE= yes - .include <bsd.prog.mk> .PATH: $(TXIDIR)/makeinfo $(TXIDIR)/doc diff --git a/gnu/usr.bin/texinfo/texindex/Makefile b/gnu/usr.bin/texinfo/texindex/Makefile index 796d627..91c2dfc 100644 --- a/gnu/usr.bin/texinfo/texindex/Makefile +++ b/gnu/usr.bin/texinfo/texindex/Makefile @@ -5,8 +5,6 @@ PROG= texindex DPADD= ${LIBTXI} LDADD= ${LIBTXI} -NO_PIE= yes - .include <bsd.prog.mk> .PATH: ${TXIDIR}/util ${TXIDIR}/doc |