Skip to content

Commit

Permalink
HBSD: Only enable PIEified base for amd64 and i386.
Browse files Browse the repository at this point in the history
Compiling (nearly) all of base causes issues with booting arm64 (and
likely arm, but I haven't verified that, yet). As I learn the arm64
architecture, and as I learn its boot process and what code is
involved with that, PIEified base will make its debut on arm64. I'm
hoping to complete that during BSDCan.

With this commit, PIEified base can be considered complete on amd64
and i386.

Signed-off-by:	Shawn Webb <shawn.webb@hardenedbsd.org>
  • Loading branch information
lattera committed Apr 8, 2016
1 parent b2207b5 commit 84d8e20
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion share/mk/bsd.opts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
.if !target(__<bsd.opts.mk>__)
__<bsd.opts.mk>__:

.if defined(TARGET_ARCH)
__T=${TARGET_ARCH}
.else
__T=${MACHINE_ARCH}
.endif

.if !defined(_WITHOUT_SRCCONF)
#
# Define MK_* variables (which are either "yes" or "no") for users
Expand Down Expand Up @@ -60,7 +66,6 @@ __DEFAULT_YES_OPTIONS = \
NIS \
NLS \
OPENSSH \
PIE \
PROFILE \
SSP \
SYMVER \
Expand All @@ -78,6 +83,11 @@ __DEFAULT_DEPENDENT_OPTIONS = \
STAGING_MAN/STAGING \
STAGING_PROG/STAGING \

.if ${__T} == "amd64" || ${__T} == "i386"
__DEFAULT_YES_OPTIONS+=PIE
.else
__DEFAULT_NO_OPTIONS+=PIE
.endif

.include <bsd.mkopt.mk>

Expand Down

2 comments on commit 84d8e20

@opntr
Copy link

@opntr opntr commented on 84d8e20 Apr 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you handle this problem here? And what is this __T hack?

@opntr
Copy link

@opntr opntr commented on 84d8e20 Apr 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should handle this from src.opts.mk, where this logic already exists.

Please sign in to comment.