Revert r267233 for now. PIE support needs to be reworked.
authorbdrewery <bdrewery@FreeBSD.org>
Tue, 19 Aug 2014 15:04:32 +0000 (15:04 +0000)
committerbdrewery <bdrewery@FreeBSD.org>
Tue, 19 Aug 2014 15:04:32 +0000 (15:04 +0000)
commitb619f0c74719d87f58b0ea0053805b7423cdab28
treef5585fe1edc0507d12a8ac9729befa9b67327239
parentdf507d931047ee5a6db9840d4f900c0ad539717c
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
151 files changed:
Makefile.inc1
bin/rmail/Makefile
gnu/usr.bin/binutils/addr2line/Makefile
gnu/usr.bin/binutils/nm/Makefile
gnu/usr.bin/binutils/objcopy/Makefile
gnu/usr.bin/binutils/objdump/Makefile
gnu/usr.bin/binutils/readelf/Makefile
gnu/usr.bin/binutils/size/Makefile
gnu/usr.bin/binutils/strings/Makefile
gnu/usr.bin/binutils/strip/Makefile
gnu/usr.bin/gdb/gdb/Makefile
gnu/usr.bin/gdb/gdbtui/Makefile
gnu/usr.bin/gdb/kgdb/Makefile
gnu/usr.bin/groff/src/devices/grodvi/Makefile
gnu/usr.bin/groff/src/devices/grohtml/Makefile
gnu/usr.bin/groff/src/devices/grolbp/Makefile
gnu/usr.bin/groff/src/devices/grolj4/Makefile
gnu/usr.bin/groff/src/devices/grops/Makefile
gnu/usr.bin/groff/src/devices/grotty/Makefile
gnu/usr.bin/groff/src/preproc/eqn/Makefile
gnu/usr.bin/groff/src/preproc/grn/Makefile
gnu/usr.bin/groff/src/preproc/html/Makefile
gnu/usr.bin/groff/src/preproc/pic/Makefile
gnu/usr.bin/groff/src/preproc/refer/Makefile
gnu/usr.bin/groff/src/preproc/soelim/Makefile
gnu/usr.bin/groff/src/preproc/tbl/Makefile
gnu/usr.bin/groff/src/roff/groff/Makefile
gnu/usr.bin/groff/src/roff/troff/Makefile
gnu/usr.bin/groff/src/utils/addftinfo/Makefile
gnu/usr.bin/groff/src/utils/hpftodit/Makefile
gnu/usr.bin/groff/src/utils/indxbib/Makefile
gnu/usr.bin/groff/src/utils/lkbib/Makefile
gnu/usr.bin/groff/src/utils/lookbib/Makefile
gnu/usr.bin/groff/src/utils/tfmtodit/Makefile
gnu/usr.bin/rcs/Makefile.inc
gnu/usr.bin/texinfo/info/Makefile
gnu/usr.bin/texinfo/infokey/Makefile
gnu/usr.bin/texinfo/install-info/Makefile
gnu/usr.bin/texinfo/makeinfo/Makefile
gnu/usr.bin/texinfo/texindex/Makefile
kerberos5/libexec/digest-service/Makefile
kerberos5/libexec/hprop/Makefile
kerberos5/libexec/hpropd/Makefile
kerberos5/libexec/ipropd-master/Makefile
kerberos5/libexec/ipropd-slave/Makefile
kerberos5/libexec/kadmind/Makefile
kerberos5/libexec/kcm/Makefile
kerberos5/libexec/kdc/Makefile
kerberos5/libexec/kdigest/Makefile
kerberos5/libexec/kfd/Makefile
kerberos5/libexec/kimpersonate/Makefile
kerberos5/libexec/kpasswdd/Makefile
kerberos5/tools/asn1_compile/Makefile
kerberos5/tools/slc/Makefile
kerberos5/usr.bin/hxtool/Makefile
kerberos5/usr.bin/kadmin/Makefile
kerberos5/usr.bin/kcc/Makefile
kerberos5/usr.bin/kdestroy/Makefile
kerberos5/usr.bin/kf/Makefile
kerberos5/usr.bin/kgetcred/Makefile
kerberos5/usr.bin/kinit/Makefile
kerberos5/usr.bin/kpasswd/Makefile
kerberos5/usr.bin/ksu/Makefile
kerberos5/usr.bin/string2key/Makefile
kerberos5/usr.bin/verify_krb5_conf/Makefile
kerberos5/usr.sbin/iprop-log/Makefile
kerberos5/usr.sbin/kstash/Makefile
kerberos5/usr.sbin/ktutil/Makefile
lib/csu/amd64/Makefile
lib/csu/i386-elf/Makefile
libexec/mail.local/Makefile
libexec/rtld-elf/Makefile
libexec/smrsh/Makefile
libexec/telnetd/Makefile
sbin/fsck/Makefile
sbin/ipf/ipf/Makefile
sbin/ipf/ipfstat/Makefile
sbin/ipf/ipftest/Makefile
sbin/ipf/ipmon/Makefile
sbin/ipf/ipnat/Makefile
sbin/ipf/ippool/Makefile
sbin/ipf/ipresend/Makefile
sbin/rcorder/Makefile
share/mk/bsd.opts.mk
share/mk/bsd.prog.mk
sys/boot/i386/boot2/Makefile
sys/boot/i386/btx/btx/Makefile
sys/boot/i386/btx/btxldr/Makefile
sys/boot/i386/btx/lib/Makefile
sys/boot/i386/loader/Makefile
sys/boot/mips/beri/boot2/Makefile
sys/boot/mips/beri/loader/Makefile
sys/boot/pc98/boot2/Makefile
sys/boot/pc98/btx/lib/Makefile
sys/boot/pc98/loader/Makefile
sys/boot/sparc64/boot1/Makefile
sys/boot/sparc64/loader/Makefile
tools/build/options/WITH_PIE [deleted file]
usr.bin/clang/clang-tblgen/Makefile
usr.bin/clang/clang.prog.mk
usr.bin/clang/tblgen/Makefile
usr.bin/compile_et/Makefile
usr.bin/mandoc/Makefile
usr.bin/svn/svn/Makefile
usr.bin/svn/svnadmin/Makefile
usr.bin/svn/svndumpfilter/Makefile
usr.bin/svn/svnlook/Makefile
usr.bin/svn/svnmucc/Makefile
usr.bin/svn/svnrdump/Makefile
usr.bin/svn/svnserve/Makefile
usr.bin/svn/svnsync/Makefile
usr.bin/svn/svnversion/Makefile
usr.bin/telnet/Makefile
usr.bin/vacation/Makefile
usr.sbin/amd/amd/Makefile
usr.sbin/amd/amq/Makefile
usr.sbin/amd/fixmount/Makefile
usr.sbin/amd/fsinfo/Makefile
usr.sbin/amd/hlfsd/Makefile
usr.sbin/amd/mk-amd-map/Makefile
usr.sbin/amd/pawd/Makefile
usr.sbin/amd/wire-test/Makefile
usr.sbin/btxld/Makefile
usr.sbin/cron/cron/Makefile
usr.sbin/cron/crontab/Makefile
usr.sbin/crunch/crunchgen/Makefile
usr.sbin/crunch/crunchide/Makefile
usr.sbin/editmap/Makefile
usr.sbin/fifolog/fifolog_create/Makefile
usr.sbin/fifolog/fifolog_reader/Makefile
usr.sbin/fifolog/fifolog_writer/Makefile
usr.sbin/ftp-proxy/ftp-proxy/Makefile
usr.sbin/lpr/chkprintcap/Makefile
usr.sbin/lpr/lpc/Makefile
usr.sbin/lpr/lpd/Makefile
usr.sbin/lpr/lpq/Makefile
usr.sbin/lpr/lpr/Makefile
usr.sbin/lpr/lprm/Makefile
usr.sbin/lpr/pac/Makefile
usr.sbin/mailstats/Makefile
usr.sbin/makefs/Makefile
usr.sbin/makemap/Makefile
usr.sbin/nmtree/Makefile
usr.sbin/ntp/ntp-keygen/Makefile
usr.sbin/ntp/ntpd/Makefile
usr.sbin/ntp/ntpdate/Makefile
usr.sbin/ntp/ntpdc/Makefile
usr.sbin/ntp/ntpq/Makefile
usr.sbin/ntp/ntptime/Makefile
usr.sbin/praliases/Makefile
usr.sbin/sendmail/Makefile