Skip to content

Commit

Permalink
Add WITH_PIE knob to build Position Independent Executables
Browse files Browse the repository at this point in the history
MFC r344179: Add WITH_PIE knob to build Position Independent Executables

Building binaries as PIE allows the executable itself to be loaded at a
random address when ASLR is enabled (not just its shared libraries).

With this change PIE objects have a .pieo extension and INTERNALLIB
libraries libXXX_pie.a.

MK_PIE is disabled for some kerberos5 tools, Clang, and Subversion, as
they explicitly reference .a libraries in their Makefiles.  These can
be addressed on an individual basis later.  MK_PIE is also disabled for
rtld-elf because it is already position-independent using bespoke
Makefile rules.

Currently only dynamically linked binaries will be built as PIE.

MFC r344181: Fix Makefile conditional after r344179

MFC r344182: Use make's :tl instead of checking "no" and "NO"

MFC r344189: Fixup bsd.prog.mk after r344182

MFC r344211: wlandebug: disable PIE to fix build failure

libifconfig is built as a static-only PRIVATELIB (and there is no _pie.a
version) so disable PIE in libifconfig's consumer.

r345489: Fix GNU objdump build under WITH_PIE

Explicitly specified bare .a libraries need ${PIE_SUFFIX}.

r345490: Apply WITH_PIE changes to other binutils components

Followon to r345489, explicitly specified bare .a libraries need
${PIE_SUFFIX} (although these still built).

r345778: Fix gdb/kgdb build under WITH_PIE

Explicitly specified bare .a libraries need ${PIE_SUFFIX}.

Sponsored by:	The FreeBSD Foundation
  • Loading branch information
emaste committed Sep 26, 2019
1 parent 39541a7 commit 9d8325b
Show file tree
Hide file tree
Showing 20 changed files with 110 additions and 45 deletions.
6 changes: 3 additions & 3 deletions gnu/usr.bin/binutils/as/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${TARGET_CPUARCH}-freebsd
NO_SHARED?= yes
.endif

DPADD= ${GNURELTOP}/libbfd/libbfd.a
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
DPADD+= ${GNURELTOP}/libopcodes/libopcodes.a
DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a
LDADD= ${DPADD}

.include <bsd.prog.mk>
4 changes: 2 additions & 2 deletions gnu/usr.bin/binutils/ld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd
.if ${MK_SHARED_TOOLCHAIN} == "no"
NO_SHARED?= yes
.endif
DPADD= ${GNURELTOP}/libbfd/libbfd.a
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
DPADD= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
LDADD= ${DPADD}
CLEANDIRS+= ldscripts
CLEANFILES+= ldemul-list.h stringify.sed
Expand Down
6 changes: 3 additions & 3 deletions gnu/usr.bin/binutils/objcopy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ SRCS= objcopy.c not-strip.c
CFLAGS+= -D_GNU_SOURCE
CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils
CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd
DPADD= ${GNURELTOP}/libbinutils/libbinutils.a
DPADD+= ${GNURELTOP}/libbfd/libbfd.a
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
DPADD= ${GNURELTOP}/libbinutils/libbinutils${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
LDADD= ${DPADD}

.include <bsd.prog.mk>
8 changes: 4 additions & 4 deletions gnu/usr.bin/binutils/objdump/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ CFLAGS+= -D_GNU_SOURCE
CFLAGS+= -I${.CURDIR}/${GNURELTOP}/libbinutils
CFLAGS+= -I${SRCDIR}/binutils
CFLAGS+= -DBFD_VERSION_STRING=\"${VERSION}\"
DPADD= ${GNURELTOP}/libbinutils/libbinutils.a
DPADD+= ${GNURELTOP}/libopcodes/libopcodes.a
DPADD+= ${GNURELTOP}/libbfd/libbfd.a
DPADD+= ${GNURELTOP}/libiberty/libiberty.a
DPADD= ${GNURELTOP}/libbinutils/libbinutils${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libopcodes/libopcodes${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libbfd/libbfd${PIE_SUFFIX}.a
DPADD+= ${GNURELTOP}/libiberty/libiberty${PIE_SUFFIX}.a
LDADD= ${DPADD}

.include <bsd.prog.mk>
7 changes: 4 additions & 3 deletions gnu/usr.bin/gdb/gdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
PROG= gdb${GDB_SUFFIX}
SRCS= gdb.c

BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
${OBJ_BU}/libiberty/libiberty.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a

# libthread_db.so calls back into gdb for the proc services. Make all the
# global symbols visible.
Expand Down
7 changes: 4 additions & 3 deletions gnu/usr.bin/gdb/kgdb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ PROG= kgdb${GDB_SUFFIX}
SRCS= main.c kld.c kthr.c trgt.c trgt_${TARGET_CPUARCH}.c
WARNS?= 2

BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
${OBJ_BU}/libiberty/libiberty.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
BULIBS= ${OBJ_BU}/libbfd/libbfd${PIE_SUFFIX}.a \
${OBJ_BU}/libopcodes/libopcodes${PIE_SUFFIX}.a \
${OBJ_BU}/libiberty/libiberty${PIE_SUFFIX}.a
GDBLIBS= ${OBJ_GDB}/libgdb/libgdb${PIE_SUFFIX}.a

DPADD= ${GDBLIBS} ${BULIBS}
LDADD= ${GDBLIBS} ${BULIBS}
Expand Down
1 change: 1 addition & 0 deletions kerberos5/tools/asn1_compile/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LIBROKEN_A= ${.OBJDIR:H:H}/lib/libroken/libroken.a
LIBADD= vers
LDADD= ${LIBROKEN_A}
DPADD= ${LIBROKEN_A}
MK_PIE:= no

SRCS= \
asn1parse.y \
Expand Down
1 change: 1 addition & 0 deletions kerberos5/tools/slc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LIBADD= vers
LDADD= ${LIBROKEN_A}
DPADD= ${LIBROKEN_A}
MAN=
MK_PIE:= no

SRCS= roken.h \
slc-gram.y \
Expand Down
2 changes: 2 additions & 0 deletions lib/clang/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

.include <bsd.compiler.mk>

MK_PIE:= no # Explicit libXXX.a references

.if ${COMPILER_TYPE} == "clang"
DEBUG_FILES_CFLAGS= -gline-tables-only
.else
Expand Down
1 change: 1 addition & 0 deletions libexec/rtld-elf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

.include <src.opts.mk>
PACKAGE= clibs
MK_PIE= no # Always position independent using local rules
MK_SSP= no

CONFS= libmap.conf
Expand Down
38 changes: 36 additions & 2 deletions share/mk/bsd.lib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,16 @@ CTFFLAGS+= -g
# prefer .s to a .c, add .po, remove stuff not used in the BSD libraries
# .pico used for PIC object files
# .nossppico used for NOSSP PIC object files
.SUFFIXES: .out .o .bc .ll .po .pico .nossppico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln
# .pieo used for PIE object files
.SUFFIXES: .out .o .bc .ll .po .pico .nossppico .pieo .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln

.if !defined(PICFLAG)
.if ${MACHINE_CPUARCH} == "sparc64"
PICFLAG=-fPIC
PIEFLAG=-fPIE
.else
PICFLAG=-fpic
PIEFLAG=-fpie
.endif
.endif

Expand All @@ -115,6 +118,10 @@ PO_FLAG=-pg
${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS:C/^-fstack-protector.*$//} ${CFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

.c.pieo:
${CC} ${PIEFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

.cc.po .C.po .cpp.po .cxx.po:
${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}

Expand All @@ -124,6 +131,9 @@ PO_FLAG=-pg
.cc.nossppico .C.nossppico .cpp.nossppico .cxx.nossppico:
${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS:C/^-fstack-protector.*$//} ${CXXFLAGS:C/^-fstack-protector.*$//} -c ${.IMPSRC} -o ${.TARGET}

.cc.pieo .C.pieo .cpp.pieo .cxx.pieo:
${CXX} ${PIEFLAG} ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}

.f.po:
${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
${CTFCONVERT_CMD}
Expand All @@ -136,7 +146,7 @@ PO_FLAG=-pg
${FC} ${PICFLAG} -DPIC ${FFLAGS:C/^-fstack-protector.*$//} -o ${.TARGET} -c ${.IMPSRC}
${CTFCONVERT_CMD}

.s.po .s.pico .s.nossppico:
.s.po .s.pico .s.nossppico .s.pieo:
${AS} ${AFLAGS} -o ${.TARGET} ${.IMPSRC}
${CTFCONVERT_CMD}

Expand All @@ -155,6 +165,11 @@ PO_FLAG=-pg
${CFLAGS:C/^-fstack-protector.*$//} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

.asm.pieo:
${CC:N${CCACHE_BIN}} -x assembler-with-cpp ${PIEFLAG} -DPIC \
${CFLAGS} ${ACFLAGS} -c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

.S.po:
${CC:N${CCACHE_BIN}} -DPROF ${PO_CFLAGS} ${ACFLAGS} -c ${.IMPSRC} \
-o ${.TARGET}
Expand All @@ -170,6 +185,11 @@ PO_FLAG=-pg
-c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

.S.pieo:
${CC:N${CCACHE_BIN}} ${PIEFLAG} -DPIC ${CFLAGS} ${ACFLAGS} \
-c ${.IMPSRC} -o ${.TARGET}
${CTFCONVERT_CMD}

_LIBDIR:=${LIBDIR}
_SHLIBDIR:=${SHLIBDIR}

Expand Down Expand Up @@ -334,6 +354,20 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS}

.endif # !defined(INTERNALLIB)

.if defined(INTERNALLIB) && ${MK_PIE} != "no"
PIEOBJS+= ${OBJS:.o=.pieo}
DEPENDOBJS+= ${PIEOBJS}
CLEANFILES+= ${PIEOBJS}

_LIBS+= lib${LIB_PRIVATE}${LIB}_pie.a

lib${LIB_PRIVATE}${LIB}_pie.a: ${PIEOBJS}
@${ECHO} building pie ${LIB} library
@rm -f ${.TARGET}
${AR} ${ARFLAGS} ${.TARGET} ${PIEOBJS} ${ARADD}
${RANLIB} ${RANLIBFLAGS} ${.TARGET}
.endif

.if defined(_SKIP_BUILD)
all:
.else
Expand Down
1 change: 1 addition & 0 deletions share/mk/bsd.opts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ __DEFAULT_NO_OPTIONS = \
CCACHE_BUILD \
CTF \
INSTALL_AS_USER \
PIE \
RETPOLINE \
STALE_STAGED

Expand Down
9 changes: 7 additions & 2 deletions share/mk/bsd.prog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ MK_DEBUG_FILES= no
.if ${MK_BIND_NOW} != "no"
LDFLAGS+= -Wl,-znow
.endif
.if ${MK_PIE} != "no" && (!defined(NO_SHARED) || ${NO_SHARED:tl} == "no")
CFLAGS+= -fPIE
CXXFLAGS+= -fPIE
LDFLAGS+= -pie
.endif
.if ${MK_RETPOLINE} != "no"
CFLAGS+= -mretpoline
CXXFLAGS+= -mretpoline
# retpolineplt is broken with static linking (PR 233336)
.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO"
.if !defined(NO_SHARED) || ${NO_SHARED:tl} == "no"
LDFLAGS+= -Wl,-zretpolineplt
.endif
.endif
Expand All @@ -68,7 +73,7 @@ TAGS+= package=${PACKAGE:Uruntime}
TAG_ARGS= -T ${TAGS:[*]:S/ /,/g}
.endif

.if defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")
.if defined(NO_SHARED) && ${NO_SHARED:tl} != "no"
LDFLAGS+= -static
.endif

Expand Down
52 changes: 29 additions & 23 deletions share/mk/src.libnames.mk
Original file line number Diff line number Diff line change
Expand Up @@ -398,19 +398,25 @@ LDADD_gtest_main= -lprivategtest_main
LIB${_l:tu}?= ${LIBDESTDIR}${LIBDIR_BASE}/libprivate${_l}.a
.endfor

.if ${MK_PIE} != "no"
PIE_SUFFIX= _pie
.endif

.for _l in ${_LIBRARIES}
.if ${_INTERNALLIBS:M${_l}} || !defined(SYSROOT)
LDADD_${_l}_L+= -L${LIB${_l:tu}DIR}
.endif
DPADD_${_l}?= ${LIB${_l:tu}}
.if ${_PRIVATELIBS:M${_l}}
LDADD_${_l}?= -lprivate${_l}
.elif ${_INTERNALLIBS:M${_l}}
LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l:S/${PIE_SUFFIX}//}${PIE_SUFFIX}
.else
LDADD_${_l}?= ${LDADD_${_l}_L} -l${_l}
.endif
# Add in all dependencies for static linkage.
.if defined(_DP_${_l}) && (${_INTERNALLIBS:M${_l}} || \
(defined(NO_SHARED) && (${NO_SHARED} != "no" && ${NO_SHARED} != "NO")))
(defined(NO_SHARED) && ${NO_SHARED:tl} != "no"))
.for _d in ${_DP_${_l}}
DPADD_${_l}+= ${DPADD_${_d}}
LDADD_${_l}+= ${LDADD_${_d}}
Expand Down Expand Up @@ -457,69 +463,69 @@ LDADD+= ${LDADD_${_l}}

# INTERNALLIB definitions.
LIBELFTCDIR= ${OBJTOP}/lib/libelftc
LIBELFTC?= ${LIBELFTCDIR}/libelftc.a
LIBELFTC?= ${LIBELFTCDIR}/libelftc${PIE_SUFFIX}.a

LIBPEDIR= ${OBJTOP}/lib/libpe
LIBPE?= ${LIBPEDIR}/libpe.a
LIBPE?= ${LIBPEDIR}/libpe${PIE_SUFFIX}.a

LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd
LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a
LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd${PIE_SUFFIX}.a

LIBSMDIR= ${OBJTOP}/lib/libsm
LIBSM?= ${LIBSMDIR}/libsm.a
LIBSM?= ${LIBSMDIR}/libsm${PIE_SUFFIX}.a

LIBSMDBDIR= ${OBJTOP}/lib/libsmdb
LIBSMDB?= ${LIBSMDBDIR}/libsmdb.a
LIBSMDB?= ${LIBSMDBDIR}/libsmdb${PIE_SUFFIX}.a

LIBSMUTILDIR= ${OBJTOP}/lib/libsmutil
LIBSMUTIL?= ${LIBSMUTILDIR}/libsmutil.a
LIBSMUTIL?= ${LIBSMUTILDIR}/libsmutil${PIE_SUFFIX}.a

LIBNETBSDDIR?= ${OBJTOP}/lib/libnetbsd
LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd.a
LIBNETBSD?= ${LIBNETBSDDIR}/libnetbsd${PIE_SUFFIX}.a

LIBVERSDIR?= ${OBJTOP}/kerberos5/lib/libvers
LIBVERS?= ${LIBVERSDIR}/libvers.a
LIBVERS?= ${LIBVERSDIR}/libvers${PIE_SUFFIX}.a

LIBSLDIR= ${OBJTOP}/kerberos5/lib/libsl
LIBSL?= ${LIBSLDIR}/libsl.a
LIBSL?= ${LIBSLDIR}/libsl${PIE_SUFFIX}.a

LIBIPFDIR= ${OBJTOP}/sbin/ipf/libipf
LIBIPF?= ${LIBIPFDIR}/libipf.a
LIBIPF?= ${LIBIPFDIR}/libipf${PIE_SUFFIX}.a

LIBTELNETDIR= ${OBJTOP}/lib/libtelnet
LIBTELNET?= ${LIBTELNETDIR}/libtelnet.a
LIBTELNET?= ${LIBTELNETDIR}/libtelnet${PIE_SUFFIX}.a

LIBCRONDIR= ${OBJTOP}/usr.sbin/cron/lib
LIBCRON?= ${LIBCRONDIR}/libcron.a
LIBCRON?= ${LIBCRONDIR}/libcron${PIE_SUFFIX}.a

LIBNTPDIR= ${OBJTOP}/usr.sbin/ntp/libntp
LIBNTP?= ${LIBNTPDIR}/libntp.a
LIBNTP?= ${LIBNTPDIR}/libntp${PIE_SUFFIX}.a

LIBNTPEVENTDIR= ${OBJTOP}/usr.sbin/ntp/libntpevent
LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent.a
LIBNTPEVENT?= ${LIBNTPEVENTDIR}/libntpevent${PIE_SUFFIX}.a

LIBOPTSDIR= ${OBJTOP}/usr.sbin/ntp/libopts
LIBOPTS?= ${LIBOPTSDIR}/libopts.a
LIBOPTS?= ${LIBOPTSDIR}/libopts${PIE_SUFFIX}.a

LIBPARSEDIR= ${OBJTOP}/usr.sbin/ntp/libparse
LIBPARSE?= ${LIBPARSEDIR}/libparse.a
LIBPARSE?= ${LIBPARSEDIR}/libparse${PIE_SUFFIX}.a

LIBLPRDIR= ${OBJTOP}/usr.sbin/lpr/common_source
LIBLPR?= ${LIBLPRDIR}/liblpr.a
LIBLPR?= ${LIBLPRDIR}/liblpr${PIE_SUFFIX}.a

LIBFIFOLOGDIR= ${OBJTOP}/usr.sbin/fifolog/lib
LIBFIFOLOG?= ${LIBFIFOLOGDIR}/libfifolog.a
LIBFIFOLOG?= ${LIBFIFOLOGDIR}/libfifolog${PIE_SUFFIX}.a

LIBBSNMPTOOLSDIR= ${OBJTOP}/usr.sbin/bsnmpd/tools/libbsnmptools
LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a
LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools${PIE_SUFFIX}.a

LIBAMUDIR= ${OBJTOP}/usr.sbin/amd/libamu
LIBAMU?= ${LIBAMUDIR}/libamu.a
LIBAMU?= ${LIBAMUDIR}/libamu${PIE_SUFFIX}.a

LIBBE?= ${LIBBEDIR}/libbe.a
LIBBE?= ${LIBBEDIR}/libbe${PIE_SUFFIX}.a

LIBPMCSTATDIR= ${OBJTOP}/lib/libpmcstat
LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat.a
LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a

LIBC_NOSSP_PICDIR= ${OBJTOP}/lib/libc
LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a
Expand Down
1 change: 1 addition & 0 deletions stand/i386/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
LOADER_ADDRESS?=0x200000
LDFLAGS+= -nostdlib
LDFLAGS.lld+= -Wl,--no-rosegment
MK_PIE:= no

# BTX components
BTXDIR= ${BOOTOBJ}/i386/btx
Expand Down
3 changes: 3 additions & 0 deletions tools/build/options/WITHOUT_PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.\" $FreeBSD$
Do not build dynamically linked binaries as
Position-Independent Executable (PIE).
3 changes: 3 additions & 0 deletions tools/build/options/WITH_PIE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.\" $FreeBSD$
Build dynamically linked binaries as
Position-Independent Executable (PIE).
2 changes: 2 additions & 0 deletions usr.bin/clang/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ WARNS?= 0

.include <bsd.compiler.mk>

MK_PIE:= no # Explicit libXXX.a references

.if ${COMPILER_TYPE} == "clang"
DEBUG_FILES_CFLAGS= -gline-tables-only
.else
Expand Down
2 changes: 2 additions & 0 deletions usr.bin/svn/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

.include <src.opts.mk>

MK_PIE:= no # Explicit libXXX.a references

.if ${MK_SVN} == "yes"
SVNLITE?=
.else
Expand Down
Loading

0 comments on commit 9d8325b

Please sign in to comment.