From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yann E. MORIN Date: Sat, 20 Jul 2013 12:36:23 +0200 Subject: [Buildroot] [PATCH v3 2/2] ext-toolchain-wrapper: fix uboot/linux with hardfp In-Reply-To: <1374276718-14000-2-git-send-email-spenser@gillilanding.com> References: <1374276718-14000-1-git-send-email-spenser@gillilanding.com> <1374276718-14000-2-git-send-email-spenser@gillilanding.com> Message-ID: <20130720103623.GB3507@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net Spenser, All, On 2013-07-19 18:31 -0500, Spenser Gilliland spake thusly: > The linux kernel and uboot specify -msoft-float in order to prevent floating > point code from being generated. This causes a conflict when -mfloat-abi=hard > or -mfloat-abi options are specified in the wrapper. This patch removes the > -mfloat-abi option from the options generated by the wrapper only when -msoft-float, -mhard-float or -mfloat-abi are specified by the user. Please, wrap your commit log at <80 chars. > > Signed-off-by: Spenser Gilliland Tested-by: "Yann E. MORIN" Reviewed-by: "Yann E. MORIN" Yet a few minor nits below. Regards, Yann E. MORIN. > --- > .../toolchain-external/ext-toolchain-wrapper.c | 37 +++++++++++++++++++--- > 1 file changed, 33 insertions(+), 4 deletions(-) > > diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c > index dc473be..3b70610 100644 > --- a/toolchain/toolchain-external/ext-toolchain-wrapper.c > +++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c [--SNIP--] > @@ -61,6 +59,25 @@ static char *predef_args[] = { > #endif > }; > > +/* use_default_float_abi - determine if the user is trying to override the > + * floating point abi. > + * return 0 if the user is attempting to override the float abi > + * otherwise return 1 I'd state it differently: use_default_float_abi - check whether we should pass our own float ABI flags, or use the ones provided on the command line Returns: 0: do not add our -float-abi= flag 1: do add our -mfloat-abi= flags > + */ > +int use_default_float_abi(int argc, char **argv) { > + int arg; > + for (arg = 1; arg < argc; arg++) { > + if (strncmp(argv[arg],"-mfloat-abi=", sizeof("-mfloat-abi=")/sizeof(char)-1) == 0 || I think that we can assume that sizeof(char) == 1 everywhere Buildroot is expected to run, no? ;-) > + strcmp(argv[arg],"-msoft-float") == 0 || > + strcmp(argv[arg],"-mhard-float") == 0 ) { > + printf("DETECTED FLOAT ABI\n"); > + return 0; > + } > + } > + No spaces/tabs on empty lines. Otherwise, loogs good, and most importantly, fixes my kernel build! Hurray! :-) 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. | '------------------------------^-------^------------------^--------------------'