Here is an updated patch for 30.0-2. -- Richard Braun
>From 441f82482e9de93a659fe19ee6b27a49764c20a3 Mon Sep 17 00:00:00 2001 From: Richard Braun <rbr...@sceen.net> Date: Thu, 12 Jun 2014 11:36:56 +0200 Subject: [PATCH] Hurd support
--- build/autoconf/icu.m4 | 2 +- build/gyp.mozbuild | 1 + configure | 2 +- dom/plugins/ipc/PluginModuleChild.cpp | 6 +++--- dom/plugins/ipc/PluginModuleChild.h | 2 +- ipc/chromium/chromium-config.mozbuild | 3 +++ ipc/chromium/moz.build | 5 ++++- ipc/chromium/src/base/base_paths.h | 2 +- ipc/chromium/src/base/debug_util_posix.cc | 7 ++++--- ipc/chromium/src/base/message_loop.cc | 6 +++--- ipc/chromium/src/base/process_util_posix.cc | 4 ++-- ipc/chromium/src/build/build_config.h | 4 +++- ipc/chromium/src/chrome/common/transport_dib.h | 6 +++--- ipc/glue/GeckoChildProcessHost.cpp | 14 +++++++------- js/src/configure | 2 +- js/src/jit/AsmJSSignalHandlers.cpp | 4 +++- 16 files changed, 41 insertions(+), 29 deletions(-) diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index ae7060f..515efc4 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -98,7 +98,7 @@ if test -n "$ENABLE_INTL_API"; then MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))' fi ;; - Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD) + Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD|GNU) ICU_LIB_NAMES="icui18n icuuc icudata" if test -n "$MOZ_SHARED_ICU"; then MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))' diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild index 1f10e56..3fdf91b 100644 --- a/build/gyp.mozbuild +++ b/build/gyp.mozbuild @@ -79,6 +79,7 @@ flavors = { 'FreeBSD': 'freebsd', 'NetBSD': 'netbsd', 'OpenBSD': 'openbsd', + 'GNU': 'gnu', } gyp_vars['OS'] = flavors[os] diff --git a/configure b/configure index f71619b..7a659c2 100755 --- a/configure +++ b/configure @@ -28135,7 +28135,7 @@ EOF MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))' fi ;; - Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD) + Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD|GNU) ICU_LIB_NAMES="icui18n icuuc icudata" if test -n "$MOZ_SHARED_ICU"; then MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))' diff --git a/dom/plugins/ipc/PluginModuleChild.cpp b/dom/plugins/ipc/PluginModuleChild.cpp index 04302b5..cdb9a26 100644 --- a/dom/plugins/ipc/PluginModuleChild.cpp +++ b/dom/plugins/ipc/PluginModuleChild.cpp @@ -202,7 +202,7 @@ PluginModuleChild::Init(const std::string& aPluginFilename, // TODO: use PluginPRLibrary here -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) mShutdownFunc = (NP_PLUGINSHUTDOWN) PR_FindFunctionSymbol(mLibrary, "NP_Shutdown"); @@ -1832,7 +1832,7 @@ PluginModuleChild::AnswerNP_GetEntryPoints(NPError* _retval) PLUGIN_LOG_DEBUG_METHOD; AssertPluginThread(); -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) return true; #elif defined(OS_WIN) || defined(OS_MACOSX) *_retval = mGetEntryPointsFunc(&mFunctions); @@ -1861,7 +1861,7 @@ PluginModuleChild::AnswerNP_Initialize(const uint32_t& aFlags, NPError* _retval) SendBackUpXResources(FileDescriptor(xSocketFd)); #endif -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) *_retval = mInitializeFunc(&sBrowserFuncs, &mFunctions); return true; #elif defined(OS_WIN) || defined(OS_MACOSX) diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index ac9eec9..6f57496 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -319,7 +319,7 @@ private: // we get this from the plugin NP_PLUGINSHUTDOWN mShutdownFunc; -#if defined(OS_LINUX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_BSD) || 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 c6d34b4..d92dfc7 100644 --- a/ipc/chromium/chromium-config.mozbuild +++ b/ipc/chromium/chromium-config.mozbuild @@ -71,5 +71,8 @@ else: 'OS_BSD': 1, }) + elif CONFIG['OS_ARCH'] == 'GNU': + DEFINES['OS_HURD'] = 1 + else: DEFINES['OS_LINUX'] = 1 diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index 5622144..569ad3e 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -12,6 +12,7 @@ os_freebsd = 0 os_netbsd = 0 os_openbsd = 0 os_bsd = 0 +os_hurd = 0 os_linux = 0 if CONFIG['OS_ARCH'] == 'WINNT': @@ -32,6 +33,8 @@ else: elif CONFIG['OS_ARCH'] == 'OpenBSD': os_openbsd = 1 os_bsd = 1 + elif CONFIG['OS_ARCH'] == 'GNU': + os_hurd= 1 else: os_linux = 1 @@ -209,7 +212,7 @@ if os_macosx: ] LOCAL_INCLUDES += ['src/third_party/libevent/mac'] -if os_linux: +if os_linux or os_hurd: SOURCES += [ 'src/base/atomicops_internals_x86_gcc.cc', 'src/base/base_paths_linux.cc', diff --git a/ipc/chromium/src/base/base_paths.h b/ipc/chromium/src/base/base_paths.h index 2cb1df1..068acbc 100644 --- a/ipc/chromium/src/base/base_paths.h +++ b/ipc/chromium/src/base/base_paths.h @@ -13,7 +13,7 @@ #include "base/base_paths_win.h" #elif defined(OS_MACOSX) #include "base/base_paths_mac.h" -#elif defined(OS_LINUX) || defined(OS_BSD) +#elif defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) #include "base/base_paths_linux.h" #endif #include "base/path_service.h" diff --git a/ipc/chromium/src/base/debug_util_posix.cc b/ipc/chromium/src/base/debug_util_posix.cc index 18e9a2d..a780d96 100644 --- a/ipc/chromium/src/base/debug_util_posix.cc +++ b/ipc/chromium/src/base/debug_util_posix.cc @@ -5,7 +5,8 @@ #include "build/build_config.h" #include "base/debug_util.h" -#define MOZ_HAVE_EXECINFO_H (defined(OS_LINUX) && !defined(ANDROID)) +#define MOZ_HAVE_EXECINFO_H ((defined(OS_LINUX) || defined(OS_HURD)) \ + && !defined(ANDROID)) #include <errno.h> #include <fcntl.h> @@ -110,7 +111,7 @@ bool DebugUtil::BeingDebugged() { return being_debugged; } -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_HURD) // We can look in /proc/self/status for TracerPid. We are likely used in crash // handling, so we are careful not to use the heap or have side effects. @@ -145,7 +146,7 @@ bool DebugUtil::BeingDebugged() { return pid_index < status.size() && status[pid_index] != '0'; } -#endif // OS_LINUX +#endif // OS_LINUX || OS_HURD // static void DebugUtil::BreakDebugger() { diff --git a/ipc/chromium/src/base/message_loop.cc b/ipc/chromium/src/base/message_loop.cc index 2cd463a..e3bb3a3 100644 --- a/ipc/chromium/src/base/message_loop.cc +++ b/ipc/chromium/src/base/message_loop.cc @@ -20,7 +20,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 @@ -137,9 +137,9 @@ MessageLoop::MessageLoop(Type type) 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 +#endif // OS_LINUX || OS_BSD || OS_HURD } else if (type_ == TYPE_IO) { pump_ = new base::MessagePumpLibevent(); } else { diff --git a/ipc/chromium/src/base/process_util_posix.cc b/ipc/chromium/src/base/process_util_posix.cc index cae82da..e251253 100644 --- a/ipc/chromium/src/base/process_util_posix.cc +++ b/ipc/chromium/src/base/process_util_posix.cc @@ -110,7 +110,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) +#elif defined(OS_LINUX) || defined(OS_HURD) static const rlim_t kSystemDefaultMaxFds = 8192; static const char kFDDir[] = "/proc/self/fd"; #elif defined(OS_MACOSX) @@ -202,7 +202,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { // TODO(agl): Remove this function. It's fundamentally broken for multithreaded // apps. void SetAllFDsToCloseOnExec() { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_HURD) const char fd_dir[] = "/proc/self/fd"; #elif defined(OS_MACOSX) || defined(OS_BSD) const char fd_dir[] = "/dev/fd"; diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h index e3f4189..21465e0 100644 --- a/ipc/chromium/src/build/build_config.h +++ b/ipc/chromium/src/build/build_config.h @@ -22,6 +22,8 @@ #define OS_MACOSX 1 #elif defined(__linux__) #define OS_LINUX 1 +#elif defined(__GNU__) +#define OS_HURD 1 #elif defined(__DragonFly__) #define OS_DRAGONFLY 1 #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) @@ -45,7 +47,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) +#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_HURD) || defined(OS_BSD) #define OS_POSIX 1 #endif diff --git a/ipc/chromium/src/chrome/common/transport_dib.h b/ipc/chromium/src/chrome/common/transport_dib.h index e56685b..0d698d9 100644 --- a/ipc/chromium/src/chrome/common/transport_dib.h +++ b/ipc/chromium/src/chrome/common/transport_dib.h @@ -7,7 +7,7 @@ #include "base/basictypes.h" -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) #include "base/shared_memory.h" #endif @@ -62,7 +62,7 @@ class TransportDIB { uint32_t sequence_num; }; typedef HandleAndSequenceNum Id; -#elif defined(OS_MACOSX) || defined(OS_BSD) +#elif defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) typedef base::SharedMemoryHandle Handle; // On Mac, the inode number of the backing file is used as an id. typedef base::SharedMemoryId Id; @@ -104,7 +104,7 @@ class TransportDIB { private: TransportDIB(); -#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) explicit TransportDIB(base::SharedMemoryHandle dib); base::SharedMemory shared_memory_; #elif defined(OS_LINUX) diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp index 1cb32a2..cf52a84 100644 --- a/ipc/glue/GeckoChildProcessHost.cpp +++ b/ipc/glue/GeckoChildProcessHost.cpp @@ -548,7 +548,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt // and passing wstrings from one config to the other is unsafe. So // we split the logic here. -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) base::environment_map newEnvVars; ChildPrivileges privs = mPrivileges; if (privs == base::PRIVILEGES_DEFAULT) { @@ -563,7 +563,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt if (sGreDir) { nsCString path; MOZ_ALWAYS_TRUE(NS_SUCCEEDED(sGreDir->GetNativePath(path))); -# if defined(OS_LINUX) || defined(OS_BSD) +# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) # if defined(MOZ_WIDGET_ANDROID) path += "/lib"; # endif // MOZ_WIDGET_ANDROID @@ -598,10 +598,10 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt interpose.Append(path.get()); interpose.AppendLiteral("/libplugin_child_interpose.dylib"); newEnvVars["DYLD_INSERT_LIBRARIES"] = interpose.get(); -# endif // OS_LINUX +# endif // OS_MACOSX } } -#endif // OS_LINUX || OS_MACOSX +#endif // OS_LINUX || OS_MACOSX || OS_BSD || OS_HURD FilePath exePath; GetPathToBinary(exePath); @@ -671,7 +671,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt childArgv.push_back(pidstring); #if defined(MOZ_CRASHREPORTER) -# if defined(OS_LINUX) || defined(OS_BSD) +# if defined(OS_LINUX) || defined(OS_BSD) || defined(OS_HURD) int childCrashFd, childCrashRemapFd; if (!CrashReporter::CreateNotificationPipeForChild( &childCrashFd, &childCrashRemapFd)) @@ -687,7 +687,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt } # elif defined(MOZ_WIDGET_COCOA) childArgv.push_back(CrashReporter::GetChildNotificationPipe()); -# endif // OS_LINUX +# endif // OS_LINUX || OS_BSD || OS_HURD #endif #ifdef MOZ_WIDGET_COCOA @@ -704,7 +704,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt childArgv.push_back(childProcessType); base::LaunchApp(childArgv, mFileMap, -#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) +#if defined(OS_LINUX) || defined(OS_MACOSX) || defined(OS_BSD) || defined(OS_HURD) newEnvVars, privs, #endif false, &process, arch); diff --git a/js/src/configure b/js/src/configure index 79c7497..fd5aaf0 100755 --- a/js/src/configure +++ b/js/src/configure @@ -15578,7 +15578,7 @@ EOF MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib).$(MOZ_ICU_VERSION)$(DLL_SUFFIX))' fi ;; - Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD) + Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|GNU/kFreeBSD|GNU) ICU_LIB_NAMES="icui18n icuuc icudata" if test -n "$MOZ_SHARED_ICU"; then MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(lib)$(DLL_SUFFIX).$(MOZ_ICU_VERSION))' diff --git a/js/src/jit/AsmJSSignalHandlers.cpp b/js/src/jit/AsmJSSignalHandlers.cpp index d031a2f..e6de840 100644 --- a/js/src/jit/AsmJSSignalHandlers.cpp +++ b/js/src/jit/AsmJSSignalHandlers.cpp @@ -55,10 +55,12 @@ using JS::GenericNaN; # define R13_sig(p) ((p)->sc_r13) # define R14_sig(p) ((p)->sc_r14) # define R15_sig(p) ((p)->sc_r15) -#elif defined(__linux__) || defined(SOLARIS) +#elif defined(__linux__) || defined(__GNU__) || defined(SOLARIS) # if defined(__linux__) # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i]) # define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP]) +# elif defined(__GNU__) +# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP]) # else # define XMM_sig(p,i) ((p)->uc_mcontext.fpregs.fp_reg_set.fpchip_state.xmm[i]) # define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_PC]) -- 2.0.0