qt-4.6.2-fix-qt-uclibc-build.patch 1.4 KB

123456789101112131415161718192021222324252627
  1. From http://bugreports.qt.nokia.com/browse/QTBUG-8365
  2. Starting a QtEmbedded-4.6.2 application linked against uClibc 0.9.30.1 results
  3. in an immediate segmentation fault.
  4. This is due to an incompatibility of the uClibc with the standard libc about
  5. the "realpath" function. The man of the function clearly specifies that
  6. "if resolved path (the second argument) is NULL, then realpath uses malloc to
  7. allocate a buffer ...". However, uClibc doesn't support this functionality and
  8. issues a warning at compile-time when the function is called with a NULL
  9. argument.
  10. ---
  11. diff -aurp -x '*.o' qt-everywhere-opensource-src-4.6.2-old/src/corelib/io/qfsfileengine.cpp qt-everywhere-opensource-src-4.6.2/src/corelib/io/qfsfileengine.cpp
  12. --- qt-everywhere-opensource-src-4.6.2-old/src/corelib/io/qfsfileengine.cpp 2010-02-11 16:55:23.000000000 +0100
  13. +++ qt-everywhere-opensource-src-4.6.2/src/corelib/io/qfsfileengine.cpp 2010-02-19 14:57:06.000000000 +0100
  14. @@ -145,10 +145,9 @@ QString QFSFileEnginePrivate::canonicali
  15. #endif
  16. // Mac OS X 10.5.x doesn't support the realpath(X,0) extenstion we use here.
  17. #if defined(Q_OS_LINUX) || defined(Q_OS_SYMBIAN)
  18. - char *ret = realpath(path.toLocal8Bit().constData(), (char*)0);
  19. - if (ret) {
  20. + char ret[PATH_MAX];
  21. + if (realpath(path.toLocal8Bit().constData(), ret)) {
  22. QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret));
  23. - free(ret);
  24. return canonicalPath;
  25. }
  26. #endif