Re: Error message when compiler not present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Joel,

On Tue, May 7, 2019 at 2:56 PM Joel Stanley <joel@xxxxxxxxx> wrote:
>
> Hello,
>
> The other day I was attempting a kernel build and stumbled across this:
>
> $ CROSS_COMPILE=foo make
> /bin/sh: 1: foogcc: not found
> make: foogcc: Command not found
> /bin/sh: 1: foogcc: not found
> /bin/sh: 1: foogcc: not found
> scripts/kconfig/conf  --syncconfig Kconfig
> ./scripts/gcc-version.sh: 17: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/gcc-version.sh: 18: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/gcc-version.sh: 19: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/gcc-version.sh: 17: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/gcc-version.sh: 18: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/gcc-version.sh: 19: ./scripts/gcc-version.sh: foogcc: not found
> ./scripts/clang-version.sh: 11: ./scripts/clang-version.sh: foogcc: not found
> ./scripts/gcc-plugin.sh: 11: ./scripts/gcc-plugin.sh: foogcc: not found
> init/Kconfig:16:warning: 'GCC_VERSION': number is invalid
> /bin/sh: 1: foogcc: not found
> make: foogcc: Command not found
> Compiler lacks asm-goto support.
> make: *** [arch/x86/Makefile:302: checkbin] Error 1
>
> I had something more sensible for CROSS_COMPILE, but the point is it
> did not exist in my $PATH.
>
> I tried the patch below but there's still something calling the
> $(CROSS_COMPILE)gcc before gcc-version:
>
> $ CROSS_COMPILE=foo  make
> /bin/sh: 1: foogcc: not found
> make: foogcc: Command not found
> Compiler lacks asm-goto support.
>
> This isn't a big deal but if there's a simple fix it would be nice to clean up.

Yeah, I had noticed this, and it is somewhat ugly.

Instead of fixing every script,
I want to terminate Kconfig in the very beginning of the parse stage.

https://patchwork.kernel.org/patch/10936811/


I still see some "/bin/sh: 1: foogcc: not found" in the build stage,
but not fixing up every $(shell ...) calls
since displaying some warnings is not a big deal.

Thanks.

>
> Cheers,
>
> Joel
>
> --- a/scripts/gcc-version.sh
> +++ b/scripts/gcc-version.sh
> @@ -8,6 +8,11 @@
>
>  compiler="$*"
>
> +if [ -x "command -v ${#compiler}" ]; then
> +       echo "Error: Compiler not found." >&2
> +       exit 1
> +fi
> +
>  if [ ${#compiler} -eq 0 ]; then
>         echo "Error: No compiler specified." >&2
>         printf "Usage:\n\t$0 <gcc-command>\n" >&2



-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux