# HG changeset patch # User Michael Hope # Date 1317777591 -46800 # Node ID 99de89e9acba8727c5aaf161bc0226ccf593f196 # Parent e8d25b041de544cfe46c76bf9cba3bdb15985335 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 [yann.morin.1998@anciens.enib.fr: put the custom flags at the end] Signed-off-by: "Yann E. MORIN" diff -r e8d25b041de5 -r 99de89e9acba config/global/build-behave.in --- a/config/global/build-behave.in Thu Sep 29 15:16:48 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 e8d25b041de5 -r 99de89e9acba scripts/crosstool-NG.sh.in --- a/scripts/crosstool-NG.sh.in Thu Sep 29 15:16:48 2011 +1300 +++ b/scripts/crosstool-NG.sh.in Wed Oct 05 14:19:51 2011 +1300 @@ -476,7 +476,8 @@ # 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}"