tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: FireFox 10.0.1 pkg for testing



Hi,
> ftp.netbsd.org:/pub/NetBSD/misc/martin/firefox-10.0.2.tar.gz
> 
> with these changes (and one small fix hopefully helping DragonFly 
> compilation).
Thank you.
It help the build on DragonFly 3.0.1.
The build of DragonFly 3.0.1 needs some more patches.
With attahed patch-* files, compile is OK. (but sadly
I am newbie on DragonFly. they may include bugs.) 
But in link stage, the following error generated.
I cannot understand why it fails.
I have added some OS_LIBS += $(call EXPAND_LIBNAME,kvm) to makefiles,
no effects. Attached patch-* does not include this attempt.
Thank you.
/usr/pkg/bin/python2.7 ../../config/pythonpath.py -I../../config 
../../config/expandlibs_exec.py --uselist -- c++ -I/usr/include 
-I/usr/pkg/include -I/usr/pkg/include/freetype2 -fno-rtti -Wall -Wpointer-arith 
-Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 
-Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -O2 
-I/usr/include -I/usr/pkg/include -I/usr/pkg/include/freetype2 -fno-exceptions 
-fno-strict-aliasing -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -O2 
-fomit-frame-pointer -fPIC -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so 
nsStaticXULComponents.o nsUnicharUtils.o nsBidiUtils.o nsRDFResource.o 
-lpthread -L/usr/lib -Wl,-R/usr/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib 
-Wl,-rpath-link,/usr/tmp/devel/xulrunner/work/mozilla-release/dist/bin 
-Wl,-rpath-link,/usr/pkg/lib ../../toolkit/xre/libxulapp_s.a 
../../staticlib/components/libnecko.a ../../staticlib/components/libuconv.a 
../../staticlib/components/libi18n.a ../../staticlib/components/libchardet.a 
../../staticlib/components/libjar50.a 
../../staticlib/components/libstartupcache.a 
../../staticlib/components/libpref.a ../../staticlib/components/libhtmlpars.a 
../../staticlib/components/libimglib2.a ../../staticlib/components/libgkgfx.a 
../../staticlib/components/libgklayout.a 
../../staticlib/components/libdocshell.a 
../../staticlib/components/libembedcomponents.a 
../../staticlib/components/libwebbrwsr.a 
../../staticlib/components/libnsappshell.a 
../../staticlib/components/libtxmgr.a 
../../staticlib/components/libcommandlines.a 
../../staticlib/components/libtoolkitcomps.a 
../../staticlib/components/libpipboot.a ../../staticlib/components/libpipnss.a 
../../staticlib/components/libappcomps.a 
../../staticlib/components/libjsreflect.a 
../../staticlib/components/libcomposer.a 
../../staticlib/components/libjetpack_s.a 
../../staticlib/components/libtelemetry.a 
../../staticlib/components/libjsdebugger.a 
../../staticlib/components/libstoragecomps.a 
../../staticlib/components/librdf.a ../../staticlib/components/libwindowds.a 
../../staticlib/components/libjsctypes.a ../../staticlib/components/libjsperf.a 
../../staticlib/components/libgkplugin.a 
../../staticlib/components/libunixproxy.a ../../staticlib/components/libjsd.a 
../../staticlib/components/libautoconfig.a ../../staticlib/components/libauth.a 
../../staticlib/components/libcookie.a 
../../staticlib/components/libpermissions.a 
../../staticlib/components/libuniversalchardet.a 
../../staticlib/components/libfileview.a ../../staticlib/components/libplaces.a 
../../staticlib/components/libtkautocomplete.a 
../../staticlib/components/libsatchel.a ../../staticlib/components/libpippki.a 
../../staticlib/components/libwidget_gtk2.a 
../../staticlib/components/libsystem-pref.a 
../../staticlib/components/libimgicon.a 
../../staticlib/components/libaccessibility.a 
../../staticlib/components/libremoteservice.a 
../../staticlib/components/libspellchecker.a 
../../staticlib/components/libzipwriter.a 
../../staticlib/components/libservices-crypto.a ../../staticlib/libjsipc_s.a 
../../staticlib/libdomipc_s.a ../../staticlib/libdomplugins_s.a 
../../staticlib/libmozipc_s.a ../../staticlib/libmozipdlgen_s.a 
../../staticlib/libipcshell_s.a ../../staticlib/libgfx2d.a 
../../staticlib/libgfxipc_s.a ../../staticlib/libhal_s.a 
../../staticlib/libxpcom_core.a ../../staticlib/libucvutil_s.a 
../../staticlib/libchromium_s.a ../../staticlib/libmozreg_s.a 
../../staticlib/libgtkxtbin.a ../../staticlib/libthebes.a 
../../staticlib/libycbcr.a ../../staticlib/libangle.a -L../../dist/bin 
-L../../dist/lib -ljpeg ../../media/libpng/libmozpng.a 
../../gfx/qcms/libmozqcms.a 
/usr/tmp/devel/xulrunner/work/mozilla-release/dist/lib/libjs_static.a 
-L../../dist/bin -L../../dist/lib -lcrmf -lsmime3 -lssl3 -lnss3 -lnssutil3 
../../gfx/cairo/cairo/src/libmozcairo.a 
../../gfx/cairo/libpixman/src/libmozlibpixman.a -lXrender -lfreetype 
-lfontconfig ../../gfx/harfbuzz/src/libmozharfbuzz.a 
../../gfx/ots/src/libmozots.a -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lsqlite3 
-lz -L/usr/pkg/lib -levent -lrt -L../../dist/bin -L../../dist/lib 
-Wl,-R/usr/pkg/lib/xulrunner 
-L/usr/tmp/devel/xulrunner/work/mozilla-release/dist/lib -lplds4 -lplc4 -lnspr4 
-L/usr/lib -L/usr/pkg/lib -pthread -ldl ../../dist/lib/libmozalloc.a -lX11 
-lXext -Wl,-R/usr/pkg/lib -pthread -L/usr/pkg/lib -lpangoft2-1.0 -lfreetype 
-lfontconfig -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 
-lgthread-2.0 -lpthread -lrt -lglib-2.0 -lintl -Wl,-R/usr/pkg/lib -pthread 
-L/usr/pkg/lib -lgtk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lfreetype 
-lfontconfig -lgdk-x11-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 
-lcairo -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lpthread -lrt -lglib-2.0 
-lintl -lXt -lgthread-2.0 -L/usr/pkg/lib -lfreetype -lz -lbz2 -lc -lkvm
../../ipc/chromium/process_util_bsd.o: In function 
`base::NamedProcessIterator::NamedProcessIterator(std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, 
base::ProcessFilter const*)':
process_util_bsd.cc:(.text+0x609): undefined reference to `kvm_open'
process_util_bsd.cc:(.text+0x635): undefined reference to `kvm_getprocs'
process_util_bsd.cc:(.text+0x762): undefined reference to `kvm_close'
../../ipc/chromium/process_util_bsd.o: In function 
`base::NamedProcessIterator::NamedProcessIterator(std::basic_string<wchar_t, 
std::char_traits<wchar_t>, std::allocator<wchar_t> > const&, 
base::ProcessFilter const*)':
process_util_bsd.cc:(.text+0x859): undefined reference to `kvm_open'
process_util_bsd.cc:(.text+0x885): undefined reference to `kvm_getprocs'
process_util_bsd.cc:(.text+0x9b2): undefined reference to `kvm_close'
/usr/libexec/binutils221/elf/ld: libxul.so: hidden symbol `kvm_getprocs' isn't 
defined
/usr/libexec/binutils221/elf/ld: final link failed: Bad value
gmake[3]: *** [libxul.so] Error 1
gmake[3]: Leaving directory 
`/usr/tmp/devel/xulrunner/work/mozilla-release/toolkit/library'
gmake[2]: *** [libs_tier_platform] Error 2
gmake[2]: Leaving directory `/usr/tmp/devel/xulrunner/work/mozilla-release'
gmake[1]: *** [tier_platform] Error 2
gmake[1]: Leaving directory `/usr/tmp/devel/xulrunner/work/mozilla-release'
gmake: *** [all] Error 2
*** Error code 2
Stop.
bmake: stopped in /usr/pkgsrc/devel/xulrunner
*** Error code 1
Stop.
bmake: stopped in /usr/pkgsrc/devel/xulrunner
$
--
Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB FD1B F404 27FA C7D1 15F3
$NetBSD$
--- ipc/chromium/Makefile.in.orig 2012年02月16日 06:40:33.000000000 +0000
+++ ipc/chromium/Makefile.in
@@ -278,6 +278,34 @@ endif
 
 endif # } OS_LINUX
 
+ifdef OS_BSD # {
+
+CPPSRCS += \
+ atomicops_internals_x86_gcc.cc \
+ file_util_bsd.cc \
+ process_util_bsd.cc \
+ time_posix.cc \
+ $(NULL)
+
+ifdef MOZ_ENABLE_GTK2
+CPPSRCS += \
+ message_pump_glib.cc \
+ $(NULL)
+endif
+
+ifdef MOZ_ENABLE_QT
+MOCSRCS = \
+ moc_message_pump_qt.cc \
+ $(NULL)
+
+CPPSRCS += \
+ $(MOCSRCS) \
+ message_pump_qt.cc \
+ $(NULL)
+endif
+
+endif # } OS_BSD
+
 # libevent
 
 ifndef MOZ_NATIVE_LIBEVENT # {
$NetBSD$
--- ipc/chromium/src/base/debug_util_posix.cc.orig 2012年02月16日 
06:40:33.000000000 +0000
+++ ipc/chromium/src/base/debug_util_posix.cc
@@ -5,7 +5,7 @@
 #include "build/build_config.h"
 #include "base/debug_util.h"
 
-#define MOZ_HAVE_EXECINFO_H (!defined(ANDROID) && !defined(__OpenBSD__))
+#define MOZ_HAVE_EXECINFO_H (defined(__linux__) && !defined(ANDROID))
 
 #include <errno.h>
 #include <fcntl.h>
@@ -17,8 +17,11 @@
 #include <unistd.h>
 #if MOZ_HAVE_EXECINFO_H
 #include <execinfo.h>
-#include <sys/sysctl.h>
 #endif
+#if defined(OS_DRAGONFLY)
+#include <sys/user.h>
+#endif
+#include <sys/sysctl.h>
 
 #include "base/basictypes.h"
 #include "base/eintr_wrapper.h"
@@ -32,7 +35,7 @@ bool DebugUtil::SpawnDebuggerOnProcess(u
 return false;
 }
 
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_BSD)
 
 // Based on Apple's recommended method as described in
 // http://developer.apple.com/qa/qa2004/qa1361.html
@@ -71,7 +74,11 @@ bool DebugUtil::BeingDebugged() {
 
 // This process is being debugged if the P_TRACED flag is set.
 is_set = true;
+#if defined(__DragonFly__)
+ being_debugged = (info.kp_flags & P_TRACED) != 0;
+#else
 being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
+#endif
 return being_debugged;
 }
 
$NetBSD$
--- ipc/chromium/src/base/platform_thread_posix.cc.orig 2012年02月16日 
06:40:33.000000000 +0000
+++ ipc/chromium/src/base/platform_thread_posix.cc
@@ -9,9 +9,13 @@
 
 #if defined(OS_MACOSX)
 #include <mach/mach.h>
+#elif defined(OS_NETBSD)
+#include <lwp.h>
 #elif defined(OS_LINUX)
 #include <sys/syscall.h>
 #include <unistd.h>
+#elif defined(OS_DRAGONFLY)
+#include <unistd.h>
 #endif
 
 #if defined(OS_MACOSX)
@@ -33,6 +37,14 @@ PlatformThreadId PlatformThread::Current
 // into the kernel.
 #if defined(OS_MACOSX)
 return mach_thread_self();
+#elif defined(OS_NETBSD)
+ return _lwp_self();
+#elif defined(OS_DRAGONFLY)
+ return lwp_gettid();
+#elif defined(OS_FREEBSD)
+ lwpid_t lwpid;
+ thr_self( &lwpid );
+ return lwpid;
 #elif defined (__OpenBSD__)
 // TODO(BSD): find a better thread ID
 return (intptr_t)(pthread_self());
$NetBSD$
--- ipc/chromium/src/base/process_util_bsd.cc.orig 2012年02月24日 
09:52:40.581943000 +0000
+++ ipc/chromium/src/base/process_util_bsd.cc
@@ -0,0 +1,298 @@
+// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// derived from process_util_linux.cc and process_util_mac.cc
+
+// TODO: - add code for FreeBSD/DragonFly/MirBSD (?) to use kvm_getprocx
+
+#include "base/process_util.h"
+
+#include <ctype.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string>
+#include <kvm.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#if defined(OS_DRAGONFLY)
+#include <sys/user.h>
+#endif
+
+#include "base/debug_util.h"
+#include "base/eintr_wrapper.h"
+#include "base/file_util.h"
+#include "base/logging.h"
+#include "base/string_tokenizer.h"
+#include "base/string_util.h"
+
+#ifdef __NetBSD__
+#include <sys/param.h>
+#if __NetBSD_Version__ >= 600000000
+#define HAVE_POSIX_SPAWN 1
+#endif
+#endif
+
+#ifdef HAVE_POSIX_SPAWN
+#include <spawn.h>
+extern "C" char **environ __dso_public;
+#endif
+
+namespace {
+
+enum ParsingState {
+ KEY_NAME,
+ KEY_VALUE
+};
+
+static mozilla::EnvironmentLog gProcessLog("MOZ_PROCESS_LOG");
+
+} // namespace
+
+namespace base {
+
+#ifdef HAVE_POSIX_SPAWN
+
+void FreeEnvVarsArray(char* array[], int length)
+{
+ for (int i = 0; i < length; i++) {
+ free(array[i]);
+ }
+ delete[] array;
+}
+
+bool LaunchApp(const std::vector<std::string>& argv,
+ const file_handle_mapping_vector& fds_to_remap,
+ bool wait, ProcessHandle* process_handle) {
+ return LaunchApp(argv, fds_to_remap, environment_map(),
+ wait, process_handle);
+}
+
+bool LaunchApp(const std::vector<std::string>& argv,
+ const file_handle_mapping_vector& fds_to_remap,
+ const environment_map& env_vars_to_set,
+ bool wait, ProcessHandle* process_handle,
+ ProcessArchitecture arch) {
+ bool retval = true;
+
+ char* argv_copy[argv.size() + 1];
+ for (size_t i = 0; i < argv.size(); i++) {
+ argv_copy[i] = const_cast<char*>(argv[i].c_str());
+ }
+ argv_copy[argv.size()] = NULL;
+
+ // Make sure we don't leak any FDs to the child process by marking all FDs
+ // as close-on-exec.
+ SetAllFDsToCloseOnExec();
+
+ // Copy environment to a new char array and add the variables
+ // in env_vars_to_set.
+ // Existing variables are overwritten by env_vars_to_set.
+ int pos = 0;
+ environment_map combined_env_vars = env_vars_to_set;
+ while(environ[pos] != NULL) {
+ std::string varString = environ[pos];
+ std::string varName = varString.substr(0, varString.find_first_of('='));
+ std::string varValue = varString.substr(varString.find_first_of('=') + 1);
+ if (combined_env_vars.find(varName) == combined_env_vars.end()) {
+ combined_env_vars[varName] = varValue;
+ }
+ pos++;
+ }
+ int varsLen = combined_env_vars.size() + 1;
+
+ char** vars = new char*[varsLen];
+ int i = 0;
+ for (environment_map::const_iterator it = combined_env_vars.begin();
+ it != combined_env_vars.end(); ++it) {
+ std::string entry(it->first);
+ entry += "=";
+ entry += it->second;
+ vars[i] = strdup(entry.c_str());
+ i++;
+ }
+ vars[i] = NULL;
+
+ posix_spawn_file_actions_t file_actions;
+ if (posix_spawn_file_actions_init(&file_actions) != 0) {
+ FreeEnvVarsArray(vars, varsLen);
+ return false;
+ }
+
+ // Turn fds_to_remap array into a set of dup2 calls.
+ for (file_handle_mapping_vector::const_iterator it = fds_to_remap.begin();
+ it != fds_to_remap.end();
+ ++it) {
+ int src_fd = it->first;
+ int dest_fd = it->second;
+
+ if (src_fd == dest_fd) {
+ int flags = fcntl(src_fd, F_GETFD);
+ if (flags != -1) {
+ fcntl(src_fd, F_SETFD, flags & ~FD_CLOEXEC);
+ }
+ } else {
+ if (posix_spawn_file_actions_adddup2(&file_actions, src_fd, dest_fd) != 
0) {
+ posix_spawn_file_actions_destroy(&file_actions);
+ FreeEnvVarsArray(vars, varsLen);
+ return false;
+ }
+ }
+ }
+
+ pid_t pid = 0;
+ int spawn_succeeded = (posix_spawnp(&pid,
+ argv_copy[0],
+ &file_actions,
+ NULL,
+ argv_copy,
+ vars) == 0);
+
+ FreeEnvVarsArray(vars, varsLen);
+
+ posix_spawn_file_actions_destroy(&file_actions);
+
+ bool process_handle_valid = pid > 0;
+ if (!spawn_succeeded || !process_handle_valid) {
+ retval = false;
+ } else {
+ if (wait)
+ HANDLE_EINTR(waitpid(pid, 0, 0));
+
+ if (process_handle)
+ *process_handle = pid;
+ }
+
+ return retval;
+}
+
+bool LaunchApp(const CommandLine& cl,
+ bool wait, bool start_hidden, ProcessHandle* process_handle) {
+ // TODO(playmobil): Do we need to respect the start_hidden flag?
+ file_handle_mapping_vector no_files;
+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
+}
+
+#else // no posix_spawn, use fork/exec
+
+bool LaunchApp(const std::vector<std::string>& argv,
+ const file_handle_mapping_vector& fds_to_remap,
+ bool wait, ProcessHandle* process_handle) {
+ return LaunchApp(argv, fds_to_remap, environment_map(),
+ wait, process_handle);
+}
+
+bool LaunchApp(const std::vector<std::string>& argv,
+ const file_handle_mapping_vector& fds_to_remap,
+ const environment_map& env_vars_to_set,
+ bool wait, ProcessHandle* process_handle,
+ ProcessArchitecture arch) {
+ scoped_array<char*> argv_cstr(new char*[argv.size() + 1]);
+ // Illegal to allocate memory after fork and before execvp
+ InjectiveMultimap fd_shuffle1, fd_shuffle2;
+ fd_shuffle1.reserve(fds_to_remap.size());
+ fd_shuffle2.reserve(fds_to_remap.size());
+
+ pid_t pid = fork();
+ if (pid < 0)
+ return false;
+
+ if (pid == 0) {
+ for (file_handle_mapping_vector::const_iterator
+ it = fds_to_remap.begin(); it != fds_to_remap.end(); ++it) {
+ fd_shuffle1.push_back(InjectionArc(it->first, it->second, false));
+ fd_shuffle2.push_back(InjectionArc(it->first, it->second, false));
+ }
+
+ if (!ShuffleFileDescriptors(&fd_shuffle1))
+ _exit(127);
+
+ CloseSuperfluousFds(fd_shuffle2);
+
+ for (environment_map::const_iterator it = env_vars_to_set.begin();
+ it != env_vars_to_set.end(); ++it) {
+ if (setenv(it->first.c_str(), it->second.c_str(), 1/*overwrite*/))
+ _exit(127);
+ }
+
+ for (size_t i = 0; i < argv.size(); i++)
+ argv_cstr[i] = const_cast<char*>(argv[i].c_str());
+ argv_cstr[argv.size()] = NULL;
+ execvp(argv_cstr[0], argv_cstr.get());
+ // if we get here, we're in serious trouble and should complain loudly
+ DLOG(ERROR) << "FAILED TO exec() CHILD PROCESS, path: " << argv_cstr[0];
+ exit(127);
+ } else {
+ gProcessLog.print("==> process %d launched child process %d\n",
+ GetCurrentProcId(), pid);
+ if (wait)
+ HANDLE_EINTR(waitpid(pid, 0, 0));
+
+ if (process_handle)
+ *process_handle = pid;
+ }
+
+ return true;
+}
+
+bool LaunchApp(const CommandLine& cl,
+ bool wait, bool start_hidden,
+ ProcessHandle* process_handle) {
+ file_handle_mapping_vector no_files;
+ return LaunchApp(cl.argv(), no_files, wait, process_handle);
+}
+
+#endif
+
+NamedProcessIterator::NamedProcessIterator(const std::wstring& executable_name,
+ const ProcessFilter* filter)
+{
+ int numEntries;
+ kvm_t *kvm;
+ std::string exe(WideToASCII(executable_name));
+
+#if defined(OS_DRAGONFLY)
+ kvm = kvm_open(NULL, NULL, NULL, O_RDONLY, NULL);
+ struct kinfo_proc* procs = kvm_getprocs(kvm, KERN_PROC_UID, getuid(), 
&numEntries);
+ if (procs != NULL && numEntries > 0) {
+ for (int i = 0; i < numEntries; i++) {
+ if (exe != procs[i].kp_comm) continue;
+ if (filter && !filter->Includes(procs[i].kp_pid, procs[i].kp_ppid)) 
continue;
+ ProcessEntry e;
+ e.pid = procs[i].kp_pid;
+ e.ppid = procs[i].kp_ppid;
+ strlcpy(e.szExeFile, procs[i].kp_comm, sizeof e.szExeFile);
+ content.push_back(e);
+#else
+ kvm = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
+ struct kinfo_proc2* procs = kvm_getproc2(kvm, KERN_PROC_UID, getuid(), 
sizeof(struct kinfo_proc2), &numEntries);
+ if (procs != NULL && numEntries > 0) {
+ for (int i = 0; i < numEntries; i++) {
+ if (exe != procs[i].p_comm) continue;
+ if (filter && !filter->Includes(procs[i].p_pid, procs[i].p_ppid)) 
continue;
+ ProcessEntry e;
+ e.pid = procs[i].p_pid;
+ e.ppid = procs[i].p_ppid;
+ strlcpy(e.szExeFile, procs[i].p_comm, sizeof e.szExeFile);
+ content.push_back(e);
+#endif
+ }
+ }
+ nextEntry = 0;
+ kvm_close(kvm);
+}
+
+NamedProcessIterator::~NamedProcessIterator() {
+}
+
+const ProcessEntry* NamedProcessIterator::NextProcessEntry() {
+ if (nextEntry >= content.size()) return NULL;
+ return &content[nextEntry++];
+}
+
+bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const {
+ return false;
+}
+
+} // namespace base


Home | Main Index | Thread Index | Old Index

AltStyle によって変換されたページ (->オリジナル) /