conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
950 stars 1.73k forks source link

[package] libiconv/1.17: fails to build with `clang` on Windows #25245

Open mmomtchev opened 2 weeks ago

mmomtchev commented 2 weeks ago

Description

libiconv fails to build with clangon Windows - this is a different problem from the other iconv problems:

https://github.com/conan-io/conan-center-index/issues/20848 https://github.com/conan-io/conan-center-index/issues/20477

This is a more recent problem that seems to be common throughout the autotools-based recipes when using clang.

Package and Environment Details

Conan profile

Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=clang
compiler.cppstd=gnu17
compiler.libcxx=libc++
compiler.version=17
os=Windows
[conf]
tools.build:sharedlinkflags=['-static-libstdc++']
tools.cmake.cmaketoolchain:extra_variables={'CMAKE_AR': 'llvm-ar', 'CMAKE_RANLIB': 'llvm-ranlib', 'CMAKE_NM': 'llvm-nm', 'CMAKE_STRIP': 'llvm-strip', 'CMAKE_OBJDUMP': 'llvm-objdump'}
tools.cmake.cmaketoolchain:generator=MinGW Makefiles
tools.gnu:make_program='C:\clang\make-4.4.1\dist\make.exe'
[buildenv]
CC=clang
CXX=clang++
LD=clang-ld
AR=llvm-ar
RANLIB=llvm-ranlib
NM=llvm-nm
STRIP=llvm-strip
OBJDUMP=llvm-objdump

Steps to reproduce

conan install -pr=clang-win32.profile --build=missing --requires libiconv/1.17

Logs

Click to expand log ``` -------- Installing package libiconv/1.17 (16 of 30) -------- libiconv/1.17: Building from source libiconv/1.17: Package libiconv/1.17:697ff4af68e3adfb2ce9fc03ea77f78dcc1c808d libiconv/1.17: Copying sources to build folder libiconv/1.17: Building your package in C:\Users\mmom\.conan2\p\b\libic87f8a1d6a1f5f\b libiconv/1.17: Calling generate() libiconv/1.17: Generators folder: C:\Users\mmom\.conan2\p\b\libic87f8a1d6a1f5f\b\build-release\conan libiconv/1.17: Generating aggregated env files libiconv/1.17: Generated aggregated env files: ['conanbuild.sh', 'conanrun.bat'] libiconv/1.17: Calling build() libiconv/1.17: apply_conandata_patches(): No patches defined in conandata libiconv/1.17: RUN: "/c/users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/src/configure" --disable-shared --enable-static --prefix=/ --bindir=${prefix}/bin --sbindir=${prefix}/bin --libdir=${prefix}/lib --includedir=${prefix}/include --oldincludedir=${prefix}/include MSYS2 is starting for the first time. Executing the initial setup. mkdir: cannot create directory '/dev/shm': Read-only file system Creating /dev/shm directory failed. POSIX semaphores and POSIX shared memory will not work mkdir: cannot create directory '/dev/mqueue': Read-only file system Creating /dev/mqueue directory failed. POSIX message queues will not work Copying skeleton files. These files are for the users to personalise their msys2 experience. They will never be overwritten nor automatically updated. './.bashrc' -> '/home/mmom/.bashrc' './.bash_logout' -> '/home/mmom/.bash_logout' './.bash_profile' -> '/home/mmom/.bash_profile' './.profile' -> '/home/mmom/.profile' Initial setup complete. MSYS2 is now ready to use. configure: loading site script /etc/config.site checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking whether make sets $(MAKE)... (cached) yes checking for gcc... clang checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... no checking whether clang accepts -g... yes checking for clang option to enable C11 features... unsupported checking for clang option to enable C99 features... unsupported checking for clang option to enable C89 features... unsupported checking whether clang understands -c and -o together... yes checking whether the compiler is clang... yes checking for compiler option needed when checking for declarations... -Werror=implicit-function-declaration checking whether make supports the include directive... yes (GNU style) checking dependency style of clang... none checking how to run the C preprocessor... clang -E checking for strip... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/strip checking build system type... x86_64-w64-mingw32 checking host system type... x86_64-w64-mingw32 checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... no checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... no checking for wchar.h... yes checking for minix/config.h... no checking for sys/param.h... no checking for sys/socket.h... no checking for limits.h... yes checking for sys/time.h... no checking for features.h... no checking for crtdefs.h... yes checking whether it is safe to define __EXTENSIONS__... yes checking whether _XOPEN_SOURCE should be defined... no checking for grep that handles long lines and -e... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep checking for egrep... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep -E checking for Minix Amsterdam compiler... no checking for ar... llvm-ar checking for special C compiler options needed for large files... no checking for _FILE_OFFSET_BITS value needed for large files... unknown checking for _LARGE_FILES value needed for large files... unknown checking how to print strings... printf checking for a sed that does not truncate output... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/sed checking for fgrep... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep -F checking for non-GNU ld... clang-ld checking if the linker (clang-ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... llvm-nm checking the name lister (llvm-nm) interface... BSD nm checking whether ln -s works... no, using cp -pR checking the maximum length of command line arguments... 8192 checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32 checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32 checking for clang-ld option to reload object files... -r checking for file... file checking for objdump... llvm-objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for dlltool... dlltool checking how to associate runtime and link libraries... func_cygming_dll_for_implib checking for archiver @FILE support... @ checking for strip... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/strip checking for ranlib... llvm-ranlib checking command to parse llvm-nm output from clang object... ok checking for sysroot... no checking for a working dd... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/dd checking how to truncate binary pipes... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... yes checking for dlfcn.h... no checking for as... as checking for dlltool... (cached) dlltool checking for objdump... (cached) llvm-objdump checking for objdir... .libs checking for clang option to produce PIC... -DDLL_EXPORT -DPIC checking if clang PIC flag -DDLL_EXPORT -DPIC works... yes checking if clang static flag works... yes checking if clang supports -c -o file.o... yes checking if clang supports -c -o file.o... (cached) yes checking whether the clang linker (clang-ld) supports shared libraries... yes checking dynamic linker characteristics... Win32 link.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for ld... clang-ld checking if the linker (clang-ld) is GNU ld... no checking for shared library path variable... PATH checking whether to activate relocatable installation... no checking how to copy files... cp -p checking how to make hard links... ln checking whether ln -s works... no, using cp -pR checking for windres... windres checking for windres... windres checking for shared library run path origin... done checking 32-bit host C ABI... no checking for ELF binary format... no checking for the common suffixes of directories in the library search path... lib,lib,lib checking for iconv... no, consider installing GNU libiconv checking whether NLS is requested... yes checking for msgfmt... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/msgfmt checking for gmsgfmt... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/msgfmt checking for xgettext... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/xgettext checking for msgmerge... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/msgmerge checking for CFPreferencesCopyAppValue... no checking for CFLocaleCopyPreferredLanguages... no checking for GNU gettext in libc... no checking for iconv... (cached) no, consider installing GNU libiconv checking for GNU gettext in libintl... no checking whether to use NLS... no checking for mbstate_t... yes checking for wchar_t... yes checking for getc_unlocked... no checking for mbrtowc... yes checking for wcrtomb... yes checking for mbsinit... no checking for setlocale... yes checking whether is standalone... yes checking for memmove... yes checking for nl_langinfo and CODESET... no checking for symlink... no checking for canonicalize_file_name... no checking for faccessat... no checking for realpath... no checking for lstat... no checking for readlinkat... no checking for _set_invalid_parameter_handler... yes checking for fcntl... no checking for getdtablesize... no checking for getprogname... no checking for getexecname... no checking for readlink... no checking for setenv... no checking for working fcntl.h... no checking for wchar.h... (cached) yes checking for EILSEQ... yes checking whether byte ordering is bigendian... no checking for size_t... yes checking for working alloca.h... no checking for alloca... yes checking whether lstat correctly handles trailing slash... no checking whether // is distinct from /... yes checking whether realpath works... no checking for C/C++ restrict keyword... __restrict__ checking if environ is properly declared... yes checking whether the preprocessor supports include_next... yes checking whether source code line length is unlimited... yes checking for complete errno.h... no checking for EMULTIHOP value... no checking for ENOLINK value... yes checking for EOVERFLOW value... yes checking for clang options needed to detect all undeclared functions... none needed checking whether strerror_r is declared... no checking whether strerror_r returns char *... no checking whether ctype.h defines __header_inline... no checking for pid_t... no checking for mode_t... no checking whether stat file-mode macros are broken... no checking for 64-bit off_t... no checking for 64-bit st_size... no checking for nlink_t... no checking for sdkddkver.h... yes checking whether getdtablesize is declared... no checking whether limits.h has WORD_BIT, BOOL_WIDTH etc.... no checking for wint_t... yes checking whether wint_t is large enough... no checking whether the compiler produces multi-arch binaries... no checking whether stdint.h conforms to C99... yes checking whether stdint.h works without ISO C predefines... yes checking whether stdint.h has UINTMAX_WIDTH etc.... no checking whether malloc is ptrdiff_t safe... yes checking whether malloc, realloc, calloc set errno on failure... no checking whether malloc (0) returns nonnull... yes checking whether defines MIN and MAX... no checking whether defines MIN and MAX... no checking for O_CLOEXEC... no checking for promoted mode_t type... mode_t checking for sigset_t... no checking for SIGPIPE... no checking whether setenv is declared... no checking for ssize_t... no checking for uid_t in sys/types.h... no checking for volatile sig_atomic_t... yes checking for sighandler_t... no checking whether C symbols are prefixed with underscore at the linker level... no checking for stdbool.h that conforms to C99... yes checking for _Bool... yes checking for good max_align_t... yes checking whether NULL can be used in arbitrary expressions... yes checking whether fcloseall is declared... yes checking which flavor of printf attribute matches inttypes macros... system checking whether ecvt is declared... yes checking whether fcvt is declared... yes checking whether gcvt is declared... yes checking whether strerror(0) succeeds... yes checking for struct timespec in ... yes checking for TIME_UTC in ... yes checking whether execvpe is declared... no checking whether clearerr_unlocked is declared... no checking whether feof_unlocked is declared... no checking whether ferror_unlocked is declared... no checking whether fflush_unlocked is declared... no checking whether fgets_unlocked is declared... no checking whether fputc_unlocked is declared... no checking whether fputs_unlocked is declared... no checking whether fread_unlocked is declared... no checking whether fwrite_unlocked is declared... no checking whether getc_unlocked is declared... no checking whether getchar_unlocked is declared... no checking whether putc_unlocked is declared... no checking whether putchar_unlocked is declared... no checking whether uses 'inline' correctly... yes checking whether wcsdup is declared... yes checking for C compiler option to allow warnings... -Wno-error checking for __builtin_expect... yes checking for winsock2.h... yes checking whether // is distinct from /... (cached) yes checking whether dup2 works... no checking for setdtablesize... no checking for error_at_line... no checking whether free is known to preserve errno... no checking whether program_invocation_name is declared... no checking whether program_invocation_short_name is declared... no checking whether __argv is declared... yes checking whether the compiler supports the __inline keyword... yes checking for mbstate_t... (cached) yes checking for mempcpy... no checking whether program_invocation_name is declared... (cached) no checking whether program_invocation_short_name is declared... (cached) no checking for raise... yes checking for rawmemchr... no checking whether free is known to preserve errno... (cached) no checking for mempcpy... (cached) no checking for rawmemchr... (cached) no checking for search.h... yes checking for tsearch... no checking for ssize_t... (cached) no checking for struct stat.st_atim.tv_nsec... no checking for struct stat.st_atimespec.tv_nsec... no checking for struct stat.st_atimensec... no checking for struct stat.st_atim.st__tim.tv_nsec... no checking for struct stat.st_birthtimespec.tv_nsec... no checking for struct stat.st_birthtimensec... no checking for struct stat.st_birthtim.tv_nsec... no checking for working stdalign.h... yes checking for winsock2.h... (cached) yes checking for variable-length arrays... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating lib/Makefile config.status: creating srclib/Makefile config.status: creating src/Makefile config.status: creating po/Makefile.in config.status: creating man/Makefile config.status: creating tests/Makefile config.status: creating include/iconv.h config.status: creating include/iconv.h.inst config.status: creating config.h config.status: creating lib/config.h config.status: executing depfiles commands config.status: executing libtool commands config.status: executing po-directories commands config.status: creating po/POTFILES config.status: creating po/Makefile === configuring in libcharset (/c/Users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/build-release/libcharset) configure: running /bin/sh /c/users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/src/libcharset/configure --disable-option-checking '--prefix=/' '--disable-shared' '--enable-static' '--bindir=/bin' '--sbindir=/bin' '--libdir=/lib' '--includedir=/include' '--oldincludedir=/include' 'CC=clang' 'CFLAGS= -m64 -O3' 'LDFLAGS= -m64 -static-libstdc++' 'CPPFLAGS= -DNDEBUG' --cache-file=/dev/null --srcdir=/c/users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/src/libcharset configure: loading site script /etc/config.site checking whether make sets $(MAKE)... yes checking for gcc... clang checking whether the C compiler works... yes checking for C compiler default output file name... a.exe checking for suffix of executables... .exe checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... no checking whether clang accepts -g... yes checking for clang option to enable C11 features... unsupported checking for clang option to enable C99 features... unsupported checking for clang option to enable C89 features... unsupported checking how to run the C preprocessor... clang -E checking for a BSD-compatible install... /usr/bin/install -c checking build system type... x86_64-w64-mingw32 checking host system type... x86_64-w64-mingw32 checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... no checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... no checking for wchar.h... yes checking for minix/config.h... no checking whether it is safe to define __EXTENSIONS__... yes checking whether _XOPEN_SOURCE should be defined... no checking how to print strings... printf checking for a sed that does not truncate output... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/sed checking for grep that handles long lines and -e... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep checking for egrep... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep -E checking for fgrep... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/grep -F checking for non-GNU ld... clang-ld checking if the linker (clang-ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... llvm-nm checking the name lister (llvm-nm) interface... BSD nm checking whether ln -s works... no, using cp -pR checking the maximum length of command line arguments... 8192 checking how to convert x86_64-w64-mingw32 file names to x86_64-w64-mingw32 format... func_convert_file_msys_to_w32 checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32 checking for clang-ld option to reload object files... -r checking for file... file checking for objdump... llvm-objdump checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL checking for dlltool... dlltool checking how to associate runtime and link libraries... func_cygming_dll_for_implib checking for archiver @FILE support... @ checking for strip... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/strip checking for ranlib... llvm-ranlib checking for gawk... gawk checking command to parse llvm-nm output from clang object... ok checking for sysroot... no checking for a working dd... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/dd checking how to truncate binary pipes... /c/users/mmom/.conan2/p/msys27f2f094a41efb/p/bin/msys64/usr/bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... yes checking for dlfcn.h... no checking for as... as checking for dlltool... (cached) dlltool checking for objdump... (cached) llvm-objdump checking for objdir... .libs checking for clang option to produce PIC... -DDLL_EXPORT -DPIC checking if clang PIC flag -DDLL_EXPORT -DPIC works... yes checking if clang static flag works... yes checking if clang supports -c -o file.o... yes checking if clang supports -c -o file.o... (cached) yes checking whether the clang linker (clang-ld) supports shared libraries... yes checking dynamic linker characteristics... Win32 link.exe checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for ld... clang-ld checking if the linker (clang-ld) is GNU ld... no checking for shared library path variable... PATH checking whether to activate relocatable installation... no checking for nl_langinfo and CODESET... no checking for symlink... no checking for working fcntl.h... no checking for setlocale... yes configure: creating ./config.status config.status: creating Makefile config.status: creating lib/Makefile config.status: creating include/libcharset.h config.status: creating include/libcharset.h.inst config.status: creating include/localcharset.h config.status: creating include/localcharset.h.inst config.status: creating config.h config.status: executing libtool commands libiconv/1.17: RUN: 'C:\clang\make-4.4.1\dist\make.exe' -j8 mkdir: cannot create directory '/dev/shm': Read-only file system Creating /dev/shm directory failed. POSIX semaphores and POSIX shared memory will not work mkdir: cannot create directory '/dev/mqueue': Read-only file system Creating /dev/mqueue directory failed. POSIX message queues will not work builddir="`pwd`"; cd libcharset && C:/clang/make-4.4.1/dist/make.exe all && C:/clang/make-4.4.1/dist/make.exe install-lib libdir="$builddir/lib" includedir="$builddir/lib" make[1]: Entering directory 'C:/Users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/build-release/libcharset' cd lib && C:/clang/make-4.4.1/dist/make.exe all make[2]: Entering directory 'C:/Users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/build-release/libcharset/lib' make[2]: *** No rule to make target '/c/users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/src/libcharset/lib/localcharset.c', needed by 'localcharset.lo'. Stop. make[2]: Leaving directory 'C:/Users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/build-release/libcharset/lib' make[1]: *** [Makefile:34: all] Error 2 make[1]: Leaving directory 'C:/Users/mmom/.conan2/p/b/libic87f8a1d6a1f5f/b/build-release/libcharset' make: *** [Makefile:41: lib/localcharset.h] Error 2 ```
mmomtchev commented 1 week ago

That class of problems is caused by a GNU make that cannot read cygwin-style paths (/c/users...), using the GNU make from MSYS2 fixes the problem - maybe these recipes should pull the dependency

mmomtchev commented 1 week ago

The problem is that make/4.4.1 from conan has the same problem while the make.exe from msys2/cci.latest does support this style of paths, however it does not work with CMake.