[U-Boot] Building under Cygwin - "-ansi" flag?

Masahiro Yamada yamada.m at jp.panasonic.com
Fri Jun 6 12:58:21 CEST 2014


Hi.


On Thu, 8 May 2014 14:49:35 +0300
Vasili Galka <vvv444 at gmail.com> wrote:

> Hi,
> 
> I'm building u-boot (am335x_evm config) using arm-none-eabi toolchain
> under Cygwin. When trying to build unmodified v2014.04 tag I get some
> errors. However, if I remove the "-ansi" flag from the Makefile,
> everything builds fine:
> 
> -ifeq ($(HOSTOS),cygwin)
> -HOSTCFLAGS    += -ansi
> -endif
> 
> I tried tracking down where those lines came from and why building
> under Cygwin requires separate treatment. I found our this originates
> from the following commit (dated Jan 2008):
> 
>   SHA-1: 883e3925d99a8dd69c5b0201cba5b1887f88f95c
> 
>   * Fix build problems under Cygwin
> 
>   This patch allows u-boot to build without error in a cygwin
>   environment.  Cygwin does not define __u64 in it's
>   include/asm/types.h file.  The -idirafter flag in the u-boot
>   build causes the inclusion of the cygwin types.h file as opposed
>   to u-bot/include/asm/types.h file which does define __u64.
>   Subsequently, sha1.c compile fails due to unknown symbol.
> 
>   Signed-off-by: Brian Miller <raptorbrino at netscape.net>
> 
> This comment does not really explain why "-ansi" flag is required.
> Personally, I don't see any reason for it.
> 
> Maybe it should be removed at all?
> 


As far as I tested,  missing __u64 error occurred
when I tried to build host tools on Cygwin,
regardless  with/without  -ansi option.


This is my build log:


  GEN     include/autoconf.mk.dep
  GEN     include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c: In function 'parse_config_file':
scripts/basic/fixdep.c:255:4: warning: array subscript has type 'char' [-Wchar-subscripts]
    if (!(isalnum(*q) || *q == '_'))
    ^
  CC      lib/asm-offsets.s
  GEN     include/generated/generic-asm-offsets.h
  HOSTCC  tools/img2srec
In file included from /home/yamada/workspace/u-boot/include/libfdt_env.h:13:0,
                 from <command-line>:0:
/home/yamada/workspace/u-boot/include/linux/types.h:135:1: error: unknown type name '__u64'
 typedef __u64 __bitwise __le64;
 ^
/home/yamada/workspace/u-boot/include/linux/types.h:136:1: error: unknown type name '__u64'
 typedef __u64 __bitwise __be64;
 ^
scripts/Makefile.host:118: recipe for target 'tools/img2srec' failed
make[1]: *** [tools/img2srec] Error 1
Makefile:1022: recipe for target 'tools' failed
make: *** [tools] Error 2







/usr/include/asm/types.h  on my Cygwin is like this:

------------------------------->8----------------------
/* asm/types.h

   Copyright 1998, 2000, 2001 Red Hat, Inc.

This file is part of Cygwin.

This software is a copyrighted work licensed under the terms of the
Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
details. */

#ifndef _ASM_TYPES_H
#define _ASM_TYPES_H

typedef __signed__ char __s8;
typedef unsigned char __u8;

typedef __signed__ short __s16;
typedef unsigned short __u16;

typedef __signed__ int __s32;
typedef unsigned int __u32;

#endif /* _ASM_TYPES_H */
-----------------------------8<-----------------------------


Best Regards
Masahiro Yamada



More information about the U-Boot mailing list