mstorsjo / llvm-mingw

An LLVM/Clang/LLD based mingw-w64 toolchain
Other
1.88k stars 184 forks source link

Cannot build gettext with clang #46

Closed mathias-freire closed 3 years ago

mathias-freire commented 5 years ago

I cannot build gettext with clang. But with gcc, there is no errors.

libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDlibtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./setlocale.c -o setlocale.o
IR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./printf.c -o printf.o
In file included from ./localename.c:25:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./localename.c:25:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
./localename.c:2690:5: error: unknown type name 'locale_t'; did you mean '_locale_t'?
    locale_t thread_locale = uselocale (NULL);
    ^~~~~~~~
    _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./localename.c:2690:30: warning: implicit declaration of function 'uselocale' is invalid in C99 [-Wimplicit-function-declaration]
    locale_t thread_locale = uselocale (NULL);
                             ^
./localename.c:2690:14: warning: incompatible integer to pointer conversion initializing '_locale_t' (aka 'struct localeinfo_struct *') with an expression of type 'int' [-Wint-conversion]
    locale_t thread_locale = uselocale (NULL);
             ^               ~~~~~~~~~~~~~~~~
./localename.c:2691:26: error: use of undeclared identifier 'LC_GLOBAL_LOCALE'
    if (thread_locale != LC_GLOBAL_LOCALE)
                         ^
3 warnings and 3 errors generated.
/bin/sh ../libtool  --tag=CC --mode=compile x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I..  -O2 -I/d/minpref/include -fvisibility=hidden  ./osdep.c
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./version.c -o version.o
make[4]: *** [Makefile:315: localename.lo] Error 1
make[4]: *** Bitmemiş işler için bekliyor....
In file included from ./version.c:21:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./version.c:21:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
1 warning and 1 error generated.
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./xsize.c -o xsize.o
make[4]: *** [Makefile:323: version.lo] Error 1
In file included from ./setlocale.c:43:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:29: error: unknown type name 'locale_t'; did you mean '_locale_t'?
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                            ^~~~~~~~
                            _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
In file included from ./setlocale.c:43:
In file included from ./gettextP.h:71:
./libgnuintl.h:446:68: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                                                   ^
./setlocale.c:962:1: error: unknown type name 'locale_t'; did you mean '_locale_t'?
locale_t
^~~~~~~~
_locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:963:59: error: unknown type name 'locale_t'; did you mean '_locale_t'?
libintl_newlocale (int category_mask, const char *locale, locale_t base)
                                                          ^~~~~~~~
                                                          _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:963:1: error: conflicting types for 'libintl_newlocale'
libintl_newlocale (int category_mask, const char *locale, locale_t base)
^
./libgnuintl.h:446:38: note: previous declaration is here
extern LIBINTL_DLL_EXPORTED locale_t newlocale (int, const char *, locale_t);
                                     ^
./libgnuintl.h:445:19: note: expanded from macro 'newlocale'
#define newlocale libintl_newlocale
                  ^
./setlocale.c:973:26: error: use of undeclared identifier 'LC_CTYPE_MASK'
          { LC_CTYPE,    LC_CTYPE_MASK },
                         ^
./setlocale.c:974:26: error: use of undeclared identifier 'LC_NUMERIC_MASK'
          { LC_NUMERIC,  LC_NUMERIC_MASK },
                         ^
./setlocale.c:975:26: error: use of undeclared identifier 'LC_TIME_MASK'
          { LC_TIME,     LC_TIME_MASK },
                         ^
./setlocale.c:976:26: error: use of undeclared identifier 'LC_COLLATE_MASK'
          { LC_COLLATE,  LC_COLLATE_MASK },
                         ^
./setlocale.c:977:26: error: use of undeclared identifier 'LC_MONETARY_MASK'
          { LC_MONETARY, LC_MONETARY_MASK },
                         ^
./setlocale.c:978:26: error: use of undeclared identifier 'LC_MESSAGES_MASK'
          { LC_MESSAGES, LC_MESSAGES_MASK }
                         ^
./setlocale.c:981:7: error: unknown type name 'locale_t'; did you mean '_locale_t'?
      locale_t orig_base = base;
      ^~~~~~~~
      _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:983:12: error: use of undeclared identifier 'LC_ALL_MASK'
      if ((LC_ALL_MASK & ~category_mask) == 0)
           ^
./setlocale.c:996:18: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
          base = newlocale (LC_ALL_MASK, base_name, base);
                 ^
./setlocale.c:996:29: error: use of undeclared identifier 'LC_ALL_MASK'
          base = newlocale (LC_ALL_MASK, base_name, base);
                            ^
./setlocale.c:1000:34: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ./setlocale.c:971:14) []'
          for (i = 1; i < sizeof (categories) / sizeof (categories[0]); i++)
                                 ^~~~~~~~~~~~
./setlocale.c:1015:19: error: unknown type name 'locale_t'; did you mean '_locale_t'?
                  locale_t copy = newlocale (category_mask, name, base);
                  ^~~~~~~~
                  _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:1015:28: warning: incompatible integer to pointer conversion initializing '_locale_t' (aka 'struct localeinfo_struct *') with an expression of type 'int' [-Wint-conversion]
                  locale_t copy = newlocale (category_mask, name, base);
                           ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./setlocale.c:1028:34: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ./setlocale.c:971:14) []'
          for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
                                 ^~~~~~~~~~~~
./setlocale.c:1036:19: error: unknown type name 'locale_t'; did you mean '_locale_t'?
                  locale_t copy;
                  ^~~~~~~~
                  _locale_t
D:\mingw-llvm\x86_64-w64-mingw32\include\corecrt.h:444:20: note: '_locale_t' declared here
} _locale_tstruct,*_locale_t;
                   ^
./setlocale.c:1042:26: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
                  copy = newlocale (cat_mask, name, base);
                         ^
./setlocale.c:1042:24: warning: incompatible integer to pointer conversion assigning to '_locale_t' (aka 'struct localeinfo_struct *') from 'int' [-Wint-conversion]
                  copy = newlocale (cat_mask, name, base);
                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./setlocale.c:1059:11: warning: implicit declaration of function 'freelocale' is invalid in C99 [-Wimplicit-function-declaration]
          freelocale (base);
          ^
./setlocale.c:1065:12: warning: implicit declaration of function 'newlocale' is invalid in C99 [-Wimplicit-function-declaration]
    return newlocale (category_mask, locale, base);
           ^
./setlocale.c:1065:12: warning: incompatible integer to pointer conversion returning 'int' from a function with result type '_locale_t' (aka 'struct localeinfo_struct *') [-Wint-conversion]
    return newlocale (category_mask, locale, base);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 warnings and 17 errors generated.
make[4]: *** [Makefile:321: setlocale.lo] Error 1
libtool: compile:  x86_64-w64-mingw32-clang -c -DLOCALEDIR=\"/d/minpref/share/locale\" -DLOCALE_ALIAS_PATH=\"/d/minpref/share/locale\" -DLIBDIR=\"/d/minpref/lib\" -DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"/d/minpref/lib\" -DNO_XMALLOC -Dset_relocation_prefix=libintl_set_relocation_prefix -Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I. -I.. -O2 -I/d/minpref/include -fvisibility=hidden ./osdep.c -o osdep.o
make[4]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime/intl'
make[3]: *** [Makefile:1368: all-recursive] Error 1
make[3]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime'
make[2]: *** [Makefile:1273: all] Error 2
make[2]: Leaving directory '/d/ffbuild/gettext-0.19.8.1/gettext-runtime'
make[1]: *** [Makefile:413: all-recursive] Error 1
make[1]: Leaving directory '/d/ffbuild/gettext-0.19.8.1'
make: *** [Makefile:369: all] Error 2