From 9ad44f579738b472ba1769bd8cf0bf36f03c7316 Mon Sep 17 00:00:00 2001 From: Franz-Josef Haider Date: Thu, 28 May 2020 15:01:30 +0000 Subject: [PATCH] [qtbase] Compile with largefile support. JB#49745 --- qmake/generators/makefiledeps.cpp | 10 ++++++---- qmake/library/ioutils.cpp | 5 +++-- qmake/library/qmakebuiltins.cpp | 6 ++++-- rpm/qtbase.spec | 1 + src/corelib/io/qfilesystemengine_unix.cpp | 4 ++-- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index 65f401affd..0a65f6ef4f 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -55,6 +55,8 @@ #include #endif +#include "qplatformdefs.h" + QT_BEGIN_NAMESPACE // FIXME: a line ending in CRLF gets counted as two lines. @@ -513,7 +515,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) const QMakeLocalFileName sourceFile = fixPathForFile(file->file, true); - struct stat fst; + QT_STATBUF fst; char *buffer = 0; int buffer_len = 0; { @@ -525,7 +527,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) #else fd = open(sourceFile.local().toLatin1().constData(), O_RDONLY); #endif - if (fd == -1 || fstat(fd, &fst) || S_ISDIR(fst.st_mode)) { + if (fd == -1 || QT_FSTAT(fd, &fst) || S_ISDIR(fst.st_mode)) { if (fd != -1) QT_CLOSE(fd); return false; @@ -893,7 +895,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) int buffer_len = 0; char *buffer = 0; { - struct stat fst; + QT_STATBUF fst; int fd; #if defined(_MSC_VER) && _MSC_VER >= 1400 if (_sopen_s(&fd, fixPathForFile(file->file, true).local().toLocal8Bit().constData(), @@ -902,7 +904,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) #else fd = open(fixPathForFile(file->file, true).local().toLocal8Bit().constData(), O_RDONLY); #endif - if (fd == -1 || fstat(fd, &fst) || S_ISDIR(fst.st_mode)) { + if (fd == -1 || QT_FSTAT(fd, &fst) || S_ISDIR(fst.st_mode)) { if (fd != -1) QT_CLOSE(fd); return false; //shouldn't happen diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index a2f3e8ec3d..230d1d1361 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -32,6 +32,7 @@ ****************************************************************************/ #include "ioutils.h" +#include "qplatformdefs.h" #include #include @@ -57,8 +58,8 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName) return FileNotFound; return (attr & FILE_ATTRIBUTE_DIRECTORY) ? FileIsDir : FileIsRegular; #else - struct ::stat st; - if (::stat(fileName.toLocal8Bit().constData(), &st)) + QT_STATBUF st; + if (QT_STAT(fileName.toLocal8Bit().constData(), &st)) return FileNotFound; return S_ISDIR(st.st_mode) ? FileIsDir : FileIsRegular; #endif diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index c8208909b6..33dd1baef9 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -82,6 +82,8 @@ #define QT_PCLOSE pclose #endif +#include "qplatformdefs.h" + using namespace QMakeInternal; QT_BEGIN_NAMESPACE @@ -1602,8 +1604,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( const QString &tfn = resolvePath(args.at(0).toQString(m_tmp1)); const QString &rfn = resolvePath(args.at(1).toQString(m_tmp2)); #ifdef Q_OS_UNIX - struct stat st; - if (stat(rfn.toLocal8Bit().constData(), &st)) { + QT_STATBUF st; + if (QT_STAT(rfn.toLocal8Bit().constData(), &st)) { evalError(fL1S("Cannot stat() reference file %1: %2.").arg(rfn, fL1S(strerror(errno)))); return ReturnFalse; } diff --git a/rpm/qtbase.spec b/rpm/qtbase.spec index 330b34b164..f882605fdd 100644 --- a/rpm/qtbase.spec +++ b/rpm/qtbase.spec @@ -488,6 +488,7 @@ MAKEFLAGS=%{?_smp_mflags} \ -no-xkbcommon \ -no-xcb \ -no-xinput2 \ + -largefile \ %ifarch aarch64 -no-pch \ %endif diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 7a3eca572c..cc2d091344 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -332,8 +332,8 @@ QFileSystemEntry QFileSystemEngine::absoluteName(const QFileSystemEntry &entry) //static QByteArray QFileSystemEngine::id(const QFileSystemEntry &entry) { - struct stat statResult; - if (stat(entry.nativeFilePath().constData(), &statResult)) { + QT_STATBUF statResult; + if (QT_STAT(entry.nativeFilePath().constData(), &statResult)) { qErrnoWarning("stat() failed for '%s'", entry.nativeFilePath().constData()); return QByteArray(); }