pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/51011: qt5-qtwebkit build error on NetBSD/i386 due to different ucontext_t
>Number: 51011
>Category: pkg
>Synopsis: qt5-qtwebkit build error on NetBSD/i386 due to different ucontext_t
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 26 10:50:00 +0000 2016
>Originator: Frank Wille
>Release: pkgsrc 2015Q3 and pkgsrc 2015Q4
>Organization:
>Environment:
NetBSD orion.owl.de 7.0 NetBSD 7.0 (GENERIC.201509250726Z) i386
>Description:
While building the JavaScriptCore in qt5-qtwebkit:
tools/CodeProfiling.cpp: In function 'void JSC::profilingTimer(int, siginfo_t*, void*)':
tools/CodeProfiling.cpp:80:59: error: 'struct mcontext_t' has no member named 'gregs'
CodeProfiling::sample(reinterpret_cast<void*>(context.gregs[REG_EIP]),
^
tools/CodeProfiling.cpp:80:65: error: 'REG_EIP' was not declared in this scope
CodeProfiling::sample(reinterpret_cast<void*>(context.gregs[REG_EIP]),
^
tools/CodeProfiling.cpp:81:60: error: 'struct mcontext_t' has no member named 'gregs'
reinterpret_cast<void**>(context.gregs[REG_EBP]));
^
tools/CodeProfiling.cpp:81:66: error: 'REG_EBP' was not declared in this scope
reinterpret_cast<void**>(context.gregs[REG_EBP]));
^
Makefile.JavaScriptCore.Target:77124: recipe for target '.obj/tools/CodeProfiling.lo' failed
gmake[2]: *** [.obj/tools/CodeProfiling.lo] Error 1
gmake[2]: Leaving directory '/usr/pkgsrc/x11/qt5-qtwebkit/work/qtwebkit-opensource-src-5.4.0/Source/JavaScriptCore'
>How-To-Repeat:
Build x11/qt5-qtwebkit on NetBSD/i386. I reproduced the problem with pkgsrc 2015Q3 and the latest 2015Q4.
>Fix:
Update patches/patch-Source_JavaScriptCore_tools_CodeProfiling.cpp to use the correct ucontext_t structure member names for NetBSD:
--- CodeProfiling.cpp.orig 2014-12-05 17:24:55.000000000 +0100
+++ CodeProfiling.cpp 2016-03-26 11:28:15.000000000 +0100
@@ -33,7 +33,7 @@
#include <signal.h>
#endif
-#if OS(LINUX)
+#if OS(LINUX) || OS(NETBSD)
#include <sys/time.h>
#endif
@@ -48,7 +48,7 @@
#pragma clang diagnostic ignored "-Wmissing-noreturn"
#endif
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86) && !OS(ANDROID))
+#if (PLATFORM(MAC) && CPU(X86_64)) || ((OS(LINUX) || OS(NETBSD)) && CPU(X86) && !OS(ANDROID))
// Helper function to start & stop the timer.
// Presently we're using the wall-clock timer, since this seems to give the best results.
static void setProfileTimer(unsigned usec)
@@ -80,6 +80,13 @@
CodeProfiling::sample(reinterpret_cast<void*>(context.gregs[REG_EIP]),
reinterpret_cast<void**>(context.gregs[REG_EBP]));
}
+#elif OS(NETBSD) && CPU(X86)
+static void profilingTimer(int, siginfo_t*, void* uap)
+{
+ mcontext_t context = static_cast<ucontext_t*>(uap)->uc_mcontext;
+ CodeProfiling::sample(reinterpret_cast<void*>(context.__gregs[_REG_EIP]),
+ reinterpret_cast<void**>(context.__gregs[_REG_EBP]));
+}
#endif
// Callback triggered when the timer is fired.
@@ -143,7 +150,7 @@
if (alreadyProfiling)
return;
-#if (PLATFORM(MAC) && CPU(X86_64)) || (OS(LINUX) && CPU(X86) && !OS(ANDROID))
+#if (PLATFORM(MAC) && CPU(X86_64)) || ((OS(LINUX) || OS(NETBSD)) && CPU(X86) && !OS(ANDROID))
// Regsiter a signal handler & itimer.
struct sigaction action;
action.sa_sigaction = reinterpret_cast<void (*)(int, siginfo_t *, void *)>(profilingTimer);
Home |
Main Index |
Thread Index |
Old Index