]> git.dujemihanovic.xyz Git - u-boot.git/commit
include: fix 'ulong' definition on musl targets
authorSergei Trofimovich <slyfox@gentoo.org>
Mon, 30 Dec 2019 15:53:41 +0000 (15:53 +0000)
committerTom Rini <trini@konsulko.com>
Fri, 3 Jan 2020 14:47:10 +0000 (09:47 -0500)
commitd11fa9c16b8f50788c07e22bd742177d14e435b2
tree1ed4c4c9880e5567827802d2e42e25d09a1e1fdb
parent4b75aa5aa78768fc81b782ee51d960dfed76f6e1
include: fix 'ulong' definition on musl targets

The build failure was originally reported on arm64-musl
target at https://bugs.gentoo.org/703132. Here is the amd64-musl
variant:

```
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all            -j$(nproc)
...
In file included from tools/env/../../env/flags.c:7,
                 from tools/env/env_flags.c:1:
include/env.h:159:1: error: unknown type name 'ulong'; did you mean 'long'?
  159 | ulong env_get_ulong(const char *name, int base, ulong default_val);
      | ^~~~~
      | long
```

Note: 'ulong' is not defined there.

On glibc 'ulong' comes from <sys/types.h>:

```c
/* Old compatibility names for C types.  */
typedef unsigned long int ulong;
```

On musl it comes from <sys/types.h> as well but from under different guards:

```c
typedef unsigned long u_long, ulong;
```

The change inlines 'ulong' define similar to 'uint' define.

Bug: https://bugs.gentoo.org/703132
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
include/compiler.h