This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LIBGO PATCH] Fix compilation error against uClibc-ng: runtime_sysinfo.go: error: use of undefined type ‘___uclibc_locale_struct’
- From: Ian Lance Taylor <iant at golang dot org>
- To: Alex Potapenko <opotapenko at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Waldemar Brodkorb <wbx at uclibc-ng dot org>
- Date: Fri, 29 Sep 2017 05:56:14 -0700
- Subject: Re: [LIBGO PATCH] Fix compilation error against uClibc-ng: runtime_sysinfo.go: error: use of undefined type ‘___uclibc_locale_struct’
- Authentication-results: sourceware.org; auth=none
- References: <CAF5aO=+3VEXEs5RZ9sV=q9Ej6z5B62BaTG9Uvt2DQ4RC9shvgQ@mail.gmail.com>
On Fri, Sep 29, 2017 at 1:38 AM, Alex Potapenko <opotapenko@gmail.com> wrote:
>
> Building GCC 7.2.0 libgo against uClibc-ng 1.0.26 results in the following
> error:
>
>> runtime_sysinfo.go:418:17: error: use of undefined type
>> ‘___uclibc_locale_struct’
>
>
> This happens because -fdump-go-spec probably generates types only from
> typedef declarations, ignoring structs, like "struct
> __uclibc_locale_struct;" in uClibc-ng <bits/uClibc_locale.h> header. Adding
> "typedef struct __uclibc_locale_struct __uclibc_locale_struct;" to
> libgo/sysinfo.c remedies this issue:
>
> --- a/libgo/sysinfo.c
> +++ b/libgo/sysinfo.c
> @@ -277,3 +277,7 @@
> epoll_data_offset = offsetof(struct epoll_event, data)
> };
> #endif
> +
> +#ifdef __UCLIBC__
> +typedef struct __uclibc_locale_struct __uclibc_locale_struct;
> +#endif
-fdump-go-spec doesn't ignore structs, so I feel like there may be
something else going on. Could you send the generated gen-sysinfo.go
file (without your patch)? Thanks.
Ian