Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

Compiling Qt 5.10.1 with glibc 2.31-1 fails #84

Closed jellespijker closed 4 years ago

jellespijker commented 4 years ago
linux/stat.h:56:8: error: redefinition of 'struct statx_timestamp'
bits/statx.h:25:8: note: previous definition of 'struct statx_timestamp'
qfilesystemengine_unix.cpp:110:12: error: 'int renameat2(int, const char*, int, const char*, unsigned int)' was declared 'extern' and later 'static' [-fpermissive]

See issue https://github.com/Ultimaker/Cura/issues/7076 and https://codereview.qt-project.org/c/qt/qtbase/+/236308/2

Applied the following changes to src/corelib/global/qconfig-bootstrapped.h in qtbase

97c97,101
< #define QT_FEATURE_renameat2 -1
---
> +ifdef __GLIBC_PREREQ
> + define QT_FEATURE_renameat2 (__GLIBC_PREREQ(2, 28) ? 1 : -1)
> +else
> + define QT_FEATURE_renameat2 -1
> +endif
100c104,108
< #define QT_FEATURE_statx -1
---
> +ifdef __GLIBC_PREREQ
> + define QT_FEATURE_statx (__GLIBC_PREREQ(2, 28) ? 1 : -1)
> +else
> + define QT_FEATURE_statx -1
> +endif

Applied the following changes to src/corelib/io/qfilesystemengine_unix.cpp in qtbase

105,106c105,106
< #  if !QT_CONFIG(statx) && defined(SYS_statx) && QT_HAS_INCLUDE(<linux/stat.h>)
< #    include <linux/stat.h>
---
> #if !QT_CONFIG(statx) && defined(SYS_statx)
> #   include <linux/stat.h>
Ghostkeeper commented 4 years ago

Duplicate of https://github.com/Ultimaker/Cura/issues/7076