Bug#669059: webkit-1.8.0-2: FTBFS on hurd-*
Source: webkit
Version: 1.8.0-2
Severity: Important
Usertags: hurd
User: debian-hurd@lists.debian.org
Hello,
webkit currently FTBFS on hurd-i386, due to the usage of PATH_MAX,
which is only recommended by POSIX, not mandatory, and GNU/Hurd does
not have this limitation. The attached patch fixes this by using the
combination of and lstat and readlink, as recommended on the readlink
man page. Additionally a definition of GNU/Hurd is added to osinclude.h
to avoid that the compilation errors out due to a missing definition of
ANGLE_OS_POSIX also for GNU/Hurd. Could you please apply it when
releasing next update?
Thanks!
--- a/Source/ThirdParty/ANGLE/src/compiler/osinclude.h 2012-02-19 18:47:57.000000000 +0100
+++ b/Source/ThirdParty/ANGLE/src/compiler/osinclude.h 2012-04-15 09:20:30.000000000 +0200
@@ -16,7 +16,7 @@
#define ANGLE_OS_WIN
#elif defined(__APPLE__) || defined(__linux__) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || \
- defined(__sun) || defined(ANDROID)
+ defined(__sun) || defined(ANDROID) || defined(__GNU__)
#define ANGLE_OS_POSIX
#else
#error Unsupported platform.
--- a/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-02-19 18:45:45.000000000 +0100
+++ b/Source/JavaScriptCore/wtf/gobject/GlibUtilities.cpp 2012-04-16 14:23:16.000000000 +0200
@@ -25,6 +25,8 @@
#include <wtf/text/WTFString.h>
#else
#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#endif
@@ -40,9 +42,14 @@
#elif OS(UNIX)
CString getCurrentExecutablePath()
{
- static char readLinkBuffer[PATH_MAX];
- ssize_t result = readlink("/proc/curproc/file", readLinkBuffer, PATH_MAX);
- if (result == -1)
+ struct stat sb;
+ char *readLinkBuffer;
+ ssize_t result;
+ result = lstat("/proc/curproc/file", &sb);
+ readLinkBuffer = (char*)malloc(sb.st_size + 1);
+ if (readLinkBuffer == NULL) return CString();
+ result = readlink("/proc/curproc/file", readLinkBuffer, sb.st_size + 1);
+ if (result == -1 || result > sb.st_size)
return CString();
return CString(readLinkBuffer, result);
}
Reply to: