conan-io / conan-center-index

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

[package] mingw-w64/8.0.2: build fails on ubuntu 20.04 #25719

Open pkoshevoy opened 1 month ago

pkoshevoy commented 1 month ago

Description

conan-install-mingw-w64.log

recipe fails during compilation of mingw-w64-crt ^

also, recipe will fail during gcc compilation if LIBRARY_PATH or LD_LIBRARY_PATH contains an empty entry, like this:

$ echo $LIBRARY_PATH
:/usr/lib/nvidia-367

Package and Environment Details

Conan profile

local default profile:

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu14
compiler.exception=dwarf2
compiler.libcxx=libstdc++11
compiler.version=9
compiler.threads=posix
os=Linux
os.distribution=Ubuntu
os.distribution.version=20.04

Steps to reproduce

$ cat /tmp/conanfile.txt 
[requires]
mingw-w64/8.0.2

$ conan install --build=missing /tmp/conanfile.txt 

Logs

Click to expand log ``` CC stdio/lib32_libucrtbase_a-ucrt_vfprintf.o /home/pkoshevoy/.conan2/p/b/mingw80cee71e4f445/b/src/mingw-w64/mingw-w64-crt/stdio/ucrt_sprintf.c: In function ‘sprintf’: /home/pkoshevoy/.conan2/p/b/mingw80cee71e4f445/b/src/mingw-w64/mingw-w64-crt/stdio/ucrt_sprintf.c:16:33: error: ‘_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR’ undeclared (first use in this function); did you mean ‘UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR’? 16 | ret = __stdio_common_vsprintf(_CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR, _Dest, (size_t)-1, _Format, NULL, ap); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR /home/pkoshevoy/.conan2/p/b/mingw80cee71e4f445/b/src/mingw-w64/mingw-w64-crt/stdio/ucrt_sprintf.c:16:33: note: each undeclared identifier is reported only once for each function it appears in CC stdio/lib32_libucrtbase_a-ucrt_vprintf.o /home/pkoshevoy/.conan2/p/b/mingw80cee71e4f445/b/src/mingw-w64/mingw-w64-crt/stdio/ucrt__vscprintf.c:11:5: error: redefinition of ‘_vscprintf’ 11 | int _vscprintf(const char * __restrict__ _Format, va_list _ArgList) | ^~~~~~~~~~ In file included from /home/pkoshevoy/.conan2/p/b/mingw80cee71e4f445/b/src/mingw-w64/mingw-w64-crt/stdio/ucrt__vscprintf.c:9: /usr/share/mingw-w64/include/stdio.h:946:15: note: previous definition of ‘_vscprintf’ was here 946 | int __cdecl _vscprintf(const char * __restrict__ _Format,va_list _ArgList) | ^~~~~~~~~~ ```
pkoshevoy commented 1 month ago

conans boost/1.80.0 (and newer) fails to build with the system provided mingw-w64 tools (gcc 9.3)

conans mingw-w64/8.0.2 recipe fails to build on ubuntu 20.04 if there are system mingw-w64 packages installed

a workaround is to uninstall system packages before attempting to build the mingw-w64/8.0.2 conan recipe:

sudo apt remove binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64  gcc-mingw-w64-base   gcc-mingw-w64-x86-64  mingw-w64-common  mingw-w64-x86-64-dev