[Buildroot] [PATCH v3 2/2] ext-toolchain-wrapper: fix uboot/linux with hardfp

Yann E. MORIN yann.morin.1998 at free.fr
Sat Jul 20 10:36:23 UTC 2013


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 <spenser at gillilanding.com>

Tested-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998 at free.fr>

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.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list