Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 1/2 v2] bitbake.conf: Add SECURITY_*FLAGS overridable definition
Date: Fri, 28 Jun 2013 14:28:23 -0500	[thread overview]
Message-ID: <51CDE3D7.5060908@windriver.com> (raw)
In-Reply-To: <1372447427-31750-1-git-send-email-sgw@linux.intel.com>

On 6/28/13 2:23 PM, Saul Wold wrote:
> This will allow for SECURITY_CFLAGS and SECURITY_LDFLAGS to be
> defined in the security_flags.inc and override the empty default.
>
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
>   meta/conf/bitbake.conf | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 62a3936..72e1a78 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -493,7 +493,8 @@ export TARGET_CPPFLAGS = ""
>
>   export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
>   BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION}"
> -export CFLAGS = "${TARGET_CFLAGS}"
> +SECURITY_CFLAGS ?= ""
> +export CFLAGS = "${TARGET_CFLAGS} ${SECURITY_CFLAGS}"
>   export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"

I would prefer if the cflags came in via the TARGET_CFLAGS, similar to how the 
selected_optimization works.  In the past we've hacked around with CFLAGS itself 
and in the end it's always seem to have caused problems.  By modifing 
TARGET_CFLAGS instead, then the user can do (in a recipe):

CFLAGS = "-fmy-custom-flag ${TARGET_CFLAGS}"

>   export BUILD_CXXFLAGS = "${BUILD_CFLAGS} -fpermissive"
> @@ -523,7 +524,8 @@ LINKER_HASH_STYLE_mips64 = "sysv"
>   LINKER_HASH_STYLE_mips64el = "sysv"
>   TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
>
> -export LDFLAGS = "${TARGET_LDFLAGS}"
> +SECURITY_LDFLAGS ?= ""
> +export LDFLAGS = "${TARGET_LDFLAGS} ${SECURITY_LDFLAGS}"

Same comment here.

>   export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
>   #export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
>   #                         -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
>



  parent reply	other threads:[~2013-06-28 19:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 19:23 [PATCH 1/2 v2] bitbake.conf: Add SECURITY_*FLAGS overridable definition Saul Wold
2013-06-28 19:23 ` [PATCH 2/2 v2] security_flags: Add the compiler and linker flags that enhance security Saul Wold
2013-06-28 22:11   ` Khem Raj
2013-06-28 19:28 ` Mark Hatle [this message]
2013-06-28 22:13   ` [PATCH 1/2 v2] bitbake.conf: Add SECURITY_*FLAGS overridable definition Khem Raj
2013-06-28 19:51 ` Phil Blundell
2013-06-28 20:19   ` Saul Wold
2013-06-28 21:04     ` Richard Purdie
2013-06-28 21:07     ` Phil Blundell
2013-06-28 21:52       ` Saul Wold
2013-06-28 22:17     ` Khem Raj
2013-06-28 22:16   ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51CDE3D7.5060908@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox