Package: thunderbird / 1:60.8.0-1~deb9u1

porting-kfreebsd-hurd/FTBFS-hurd-fixing-unsupported-platform-Hurd.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
From: Carsten Schoenert <c.schoenert@t-online.de>
Date: Sat, 29 Mar 2014 20:58:55 +0100
Subject: FTBFS hurd: fixing unsupported platform Hurd

On the Hurd platform the build failed in
js/src/jit/AsmJSSignalHandlers.cpp:131 because of unsupported
mode for reading / writing thead state with following message.

 # error "Don't know how to read/write to the thread state via the mcontext_t."

The original patch comes from Richard Brown <rbraun@sceen.net>
https://lists.alioth.debian.org/pipermail/pkg-mozilla-maintainers/2014-March/015565.html

After release of Thunderbird 44 there are additional changes made as the
various configuration files where split into more files.
---
 dom/plugins/ipc/PluginModuleChild.cpp                | 6 +++---
 dom/plugins/ipc/PluginModuleChild.h                  | 2 +-
 ipc/chromium/chromium-config.mozbuild                | 5 +++++
 ipc/chromium/moz.build                               | 2 +-
 ipc/chromium/src/base/message_loop.cc                | 4 ++--
 ipc/chromium/src/base/process_util_posix.cc          | 2 +-
 ipc/chromium/src/build/build_config.h                | 3 ++-
 ipc/chromium/src/third_party/libeventcommon.mozbuild | 5 +++++
 ipc/glue/GeckoChildProcessHost.cpp                   | 6 +++---
 js/src/wasm/WasmSignalHandlers.cpp                   | 2 +-
 10 files changed, 24 insertions(+), 13 deletions(-)

diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp
index f260b39..48cbb48 100644
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -262,7 +262,7 @@ bool PluginModuleChild::InitForChrome(const std::string& aPluginFilename,
 
   GetIPCChannel()->SetAbortOnError(true);
 
-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD)
   mShutdownFunc =
       (NP_PLUGINSHUTDOWN)PR_FindFunctionSymbol(mLibrary, "NP_Shutdown");
 
@@ -1503,7 +1503,7 @@ mozilla::ipc::IPCResult PluginModuleChild::AnswerNP_GetEntryPoints(
   AssertPluginThread();
   MOZ_ASSERT(mIsChrome);
 
-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD)
   return IPC_OK();
 #elif defined(OS_WIN) || defined(OS_MACOSX)
   *_retval = mGetEntryPointsFunc(&mFunctions);
@@ -1538,7 +1538,7 @@ NPError PluginModuleChild::DoNP_Initialize(const PluginSettings& aSettings) {
 #endif
 
   NPError result;
-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD)
   result = mInitializeFunc(&sBrowserFuncs, &mFunctions);
 #elif defined(OS_WIN) || defined(OS_MACOSX)
   result = mInitializeFunc(&sBrowserFuncs);
diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h
index 3d71bd6..79a82c9 100644
--- a/dom/plugins/ipc/PluginModuleChild.h
+++ b/dom/plugins/ipc/PluginModuleChild.h
@@ -223,7 +223,7 @@ class PluginModuleChild : public PPluginModuleChild {
 
   // we get this from the plugin
   NP_PLUGINSHUTDOWN mShutdownFunc;
-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD)
   NP_PLUGINUNIXINIT mInitializeFunc;
 #elif defined(OS_WIN) || defined(OS_MACOSX)
   NP_PLUGININIT mInitializeFunc;
diff --git a/ipc/chromium/chromium-config.mozbuild b/ipc/chromium/chromium-config.mozbuild
index 5558add..332a4e2 100644
--- a/ipc/chromium/chromium-config.mozbuild
+++ b/ipc/chromium/chromium-config.mozbuild
@@ -67,5 +67,10 @@ else:
             'OS_BSD': 1,
         })
 
+    elif CONFIG['OS_ARCH'] == 'GNU':
+        DEFINES.update({
+            'OS_HURD': 1,
+        })
+
     else:
         DEFINES['OS_LINUX'] = 1
diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build
index 7888251..928ccd9 100644
--- a/ipc/chromium/moz.build
+++ b/ipc/chromium/moz.build
@@ -126,7 +126,7 @@ if os_bsd or os_linux:
             'src/base/message_pump_glib.cc',
         ]
 
-if os_solaris:
+if os_solaris or os_hurd:
     SOURCES += [
         'src/base/atomicops_internals_x86_gcc.cc',
         'src/base/process_util_linux.cc',
diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc
index b1c2232..d33e403 100644
--- a/ipc/chromium/src/base/message_loop.cc
+++ b/ipc/chromium/src/base/message_loop.cc
@@ -21,7 +21,7 @@
 #if defined(OS_POSIX)
 #include "base/message_pump_libevent.h"
 #endif
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD)
 #if defined(MOZ_WIDGET_GTK)
 #include "base/message_pump_glib.h"
 #endif
@@ -235,7 +235,7 @@ MessageLoop::MessageLoop(Type type, nsIEventTarget* aEventTarget)
   if (type_ == TYPE_UI) {
 #if defined(OS_MACOSX)
     pump_ = base::MessagePumpMac::Create();
-#elif defined(OS_LINUX) || defined(OS_BSD)
+#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD)
     pump_ = new base::MessagePumpForUI();
 #endif  // OS_LINUX
   } else if (type_ == TYPE_IO) {
diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc
index 7e0a7d1..40f8209 100644
--- a/ipc/chromium/src/base/process_util_posix.cc
+++ b/ipc/chromium/src/base/process_util_posix.cc
@@ -119,7 +119,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) {
 #if defined(ANDROID)
   static const rlim_t kSystemDefaultMaxFds = 1024;
   static const char kFDDir[] = "/proc/self/fd";
-#elif defined(OS_LINUX) || defined(OS_SOLARIS)
+#elif defined(OS_LINUX) || defined(OS_SOLARIS) || defined(OS_HURD)
   static const rlim_t kSystemDefaultMaxFds = 8192;
   static const char kFDDir[] = "/proc/self/fd";
 #elif defined(OS_MACOSX)
diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
index b482e1f..6196d92 100644
--- a/ipc/chromium/src/build/build_config.h
+++ b/ipc/chromium/src/build/build_config.h
@@ -23,6 +23,7 @@
 #elif defined(__APPLE__)
 #define OS_MACOSX 1
 #elif defined(__linux__) || defined(__GLIBC__) || defined(__GNU__)
+#define OS_HURD 1
 #define OS_LINUX 1
 #elif defined(__DragonFly__)
 #define OS_DRAGONFLY 1
@@ -50,7 +51,7 @@
 // For access to standard POSIX features, use OS_POSIX instead of a more
 // specific macro.
 #if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || \
-    defined(OS_SOLARIS)
+    defined(OS_SOLARIS) || defined(OS_HURD)
 #define OS_POSIX 1
 #endif
 
diff --git a/ipc/chromium/src/third_party/libeventcommon.mozbuild b/ipc/chromium/src/third_party/libeventcommon.mozbuild
index 5037ec7..c858d9c 100644
--- a/ipc/chromium/src/third_party/libeventcommon.mozbuild
+++ b/ipc/chromium/src/third_party/libeventcommon.mozbuild
@@ -8,6 +8,7 @@ os_win = 0
 os_posix = 0
 os_macosx = 0
 os_bsd = 0
+os_hurd = 0
 os_linux = 0
 os_solaris = 0
 
@@ -25,6 +26,10 @@ else:
     elif CONFIG['OS_ARCH'] == 'SunOS':
         os_solaris = 1
         libevent_include_suffix = 'solaris'
+    # attempt to get GNU hurd into the build again, further modification probably needed
+    elif CONFIG['OS_ARCH'] == 'GNU':
+        os_hurd = 1
+        libevent_include_suffix = 'gnu'
     else:
         os_linux = 1
         if CONFIG['OS_TARGET'] == 'Android':
diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
index 1c7eca0..661387b 100644
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -616,7 +616,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunchInternal(
     // and passing wstrings from one config to the other is unsafe.  So
     // we split the logic here.
 
-#if defined(OS_POSIX)
+#if defined(OS_POSIX) || defined(OS_HURD)
 #if defined(MOZ_WIDGET_GTK)
   if (mProcessType == GeckoProcessType_Content) {
     // disable IM module to avoid sandbox violation
@@ -637,7 +637,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunchInternal(
     MOZ_ASSERT(gGREBinPath);
     nsCString path;
     NS_CopyUnicodeToNative(nsDependentString(gGREBinPath), path);
-#if defined(OS_LINUX) || defined(OS_BSD)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD)
     const char* ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
     nsCString new_ld_lib_path(path.get());
 
@@ -736,7 +736,7 @@ bool GeckoChildProcessHost::PerformAsyncLaunchInternal(
   childArgv.push_back(pidstring);
 
   if (!CrashReporter::IsDummy()) {
-#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS) || defined(OS_HURD)
     int childCrashFd, childCrashRemapFd;
     if (!CrashReporter::CreateNotificationPipeForChild(&childCrashFd,
                                                        &childCrashRemapFd)) {
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 70f1517..8bf475d 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -131,7 +131,7 @@ struct AutoSignalHandler {
 #define R01_sig(p) ((p)->sc_frame.fixreg[1])
 #define R32_sig(p) ((p)->sc_frame.srr0)
 #endif
-#elif defined(__linux__) || defined(__sun)
+#elif defined(__linux__) || defined(__sun) || defined(__GNU__)
 #if defined(__linux__)
 #define XMM_sig(p, i) ((p)->uc_mcontext.fpregs->_xmm[i])
 #define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])