public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Support extra host compiler flags
@ 2011-10-05  1:21 Michael Hope
  2011-10-05 21:35 ` Yann E. MORIN
  2011-10-08 20:04 ` Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Hope @ 2011-10-05  1:21 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: crossgcc

# HG changeset patch
# User Michael Hope <michael.hope@linaro.org>
# Date 1317777591 -46800
# Node ID 415f1de11ddcc321d5e6cf2f7cd058973045507f
# Parent  f051032a1070eda28557dd738c35446b44787217
Support extra host compiler flags.

Allow the user to configure extra flags to pass to the host compiler
at build time.  Applies to both C and C++.

Useful on Ubuntu to turn off the stack protector and fortify defaults
so the program stands a better chance of running on other distros.

Signed-off-by: Michael Hope <michael.hope@linaro.org>

diff -r f051032a1070 -r 415f1de11ddc config/global/build-behave.in
--- a/config/global/build-behave.in	Wed Oct 05 14:15:45 2011 +1300
+++ b/config/global/build-behave.in	Wed Oct 05 14:19:51 2011 +1300
@@ -41,6 +41,16 @@
       Use gcc's option -pipe to use pipes rather than temp files when building
       the toolchain.
 
+config EXTRA_FLAGS_FOR_HOST
+    string
+    prompt "Extra host compiler flags"
+    default ""
+    help
+      Extra flags to pass to the host C and C++ compiler.
+
+      May be used to change the default features of the host
+      compiler such as turning off the stack protector or fortify.
+
 choice
     bool
     prompt "Shell to use as CONFIG_SHELL"
diff -r f051032a1070 -r 415f1de11ddc scripts/crosstool-NG.sh.in
--- a/scripts/crosstool-NG.sh.in	Wed Oct 05 14:15:45 2011 +1300
+++ b/scripts/crosstool-NG.sh.in	Wed Oct 05 14:19:51 2011 +1300
@@ -479,7 +479,7 @@
     esac
 
     # Help gcc
-    CT_CFLAGS_FOR_HOST=
+    CT_CFLAGS_FOR_HOST="${CT_EXTRA_FLAGS_FOR_HOST}"
     [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST="${CT_CFLAGS_FOR_HOST} -pipe"
 
     # Override the configured jobs with what's been given on the command line

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Support extra host compiler flags
  2011-10-05  1:21 [PATCH] Support extra host compiler flags Michael Hope
@ 2011-10-05 21:35 ` Yann E. MORIN
  2011-10-08 20:04 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2011-10-05 21:35 UTC (permalink / raw)
  To: crossgcc; +Cc: Michael Hope

Michael, All,

On Wednesday 05 October 2011 03:20:58 Michael Hope wrote:
> # HG changeset patch
> # User Michael Hope <michael.hope@linaro.org>
> # Date 1317777591 -46800
> # Node ID 415f1de11ddcc321d5e6cf2f7cd058973045507f
> # Parent  f051032a1070eda28557dd738c35446b44787217
> Support extra host compiler flags.

This is typically a case where "category/component" does not apply... :-/
Usually, I use something like:
  scripts: suport extra host compiler flags

> Allow the user to configure extra flags to pass to the host compiler
> at build time.  Applies to both C and C++.
> 
> Useful on Ubuntu to turn off the stack protector and fortify defaults
> so the program stands a better chance of running on other distros.
> 
> Signed-off-by: Michael Hope <michael.hope@linaro.org>
> 
> diff -r f051032a1070 -r 415f1de11ddc config/global/build-behave.in
> --- a/config/global/build-behave.in	Wed Oct 05 14:15:45 2011 +1300
> +++ b/config/global/build-behave.in	Wed Oct 05 14:19:51 2011 +1300
> @@ -41,6 +41,16 @@
>        Use gcc's option -pipe to use pipes rather than temp files when building
>        the toolchain.
>  
> +config EXTRA_FLAGS_FOR_HOST
> +    string
> +    prompt "Extra host compiler flags"
> +    default ""
> +    help
> +      Extra flags to pass to the host C and C++ compiler.
> +
> +      May be used to change the default features of the host
> +      compiler such as turning off the stack protector or fortify.

(see below) Add:
        Those flags are passed after all the internally-computed
        flags, so will override them.

> +
>  choice
>      bool
>      prompt "Shell to use as CONFIG_SHELL"
> diff -r f051032a1070 -r 415f1de11ddc scripts/crosstool-NG.sh.in
> --- a/scripts/crosstool-NG.sh.in	Wed Oct 05 14:15:45 2011 +1300
> +++ b/scripts/crosstool-NG.sh.in	Wed Oct 05 14:19:51 2011 +1300
> @@ -479,7 +479,7 @@
>      esac
>  
>      # Help gcc
> -    CT_CFLAGS_FOR_HOST=
> +    CT_CFLAGS_FOR_HOST="${CT_EXTRA_FLAGS_FOR_HOST}"
>      [ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST="${CT_CFLAGS_FOR_HOST} -pipe"

I'd rather like that the user-specified flags are passed last, so they have
a chance to override the automatically-computed flags.

Otherwise, good.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Support extra host compiler flags
  2011-10-05  1:21 [PATCH] Support extra host compiler flags Michael Hope
  2011-10-05 21:35 ` Yann E. MORIN
@ 2011-10-08 20:04 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2011-10-08 20:04 UTC (permalink / raw)
  To: crossgcc; +Cc: Michael Hope

Michael, All,

On Wednesday 05 October 2011 03:20:58 Michael Hope wrote:
> # HG changeset patch
> # User Michael Hope <michael.hope@linaro.org>
> # Date 1317777591 -46800
> # Node ID 415f1de11ddcc321d5e6cf2f7cd058973045507f
> # Parent  f051032a1070eda28557dd738c35446b44787217
> Support extra host compiler flags.

Applied as #99de89e9acba, but adding the custom flags at the end. Thank you!

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-08 20:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-05  1:21 [PATCH] Support extra host compiler flags Michael Hope
2011-10-05 21:35 ` Yann E. MORIN
2011-10-08 20:04 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).