scripts: 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>
[yann.morin.1998@anciens.enib.fr: put the custom flags at the end]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
This commit is contained in:
Yann E. MORIN" 2011-10-05 14:19:51 +13:00 committed by Michael Hope
parent 4ddbf5c7dc
commit 04da3418ca
2 changed files with 12 additions and 1 deletions

View File

@ -41,6 +41,16 @@ config USE_PIPES
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"

View File

@ -476,7 +476,8 @@ if [ -z "${CT_RESTART}" ]; then
# Help gcc
CT_CFLAGS_FOR_HOST=
[ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST="${CT_CFLAGS_FOR_HOST} -pipe"
[ "${CT_USE_PIPES}" = "y" ] && CT_CFLAGS_FOR_HOST+=" -pipe"
CT_CFLAGS_FOR_HOST+="${CT_EXTRA_FLAGS_FOR_HOST}"
# Override the configured jobs with what's been given on the command line
[ -n "${CT_JOBS}" ] && CT_PARALLEL_JOBS="${CT_JOBS}"