[Toybox] [PATCH] Clean warnings generated by scripts/genconfig.sh

Rob Landley rob at landley.net
Sat Mar 3 08:48:48 PST 2012


On 02/28/2012 01:16 AM, Georgi Chorbadzhiyski wrote:
> It looks like configure should not do CC="${CROSS_COMPILE}${CC}"
> unconditionally.
> Isn't it better to use ${CROSS_COMPILE}${CC} instead in the scripts
> instead of
> redefining CC. Something like this:
> 
> diff -r 763d581badae configure
> --- a/configure Sun Feb 26 22:04:37 2012 -0600
> +++ b/configure Tue Feb 28 09:15:14 2012 +0200
> @@ -9,6 +9,5 @@
>  CFLAGS="$CFLAGS -funsigned-char"
>  [ -z "$OPTIMIZE" ] && OPTIMIZE="-Os -ffunction-sections -fdata-sections
> -Wl,--gc-sections"
>  [ -z "$CC" ] && CC="cc"
> -CC="${CROSS_COMPILE}${CC}"
>  [ -z "$STRIP" ] && STRIP="${CROSS_COMPILE}strip"
>  [ -z "$HOSTCC" ] && HOSTCC=gcc
> diff -r 763d581badae scripts/genconfig.sh
> --- a/scripts/genconfig.sh      Sun Feb 26 22:04:37 2012 -0600
> +++ b/scripts/genconfig.sh      Tue Feb 28 09:15:14 2012 +0200
> @@ -13,7 +13,7 @@
>    # Probe for container support on target
> 
>    echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" ||
> return 1
> -  $CC -c -xc -o /dev/null - << EOF
> +  ${CROSS_COMPILE}${CC} -c -xc -o /dev/null - << EOF
>      #include <sched.h>
>      int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET;
>  EOF
> diff -r 763d581badae scripts/make.sh
> --- a/scripts/make.sh   Sun Feb 26 22:04:37 2012 -0600
> +++ b/scripts/make.sh   Tue Feb 28 09:15:14 2012 +0200
> @@ -102,7 +102,7 @@
>    "$@"
>  }
> 
> -do_loudly $CC $CFLAGS -I . -o toybox_unstripped $OPTIMIZE main.c lib/*.c \
> +do_loudly ${CROSS_COMPILE}${CC} $CFLAGS -I . -o toybox_unstripped
> $OPTIMIZE main.c lib/*.c \
>    $TOYFILES -Wl,--as-needed,-lutil,--no-as-needed || exit 1
>  do_loudly $STRIP toybox_unstripped -o toybox || exit 1
>  # gcc 4.4's strip command is buggy, and doesn't set the executable bit on
> 

You're right.  I've been holding off on most of your patches until after
this release, but this one's needed now.

Unfortunately, saving your email message to a file and trying to "patch
-p1" it gave me all rejects, I think it's whitespace damaged or
something.  I'll apply the changes by hand, just FYI.

Thanks,

Rob

 1330793328.0


More information about the Toybox mailing list