Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 May 2014 12:45:12 -0400
From:      Shawn Webb <lattera@gmail.com>
To:        freebsd-current@freebsd.org
Cc:        imp@bsdimp.com
Subject:   Recent Changes to WITH_*/WITHOUT_* in src
Message-ID:  <20140510164512.GS3063@pwnie.vrt.sourcefire.com>

next in thread | raw e-mail | index | archive | help

--6k8oSBQUGGHRSAt9
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hey All,

It seems that the recent changes to the makefiles for building
world/kernel have broken some modifications I have locally for
implementing ASLR+PIE. I'm quite the bsd make newbie, so I thought I'd
ask for a bit of help. I'm sure the solution is quite simple.

My code is up on GitHub. I'll include links at the bottom of the email.

The code in question is in share/mk/bsd.prog.mk, where I'm checking to
see if MK_PIE is not equal to "no". Prior to the recent changes, this
code used to work. (Please note that I know that the way I'm cheking is
a bit bloated, if anyone has any suggestions to trim my code down, let
me know).

How this feature is supposed to work is:
1) PIE is added to the __DEFAULT_NO_OPTIONS to make building
applications as position-independent executables opt-in.
2) User adds WITH_PIE=1 to /etc/src.conf or /etc/make.conf
3) The application being built needs to also specify CAN_PIE=1 in its
Makefile. This is because some applications don't support being built as
a position-independent executable.
4) If MK_PIE is not "no" and CAN_PIE is defined, then add additional
CFLAGS.

The log from my build is here: http://ix.io/cf0

My code is here:
https://github.com/HardenedBSD/hardenedBSD/blob/hardened/current/aslr/share/mk/bsd.prog.mk#L14-L22

Thanks,

Shawn
CC: imp@bsdimp.com

--6k8oSBQUGGHRSAt9
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQIcBAEBAgAGBQJTbleXAAoJEGqEZY9SRW7u/IwP/jCG8v1f1av5nxqcHU0S2xKE
lG7goSmbTs3mk3Lf3a6dEzP2n5QO0i4LISmniPS6nI43P2NyaPiyeQhGrCxjyYGF
ot3bYXnu5W4RU2steh2ArTfx4py5YMNbacSLizvS8bukf9JXgK83Zl3kzDfFLzAH
j3lfGHquPCExfFBPq/7WS1nCQCCgGkalFExrv9ejAq24j3uSGUjIEfhc6fjSDnOV
WQRQ/iVnZcvpGMWl2ij5a+7kTCmDy6m/NON9CNdtr18zre7xf0LDyWQ64mhjmMoC
ckaErRqlKmI3zgxK14LCujV6fI7aQqUg4klbC879ftpdeZOAVxiyqn5xsU3WFH9a
QYBwdXsmo732OvY5J2pxNC+D9BcOv3yStMtTZ+05LeORetCcQ1hBKi91HpV92xIq
Uw9lZiJXq+Cf2yRIgjM+YQXB/FJNwUk6JYBdMfLF35N269BWzWVB5TFk480Vswms
BTfdKdSqhFTkNmqXBEMyVq8JlPsrflE0H1AF70zvUvgNeN4VfQJqrbtF/wmoPC2y
WJ/v1Odd8mchGgYG33SKFkgiWiI2co0aEIhYaWe96iJoqzOAEpAPmhMv1E3E4VAd
QZ/iR0xEIIKlGpLnohqk1k8/pTUCOsE6dk7h1zaxaJxSgtokG7YBrcmjjn++T+NW
sp6YbVyon117weuDV5Ab
=V7K5
-----END PGP SIGNATURE-----

--6k8oSBQUGGHRSAt9--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140510164512.GS3063>