Compare commits

..

No commits in common. "rawhide" and "f16" have entirely different histories.

19 changed files with 2699 additions and 1 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/firefox-*.source.tar.bz2
/xulrunner-*.source.tar.bz2

View file

@ -1 +0,0 @@
This package is no longer supported by upstream

View file

@ -0,0 +1,32 @@
diff -up xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul-embedding.pc.in.pk xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul-embedding.pc.in
--- xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul-embedding.pc.in.pk 2010-08-06 03:09:24.000000000 +0200
+++ xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul-embedding.pc.in 2010-08-16 11:12:32.000000000 +0200
@@ -6,5 +6,6 @@ idldir=%idldir%
Name: libxul-embedding
Description: Static library for version-independent embedding of the Mozilla runtime
Version: %MOZILLA_VERSION%
+Requires: %NSPR_NAME% >= %NSPR_VERSION%
Libs: -L${sdkdir}/lib -lxpcomglue -ldl
Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
diff -up xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul.pc.in.pk xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul.pc.in
--- xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul.pc.in.pk 2010-08-06 03:09:24.000000000 +0200
+++ xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/libxul.pc.in 2010-08-16 11:07:52.000000000 +0200
@@ -2,6 +2,7 @@ prefix=%prefix%
sdkdir=%sdkdir%
includedir=%includedir%
idldir=%idldir%
+libdir=%libdir%
Name: libxul
Description: The Mozilla Runtime and Embedding Engine
diff -up xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/Makefile.in.pk xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/Makefile.in
--- xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/Makefile.in.pk 2010-08-16 11:07:52.000000000 +0200
+++ xulrunner-1.9.3.0/mozilla-central/xulrunner/installer/Makefile.in 2010-08-16 11:07:52.000000000 +0200
@@ -116,6 +116,7 @@ endif
-e "s|%includedir%|$(includedir)|" \
-e "s|%idldir%|$(idldir)|" \
-e "s|%sdkdir%|$(sdkdir)|" \
+ -e "s|%libdir%|$(installdir)|" \
-e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \
-e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \
-e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \

483
mozilla-239254.patch Normal file
View file

@ -0,0 +1,483 @@
# HG changeset patch
# Parent cb34bd8957ec517c72d506f7c439e3af1950e38d
# User Martin Stransky <stransky@redhat.com>
Bug 239254 - [Linux] Support disk cache on a local path, r=michal.novotny
diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -712,27 +712,18 @@ nsCacheProfilePrefObserver::ReadPrefs(ns
nsCOMPtr<nsIFile> profDir;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
getter_AddRefs(profDir));
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
getter_AddRefs(directory));
if (!directory)
directory = profDir;
else if (profDir) {
- bool same;
- if (NS_SUCCEEDED(profDir->Equals(directory, &same)) && !same) {
- // We no longer store the cache directory in the main
- // profile directory, so we should cleanup the old one.
- rv = profDir->AppendNative(NS_LITERAL_CSTRING("Cache"));
- if (NS_SUCCEEDED(rv)) {
- bool exists;
- if (NS_SUCCEEDED(profDir->Exists(&exists)) && exists)
- nsDeleteDir::DeleteDir(profDir, false);
- }
- }
+ nsCacheService::MoveOrRemoveDiskCache(profDir, directory,
+ "Cache");
}
}
// use file cache in build tree only if asked, to avoid cache dir litter
if (!directory && PR_GetEnv("NECKO_DEV_ENABLE_DISK_CACHE")) {
rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
getter_AddRefs(directory));
}
if (directory)
@@ -788,16 +779,20 @@ nsCacheProfilePrefObserver::ReadPrefs(ns
// try to get the profile directory (there may not be a profile yet)
nsCOMPtr<nsIFile> profDir;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
getter_AddRefs(profDir));
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_LOCAL_50_DIR,
getter_AddRefs(directory));
if (!directory)
directory = profDir;
+ else if (profDir) {
+ nsCacheService::MoveOrRemoveDiskCache(profDir, directory,
+ "OfflineCache");
+ }
}
#if DEBUG
if (!directory) {
// use current process directory during development
rv = NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
getter_AddRefs(directory));
}
#endif
@@ -3012,16 +3007,67 @@ nsCacheService::SetDiskSmartSize_Locked(
DispatchToCacheIOThread(event);
} else {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
+void
+nsCacheService::MoveOrRemoveDiskCache(nsIFile *aOldCacheDir,
+ nsIFile *aNewCacheDir,
+ const char *aCacheSubdir)
+{
+ bool same;
+ if (NS_FAILED(aOldCacheDir->Equals(aNewCacheDir, &same)) || same)
+ return;
+
+ nsCOMPtr<nsIFile> aOldCacheSubdir;
+ aOldCacheDir->Clone(getter_AddRefs(aOldCacheSubdir));
+
+ nsresult rv = aOldCacheSubdir->AppendNative(
+ nsDependentCString(aCacheSubdir));
+ if (NS_FAILED(rv))
+ return;
+
+ bool exists;
+ if (NS_FAILED(aOldCacheSubdir->Exists(&exists)) || !exists)
+ return;
+
+ nsCOMPtr<nsIFile> aNewCacheSubdir;
+ aNewCacheDir->Clone(getter_AddRefs(aNewCacheSubdir));
+
+ rv = aNewCacheSubdir->AppendNative(nsDependentCString(aCacheSubdir));
+ if (NS_FAILED(rv))
+ return;
+
+ nsAutoCString newPath;
+ rv = aNewCacheSubdir->GetNativePath(newPath);
+ if (NS_FAILED(rv))
+ return;
+
+ if (NS_SUCCEEDED(aNewCacheSubdir->Exists(&exists)) && !exists) {
+ // New cache directory does not exist, try to move the old one here
+ // rename needs an empty target directory
+ rv = aNewCacheSubdir->Create(nsIFile::DIRECTORY_TYPE, 0777);
+ if (NS_SUCCEEDED(rv)) {
+ nsAutoCString oldPath;
+ rv = aOldCacheSubdir->GetNativePath(oldPath);
+ if (NS_FAILED(rv))
+ return;
+ if(rename(oldPath.get(), newPath.get()) == 0)
+ return;
+ }
+ }
+
+ // Delay delete by 1 minute to avoid IO thrash on startup.
+ nsDeleteDir::DeleteDir(aOldCacheSubdir, false, 60000);
+}
+
static bool
IsEntryPrivate(nsCacheEntry* entry)
{
return entry->IsPrivate();
}
void
nsCacheService::LeavePrivateBrowsing()
diff --git a/netwerk/cache/nsCacheService.h b/netwerk/cache/nsCacheService.h
--- a/netwerk/cache/nsCacheService.h
+++ b/netwerk/cache/nsCacheService.h
@@ -194,16 +194,20 @@ public:
static void SetMemoryCache();
static void SetCacheCompressionLevel(int32_t level);
// Starts smart cache size computation if disk device is available
static nsresult SetDiskSmartSize();
+ static void MoveOrRemoveDiskCache(nsIFile *aOldCacheDir,
+ nsIFile *aNewCacheDir,
+ const char *aCacheSubdir);
+
nsresult Init();
void Shutdown();
static bool IsInitialized()
{
if (!gService) {
return false;
}
diff --git a/startupcache/StartupCache.cpp b/startupcache/StartupCache.cpp
--- a/startupcache/StartupCache.cpp
+++ b/startupcache/StartupCache.cpp
@@ -168,16 +168,30 @@ StartupCache::Init()
nsCOMPtr<nsIFile> file;
rv = NS_GetSpecialDirectory("ProfLDS",
getter_AddRefs(file));
if (NS_FAILED(rv)) {
// return silently, this will fail in mochitests's xpcshell process.
return rv;
}
+ nsCOMPtr<nsIFile> profDir;
+ NS_GetSpecialDirectory("ProfDS", getter_AddRefs(profDir));
+ if (profDir) {
+ bool same;
+ if (NS_SUCCEEDED(profDir->Equals(file, &same)) && !same) {
+ // We no longer store the startup cache in the main profile
+ // directory, so we should cleanup the old one.
+ if (NS_SUCCEEDED(
+ profDir->AppendNative(NS_LITERAL_CSTRING("startupCache")))) {
+ profDir->Remove(true);
+ }
+ }
+ }
+
rv = file->AppendNative(NS_LITERAL_CSTRING("startupCache"));
NS_ENSURE_SUCCESS(rv, rv);
// Try to create the directory if it's not there yet
rv = file->Create(nsIFile::DIRECTORY_TYPE, 0777);
if (NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)
return rv;
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1170,18 +1170,32 @@ nsXREDirProvider::GetUserDataDirectoryHo
#elif defined(MOZ_WIDGET_GONK)
rv = NS_NewNativeLocalFile(NS_LITERAL_CSTRING("/data/b2g"), true,
getter_AddRefs(localDir));
#elif defined(XP_UNIX)
const char* homeDir = getenv("HOME");
if (!homeDir || !*homeDir)
return NS_ERROR_FAILURE;
- rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
- getter_AddRefs(localDir));
+ if (aLocal) {
+ // If $XDG_CACHE_HOME is defined use it, otherwise use $HOME/.cache.
+ const char* cacheHome = getenv("XDG_CACHE_HOME");
+ if (cacheHome && *cacheHome) {
+ rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true,
+ getter_AddRefs(localDir));
+ } else {
+ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+ getter_AddRefs(localDir));
+ if (NS_SUCCEEDED(rv))
+ rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
+ }
+ } else {
+ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
+ getter_AddRefs(localDir));
+ }
#else
#error "Don't know how to get product dir on your platform"
#endif
NS_IF_ADDREF(*aFile = localDir);
return rv;
}
@@ -1256,17 +1270,17 @@ nsXREDirProvider::GetUserDataDirectory(n
const nsACString* aProfileName,
const nsACString* aAppName,
const nsACString* aVendorName)
{
nsCOMPtr<nsIFile> localDir;
nsresult rv = GetUserDataDirectoryHome(getter_AddRefs(localDir), aLocal);
NS_ENSURE_SUCCESS(rv, rv);
- rv = AppendProfilePath(localDir, aProfileName, aAppName, aVendorName);
+ rv = AppendProfilePath(localDir, aProfileName, aAppName, aVendorName, aLocal);
NS_ENSURE_SUCCESS(rv, rv);
#ifdef DEBUG_jungshik
nsAutoCString cwd;
localDir->GetNativePath(cwd);
printf("nsXREDirProvider::GetUserDataDirectory: %s\n", cwd.get());
#endif
rv = EnsureDirectoryExists(localDir);
@@ -1377,17 +1391,18 @@ nsXREDirProvider::AppendSysUserExtension
return NS_OK;
}
nsresult
nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
const nsACString* aProfileName,
const nsACString* aAppName,
- const nsACString* aVendorName)
+ const nsACString* aVendorName,
+ bool aLocal)
{
NS_ASSERTION(aFile, "Null pointer!");
if (!gAppData) {
return NS_ERROR_FAILURE;
}
nsAutoCString profile;
@@ -1439,28 +1454,31 @@ nsXREDirProvider::AppendProfilePath(nsIF
// The parent of this directory is set in GetUserDataDirectoryHome
// XXX: handle gAppData->profile properly
// XXXsmaug ...and the rest of the profile creation!
MOZ_ASSERT(!aAppName,
"Profile creation for external applications is not implemented!");
rv = aFile->AppendNative(nsDependentCString("mozilla"));
NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_UNIX)
- // Make it hidden (i.e. using the ".")
- nsAutoCString folder(".");
+ nsAutoCString folder;
+ // Make it hidden (by starting with "."), except when local (the
+ // profile is already under ~/.cache or XDG_CACHE_HOME).
+ if (!aLocal)
+ folder.Assign('.');
if (!profile.IsEmpty()) {
// Skip any leading path characters
const char* profileStart = profile.get();
while (*profileStart == '/' || *profileStart == '\\')
profileStart++;
// On the off chance that someone wanted their folder to be hidden don't
// let it become ".."
- if (*profileStart == '.')
+ if (*profileStart == '.' && !aLocal)
profileStart++;
folder.Append(profileStart);
ToLowerCase(folder);
rv = AppendProfileString(aFile, folder.BeginReading());
}
else {
diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h
--- a/toolkit/xre/nsXREDirProvider.h
+++ b/toolkit/xre/nsXREDirProvider.h
@@ -109,17 +109,18 @@ protected:
static nsresult EnsureDirectoryExists(nsIFile* aDirectory);
void EnsureProfileFileExists(nsIFile* aFile);
// Determine the profile path within the UAppData directory. This is different
// on every major platform.
static nsresult AppendProfilePath(nsIFile* aFile,
const nsACString* aProfileName,
const nsACString* aAppName,
- const nsACString* aVendorName);
+ const nsACString* aVendorName,
+ bool aLocal);
static nsresult AppendSysUserExtensionPath(nsIFile* aFile);
// Internal helper that splits a path into components using the '/' and '\\'
// delimiters.
static inline nsresult AppendProfileString(nsIFile* aFile, const char* aPath);
// Calculate and register extension and theme bundle directories.
# HG changeset patch
# User Tim Taubert <ttaubert@mozilla.com>
# Date 1360362227 -3600
# Node ID 873170d2679ac23114f22543cee3214a940abef3
Bug 239254 - [Linux] Migrate existing thumbnails to their new local path
diff --git a/browser/components/thumbnails/PageThumbs.jsm b/browser/components/thumbnails/PageThumbs.jsm
--- a/browser/components/thumbnails/PageThumbs.jsm
+++ b/browser/components/thumbnails/PageThumbs.jsm
@@ -7,17 +7,17 @@
this.EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"];
const Cu = Components.utils;
const Cc = Components.classes;
const Ci = Components.interfaces;
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
const PREF_STORAGE_VERSION = "browser.pagethumbnails.storage_version";
-const LATEST_STORAGE_VERSION = 2;
+const LATEST_STORAGE_VERSION = 3;
const EXPIRATION_MIN_CHUNK_SIZE = 50;
const EXPIRATION_INTERVAL_SECS = 3600;
/**
* Name of the directory in the profile that contains the thumbnails.
*/
const THUMBNAIL_DIRECTORY = "thumbnails";
@@ -359,47 +359,51 @@ let PageThumbsStorageMigrator = {
set currentVersion(aVersion) {
Services.prefs.setIntPref(PREF_STORAGE_VERSION, aVersion);
},
migrate: function Migrator_migrate() {
let version = this.currentVersion;
- if (version < 1) {
- this.removeThumbnailsFromRoamingProfile();
- }
- if (version < 2) {
- this.renameThumbnailsFolder();
+ // Storage version 1 never made it to beta.
+ // At the time of writing only Windows had (ProfD != ProfLD) and we
+ // needed to move thumbnails from the roaming profile to the locale
+ // one so that they're not needlessly included in backups and/or
+ // written via SMB.
+
+ // Storage version 2 also never made it to beta.
+ // The thumbnail folder structure has been changed and old thumbnails
+ // were not migrated. Instead, we just renamed the current folder to
+ // "<name>-old" and will remove it later.
+
+ if (version < 3) {
+ this.migrateToVersion3();
}
this.currentVersion = LATEST_STORAGE_VERSION;
},
- removeThumbnailsFromRoamingProfile:
- function Migrator_removeThumbnailsFromRoamingProfile() {
- let local = FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY]);
+ /**
+ * Bug 239254 added support for having the disk cache and thumbnail
+ * directories on a local path (i.e. ~/.cache/) under Linux. We'll first
+ * try to move the old thumbnails to their new location. If that's not
+ * possible (because ProfD might be on a different file system than
+ * ProfLD) we'll just discard them.
+ */
+ migrateToVersion3: function Migrator_migrateToVersion3() {
+ let local = FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY], true);
let roaming = FileUtils.getDir("ProfD", [THUMBNAIL_DIRECTORY]);
- if (!roaming.equals(local) && roaming.exists()) {
- roaming.followLinks = false;
- try {
- roaming.remove(true);
- } catch (e) {
- // The directory might not exist or we're not permitted to remove it.
- }
- }
- },
-
- renameThumbnailsFolder: function Migrator_renameThumbnailsFolder() {
- let dir = FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY]);
- try {
- dir.moveTo(null, dir.leafName + "-old");
- } catch (e) {
- // The directory might not exist or we're not permitted to rename it.
+ if (!roaming.equals(local)) {
+ PageThumbsWorker.postMessage({
+ type: "moveOrDeleteAllThumbnails",
+ from: roaming.path,
+ to: local.path
+ });
}
}
};
let PageThumbsExpiration = {
_filters: [],
init: function Expiration_init() {
diff --git a/browser/components/thumbnails/PageThumbsWorker.js b/browser/components/thumbnails/PageThumbsWorker.js
--- a/browser/components/thumbnails/PageThumbsWorker.js
+++ b/browser/components/thumbnails/PageThumbsWorker.js
@@ -20,16 +20,19 @@ let PageThumbsWorker = {
switch (msg.type) {
case "removeFile":
data.result = this.removeFile(msg);
break;
case "expireFilesInDirectory":
data.result = this.expireFilesInDirectory(msg);
break;
+ case "moveOrDeleteAllThumbnails":
+ data.result = this.moveOrDeleteAllThumbnails(msg);
+ break;
default:
data.result = false;
data.detail = "message not understood";
break;
}
self.postMessage(data);
},
@@ -62,12 +65,35 @@ let PageThumbsWorker = {
getFileEntriesInDirectory:
function Worker_getFileEntriesInDirectory(aPath, aSkipFiles) {
let skip = new Set(aSkipFiles);
let iter = new OS.File.DirectoryIterator(aPath);
return [entry
for (entry in iter)
if (!entry.isDir && !entry.isSymLink && !skip.has(entry.name))];
+ },
+
+ moveOrDeleteAllThumbnails:
+ function Worker_moveOrDeleteAllThumbnails(msg) {
+ if (!OS.File.exists(msg.from))
+ return true;
+
+ let iter = new OS.File.DirectoryIterator(msg.from);
+ for (let entry in iter) {
+ if (!entry.isDir && !entry.isSymLink) {
+ let from = OS.Path.join(msg.from, entry.name);
+ let to = OS.Path.join(msg.to, entry.name);
+
+ try {
+ OS.File.move(from, to, {noOverwrite: true, noCopy: true});
+ } catch (e) {
+ OS.File.remove(from);
+ }
+ }
+ }
+
+ OS.File.removeEmptyDir(msg.from);
+ return true;
}
};
self.onmessage = PageThumbsWorker.handleMessage.bind(PageThumbsWorker);

15
mozilla-639554.patch Normal file
View file

@ -0,0 +1,15 @@
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -621,10 +621,12 @@ ifdef INSTALL_SDK # Here comes the hard
(cd $(DESTDIR)$(idldir) && tar -xf -)
# SDK directory is the libs + a bunch of symlinks
$(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib
+ $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/bin
if test -f $(DIST)/include/xpcom-config.h; then \
$(SYSINSTALL) $(IFLAGS1) $(DIST)/include/xpcom-config.h $(DESTDIR)$(sdkdir); \
fi
(cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -)
+ (cd $(DIST)/sdk/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/bin && tar -xf -)
$(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl
ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib
ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin

46
mozilla-791626.patch Normal file
View file

@ -0,0 +1,46 @@
# HG changeset patch
# Parent 3523e7f7a89d7933c5f1dc8f5f22559b48ec44c4
diff --git a/netwerk/base/src/nsIOService.cpp b/netwerk/base/src/nsIOService.cpp
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -818,17 +818,18 @@ nsIOService::PrefsChanged(nsIPrefBranch
if (NS_SUCCEEDED(rv)) {
if (mSocketTransportService)
mSocketTransportService->SetAutodialEnabled(enableAutodial);
}
}
if (!pref || strcmp(pref, MANAGE_OFFLINE_STATUS_PREF) == 0) {
bool manage;
- if (NS_SUCCEEDED(prefs->GetBoolPref(MANAGE_OFFLINE_STATUS_PREF,
+ if (mNetworkLinkServiceInitialized &&
+ NS_SUCCEEDED(prefs->GetBoolPref(MANAGE_OFFLINE_STATUS_PREF,
&manage)))
SetManageOfflineStatus(manage);
}
if (!pref || strcmp(pref, NECKO_BUFFER_CACHE_COUNT_PREF) == 0) {
int32_t count;
if (NS_SUCCEEDED(prefs->GetIntPref(NECKO_BUFFER_CACHE_COUNT_PREF,
&count)))
@@ -928,16 +929,20 @@ nsIOService::Observe(nsISupports *subjec
}
else if (!strcmp(topic, kProfileDoChange)) {
if (data && NS_LITERAL_STRING("startup").Equals(data)) {
// Lazy initialization of network link service (see bug 620472)
InitializeNetworkLinkService();
// Set up the initilization flag regardless the actuall result.
// If we fail here, we will fail always on.
mNetworkLinkServiceInitialized = true;
+ // And now reflect the preference setting
+ nsCOMPtr<nsIPrefBranch> prefBranch;
+ GetPrefBranch(getter_AddRefs(prefBranch));
+ PrefsChanged(prefBranch, MANAGE_OFFLINE_STATUS_PREF);
}
}
else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
// Remember we passed XPCOM shutdown notification to prevent any
// changes of the offline status from now. We must not allow going
// online after this point.
mShutdown = true;

23
mozilla-build.patch Normal file
View file

@ -0,0 +1,23 @@
diff -up mozilla-aurora-7676a9a06403/security/build/Makefile.in.build mozilla-aurora-7676a9a06403/security/build/Makefile.in
--- mozilla-aurora-7676a9a06403/security/build/Makefile.in.build 2012-09-13 14:18:35.000000000 +0200
+++ mozilla-aurora-7676a9a06403/security/build/Makefile.in 2012-09-18 10:58:45.560063613 +0200
@@ -139,7 +139,6 @@ DEFAULT_GMAKE_FLAGS += NSPR_INCLUDE_DIR=
DEFAULT_GMAKE_FLAGS += NSPR_LIB_DIR=$(NSPR_LIB_DIR)
DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
-DEFAULT_GMAKE_FLAGS += NSS_ENABLE_ECC=1
DEFAULT_GMAKE_FLAGS += NSINSTALL="$(NSINSTALL)"
ifndef MOZ_NATIVE_SQLITE
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
diff -up mozilla-aurora-7676a9a06403/security/manager/Makefile.in.build mozilla-aurora-7676a9a06403/security/manager/Makefile.in
diff -up mozilla-aurora-7676a9a06403/security/manager/ssl/src/Makefile.in.build mozilla-aurora-7676a9a06403/security/manager/ssl/src/Makefile.in
--- mozilla-aurora-7676a9a06403/security/manager/ssl/src/Makefile.in.build 2012-09-13 14:18:35.000000000 +0200
+++ mozilla-aurora-7676a9a06403/security/manager/ssl/src/Makefile.in 2012-09-18 10:54:16.310505794 +0200
@@ -84,7 +84,6 @@ CSRCS += md4.c
EXTRA_DEPS = $(NSS_DEP_LIBS)
DEFINES += \
- -DNSS_ENABLE_ECC \
-DDLL_PREFIX=\"$(DLL_PREFIX)\" \
-DDLL_SUFFIX=\"$(DLL_SUFFIX)\" \
$(NULL)

13
rhbz-304121.patch Normal file
View file

@ -0,0 +1,13 @@
diff -up firefox-18.0/mozilla-release/media/webrtc/trunk/Makefile.old firefox-18.0/mozilla-release/media/webrtc/trunk/Makefile
diff -up firefox-18.0/mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py.old firefox-18.0/mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py
--- firefox-18.0/mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py.old 2013-01-05 00:44:41.000000000 +0100
+++ firefox-18.0/mozilla-release/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/mozmake.py 2013-01-10 14:48:58.418321640 +0100
@@ -376,7 +376,7 @@ class MakefileGenerator(object):
WriteMakefile(output_file, data, build_file, depth, top,
# we set srcdir up one directory, since the subdir
# doesn't actually exist in the source directory
- swapslashes(os.path.join(top, self.relative_srcdir, os.path.split(rel_path)[0])),
+ swapslashes(os.path.normpath(os.path.join(top, self.relative_srcdir, os.path.split(rel_path)[0]))),
self.relative_srcdir)
return True

547
rhbz-911314.patch Normal file
View file

@ -0,0 +1,547 @@
Use the runtime page size to control arena decommit (RHBZ#911314)
Return success when decommit is disabled
Author: Gustavo Luiz Duarte <gustavold@linux.vnet.ibm.com>
Based on Terrence Cole's patch v0 on MOZ#840242
Index: mozilla-release/js/src/gc/Heap.h
===================================================================
--- mozilla-release.orig/js/src/gc/Heap.h
+++ mozilla-release/js/src/gc/Heap.h
@@ -800,7 +800,7 @@ struct Chunk
/* Search for a decommitted arena to allocate. */
unsigned findDecommittedArenaOffset();
- ArenaHeader* fetchNextDecommittedArena();
+ ArenaHeader* fetchNextDecommittedArena(JSRuntime *rt);
public:
/* Unlink and return the freeArenasHead. */
Index: mozilla-release/js/src/gc/Memory.cpp
===================================================================
--- mozilla-release.orig/js/src/gc/Memory.cpp
+++ mozilla-release/js/src/gc/Memory.cpp
@@ -8,6 +8,7 @@
#include "mozilla/Assertions.h"
#include "jstypes.h"
+#include "jscntxt.h"
#include "js/Utility.h"
#include "gc/Memory.h"
@@ -19,39 +20,34 @@ namespace gc {
extern const size_t PageSize;
extern const size_t ArenaSize;
static bool
-DecommitEnabled()
+DecommitEnabled(JSRuntime *rt)
{
- return PageSize == ArenaSize;
+ return rt->gcSystemPageSize == ArenaSize;
}
#if defined(XP_WIN)
#include "jswin.h"
#include <psapi.h>
-static size_t AllocationGranularity = 0;
-
void
-InitMemorySubsystem()
+InitMemorySubsystem(JSRuntime *rt)
{
SYSTEM_INFO sysinfo;
GetSystemInfo(&sysinfo);
- if (sysinfo.dwPageSize != PageSize) {
- fprintf(stderr,"SpiderMonkey compiled with incorrect page size; please update js/public/HeapAPI.h.\n");
- MOZ_CRASH();
- }
- AllocationGranularity = sysinfo.dwAllocationGranularity;
+ rt->gcSystemPageSize = sysinfo.dwPageSize;
+ rt->gcSystemAllocGranularity = sysinfo.dwAllocationGranularity;
}
void *
-MapAlignedPages(size_t size, size_t alignment)
+MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
{
JS_ASSERT(size >= alignment);
JS_ASSERT(size % alignment == 0);
- JS_ASSERT(size % PageSize == 0);
- JS_ASSERT(alignment % AllocationGranularity == 0);
+ JS_ASSERT(size % rt->gcSystemPageSize == 0);
+ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
/* Special case: If we want allocation alignment, no further work is needed. */
- if (alignment == AllocationGranularity) {
+ if (alignment == rt->gcSystemAllocGranularity) {
return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
}
@@ -75,7 +71,7 @@ MapAlignedPages(size_t size, size_t alig
if (!p)
return NULL;
void *chunkStart = (void *)(uintptr_t(p) + (alignment - (uintptr_t(p) % alignment)));
- UnmapPages(p, size * 2);
+ UnmapPages(rt, p, size * 2);
p = VirtualAlloc(chunkStart, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
/* Failure here indicates a race with another thread, so try again. */
@@ -86,26 +82,26 @@ MapAlignedPages(size_t size, size_t alig
}
void
-UnmapPages(void *p, size_t size)
+UnmapPages(JSRuntime *rt, void *p, size_t size)
{
JS_ALWAYS_TRUE(VirtualFree(p, 0, MEM_RELEASE));
}
bool
-MarkPagesUnused(void *p, size_t size)
+MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
{
- if (!DecommitEnabled())
- return false;
+ if (!DecommitEnabled(rt))
+ return true;
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
LPVOID p2 = VirtualAlloc(p, size, MEM_RESET, PAGE_READWRITE);
return p2 == p;
}
bool
-MarkPagesInUse(void *p, size_t size)
+MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
@@ -127,12 +123,13 @@ GetPageFaultCount()
#define OS2_MAX_RECURSIONS 16
void
-InitMemorySubsystem()
+InitMemorySubsystem(JSRuntime *rt)
{
+ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = ArenaSize;
}
void
-UnmapPages(void *addr, size_t size)
+UnmapPages(JSRuntime *rt, void *addr, size_t size)
{
if (!DosFreeMem(addr))
return;
@@ -153,7 +150,7 @@ UnmapPages(void *addr, size_t size)
}
static void *
-MapAlignedPagesRecursively(size_t size, size_t alignment, int& recursions)
+MapAlignedPagesRecursively(JSRuntime *rt, size_t size, size_t alignment, int& recursions)
{
if (++recursions >= OS2_MAX_RECURSIONS)
return NULL;
@@ -179,7 +176,7 @@ MapAlignedPagesRecursively(size_t size,
unsigned long rc = DosQueryMem(&(static_cast<char*>(tmp))[size],
&cb, &flags);
if (!rc && (flags & PAG_FREE) && cb >= filler) {
- UnmapPages(tmp, 0);
+ UnmapPages(rt, tmp, 0);
if (DosAllocMem(&tmp, filler,
OBJ_ANY | PAG_COMMIT | PAG_READ | PAG_WRITE)) {
JS_ALWAYS_TRUE(DosAllocMem(&tmp, filler,
@@ -187,19 +184,19 @@ MapAlignedPagesRecursively(size_t size,
}
}
- void *p = MapAlignedPagesRecursively(size, alignment, recursions);
- UnmapPages(tmp, 0);
+ void *p = MapAlignedPagesRecursively(rt, size, alignment, recursions);
+ UnmapPages(rt, tmp, 0);
return p;
}
void *
-MapAlignedPages(size_t size, size_t alignment)
+MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
{
JS_ASSERT(size >= alignment);
JS_ASSERT(size % alignment == 0);
- JS_ASSERT(size % PageSize == 0);
- JS_ASSERT(alignment % PageSize == 0);
+ JS_ASSERT(size % rt->gcSystemPageSize == 0);
+ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
int recursions = -1;
@@ -208,7 +205,7 @@ MapAlignedPages(size_t size, size_t alig
* of the right size by recursively allocating blocks of unaligned
* free memory until only an aligned allocation is possible.
*/
- void *p = MapAlignedPagesRecursively(size, alignment, recursions);
+ void *p = MapAlignedPagesRecursively(rt, size, alignment, recursions);
if (p)
return p;
@@ -230,16 +227,15 @@ MapAlignedPages(size_t size, size_t alig
}
bool
-MarkPagesUnused(void *p, size_t size)
-{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+MarkPagesUnused(JSRuntime *rt, void *p, size_t size) {
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
bool
-MarkPagesInUse(void *p, size_t size)
+MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
@@ -259,17 +255,18 @@ GetPageFaultCount()
#endif
void
-InitMemorySubsystem()
+InitMemorySubsystem(JSRuntime *rt)
{
+ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = size_t(sysconf(_SC_PAGESIZE));
}
void *
-MapAlignedPages(size_t size, size_t alignment)
+MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
{
JS_ASSERT(size >= alignment);
JS_ASSERT(size % alignment == 0);
- JS_ASSERT(size % PageSize == 0);
- JS_ASSERT(alignment % PageSize == 0);
+ JS_ASSERT(size % rt->gcSystemPageSize == 0);
+ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
int prot = PROT_READ | PROT_WRITE;
int flags = MAP_PRIVATE | MAP_ANON | MAP_ALIGN | MAP_NOSYNC;
@@ -281,22 +278,22 @@ MapAlignedPages(size_t size, size_t alig
}
void
-UnmapPages(void *p, size_t size)
+UnmapPages(JSRuntime *rt, void *p, size_t size)
{
JS_ALWAYS_TRUE(0 == munmap((caddr_t)p, size));
}
bool
-MarkPagesUnused(void *p, size_t size)
+MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
bool
-MarkPagesInUse(void *p, size_t size)
+MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
@@ -314,27 +311,24 @@ GetPageFaultCount()
#include <unistd.h>
void
-InitMemorySubsystem()
+InitMemorySubsystem(JSRuntime *rt)
{
- if (size_t(sysconf(_SC_PAGESIZE)) != PageSize) {
- fprintf(stderr,"SpiderMonkey compiled with incorrect page size; please update js/public/HeapAPI.h.\n");
- MOZ_CRASH();
- }
+ rt->gcSystemPageSize = rt->gcSystemAllocGranularity = size_t(sysconf(_SC_PAGESIZE));
}
void *
-MapAlignedPages(size_t size, size_t alignment)
+MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment)
{
JS_ASSERT(size >= alignment);
JS_ASSERT(size % alignment == 0);
- JS_ASSERT(size % PageSize == 0);
- JS_ASSERT(alignment % PageSize == 0);
+ JS_ASSERT(size % rt->gcSystemPageSize == 0);
+ JS_ASSERT(alignment % rt->gcSystemAllocGranularity == 0);
int prot = PROT_READ | PROT_WRITE;
int flags = MAP_PRIVATE | MAP_ANON;
/* Special case: If we want page alignment, no further work is needed. */
- if (alignment == PageSize) {
+ if (alignment == rt->gcSystemAllocGranularity) {
return mmap(NULL, size, prot, flags, -1, 0);
}
@@ -360,26 +354,26 @@ MapAlignedPages(size_t size, size_t alig
}
void
-UnmapPages(void *p, size_t size)
+UnmapPages(JSRuntime *rt, void *p, size_t size)
{
JS_ALWAYS_TRUE(0 == munmap(p, size));
}
bool
-MarkPagesUnused(void *p, size_t size)
+MarkPagesUnused(JSRuntime *rt, void *p, size_t size)
{
- if (!DecommitEnabled())
- return false;
+ if (!DecommitEnabled(rt))
+ return true;
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
int result = madvise(p, size, MADV_DONTNEED);
return result != -1;
}
bool
-MarkPagesInUse(void *p, size_t size)
+MarkPagesInUse(JSRuntime *rt, void *p, size_t size)
{
- JS_ASSERT(uintptr_t(p) % PageSize == 0);
+ JS_ASSERT(uintptr_t(p) % rt->gcSystemPageSize == 0);
return true;
}
Index: mozilla-release/js/src/gc/Memory.h
===================================================================
--- mozilla-release.orig/js/src/gc/Memory.h
+++ mozilla-release/js/src/gc/Memory.h
@@ -16,20 +16,20 @@ namespace gc {
// Sanity check that our compiled configuration matches the currently running
// instance and initialize any runtime data needed for allocation.
-void InitMemorySubsystem();
+void InitMemorySubsystem(JSRuntime *rt);
// Allocate or deallocate pages from the system with the given alignment.
-void *MapAlignedPages(size_t size, size_t alignment);
-void UnmapPages(void *p, size_t size);
+void *MapAlignedPages(JSRuntime *rt, size_t size, size_t alignment);
+void UnmapPages(JSRuntime *rt, void *p, size_t size);
// Tell the OS that the given pages are not in use, so they should not
// be written to a paging file. This may be a no-op on some platforms.
-bool MarkPagesUnused(void *p, size_t size);
+bool MarkPagesUnused(JSRuntime *rt, void *p, size_t size);
// Undo |MarkPagesUnused|: tell the OS that the given pages are of interest
// and should be paged in and out normally. This may be a no-op on some
// platforms.
-bool MarkPagesInUse(void *p, size_t size);
+bool MarkPagesInUse(JSRuntime *rt, void *p, size_t size);
// Returns #(hard faults) + #(soft faults)
size_t GetPageFaultCount();
Index: mozilla-release/js/src/jsapi.cpp
===================================================================
--- mozilla-release.orig/js/src/jsapi.cpp
+++ mozilla-release/js/src/jsapi.cpp
@@ -1105,8 +1105,6 @@ JS_NewRuntime(uint32_t maxbytes, JSUseHe
#undef MSG_DEF
#endif /* DEBUG */
- InitMemorySubsystem();
-
if (!js::TlsPerThreadData.init())
return NULL;
Index: mozilla-release/js/src/jscntxt.h
===================================================================
--- mozilla-release.orig/js/src/jscntxt.h
+++ mozilla-release/js/src/jscntxt.h
@@ -847,6 +847,15 @@ struct JSRuntime : js::RuntimeFriendFiel
/* Stack of thread-stack-allocated GC roots. */
js::AutoGCRooter *autoGCRooters;
+ /*
+ * The GC can only safely decommit memory when the page size of the
+ * running process matches the compiled arena size.
+ */
+ size_t gcSystemPageSize;
+
+ /* The OS allocation granularity may not match the page size. */
+ size_t gcSystemAllocGranularity;
+
/* Strong references on scripts held for PCCount profiling API. */
js::ScriptAndCountsVector *scriptAndCountsVector;
Index: mozilla-release/js/src/jsgc.cpp
===================================================================
--- mozilla-release.orig/js/src/jsgc.cpp
+++ mozilla-release/js/src/jsgc.cpp
@@ -486,13 +486,13 @@ FinalizeArenas(FreeOp *fop,
}
static inline Chunk *
-AllocChunk() {
- return static_cast<Chunk *>(MapAlignedPages(ChunkSize, ChunkSize));
+AllocChunk(JSRuntime *rt) {
+ return static_cast<Chunk *>(MapAlignedPages(rt, ChunkSize, ChunkSize));
}
static inline void
-FreeChunk(Chunk *p) {
- UnmapPages(static_cast<void *>(p), ChunkSize);
+FreeChunk(JSRuntime *rt, Chunk *p) {
+ UnmapPages(rt, static_cast<void *>(p), ChunkSize);
}
inline bool
@@ -582,25 +582,25 @@ ChunkPool::expire(JSRuntime *rt, bool re
}
static void
-FreeChunkList(Chunk *chunkListHead)
+FreeChunkList(JSRuntime *rt, Chunk *chunkListHead)
{
while (Chunk *chunk = chunkListHead) {
JS_ASSERT(!chunk->info.numArenasFreeCommitted);
chunkListHead = chunk->info.next;
- FreeChunk(chunk);
+ FreeChunk(rt, chunk);
}
}
void
ChunkPool::expireAndFree(JSRuntime *rt, bool releaseAll)
{
- FreeChunkList(expire(rt, releaseAll));
+ FreeChunkList(rt, expire(rt, releaseAll));
}
/* static */ Chunk *
Chunk::allocate(JSRuntime *rt)
{
- Chunk *chunk = static_cast<Chunk *>(AllocChunk());
+ Chunk *chunk = static_cast<Chunk *>(AllocChunk(rt));
#ifdef JSGC_ROOT_ANALYSIS
// Our poison pointers are not guaranteed to be invalid on 64-bit
@@ -613,7 +613,7 @@ Chunk::allocate(JSRuntime *rt)
// were marked as uncommitted, but it's a little complicated to avoid
// clobbering pre-existing unrelated mappings.
while (IsPoisonedPtr(chunk))
- chunk = static_cast<Chunk *>(AllocChunk());
+ chunk = static_cast<Chunk *>(AllocChunk(rt));
#endif
if (!chunk)
@@ -629,7 +629,7 @@ Chunk::release(JSRuntime *rt, Chunk *chu
{
JS_ASSERT(chunk);
chunk->prepareToBeFreed(rt);
- FreeChunk(chunk);
+ FreeChunk(rt, chunk);
}
inline void
@@ -745,7 +745,7 @@ Chunk::findDecommittedArenaOffset()
}
ArenaHeader *
-Chunk::fetchNextDecommittedArena()
+Chunk::fetchNextDecommittedArena(JSRuntime *rt)
{
JS_ASSERT(info.numArenasFreeCommitted == 0);
JS_ASSERT(info.numArenasFree > 0);
@@ -756,7 +756,7 @@ Chunk::fetchNextDecommittedArena()
decommittedArenas.unset(offset);
Arena *arena = &arenas[offset];
- MarkPagesInUse(arena, ArenaSize);
+ MarkPagesInUse(rt, arena, ArenaSize);
arena->aheader.setAsNotAllocated();
return &arena->aheader;
@@ -790,7 +790,7 @@ Chunk::allocateArena(JSCompartment *comp
ArenaHeader *aheader = JS_LIKELY(info.numArenasFreeCommitted > 0)
? fetchNextFreeArena(rt)
- : fetchNextDecommittedArena();
+ : fetchNextDecommittedArena(rt);
aheader->init(comp, thingKind);
if (JS_UNLIKELY(!hasAvailableArenas()))
removeFromAvailableList();
@@ -893,6 +893,8 @@ static const int64_t JIT_SCRIPT_RELEASE_
JSBool
js_InitGC(JSRuntime *rt, uint32_t maxbytes)
{
+ InitMemorySubsystem(rt);
+
if (!rt->gcChunkSet.init(INITIAL_CHUNK_CAPACITY))
return false;
@@ -2745,7 +2747,7 @@ DecommitArenasFromAvailableList(JSRuntim
Maybe<AutoUnlockGC> maybeUnlock;
if (!rt->isHeapBusy())
maybeUnlock.construct(rt);
- ok = MarkPagesUnused(aheader->getArena(), ArenaSize);
+ ok = MarkPagesUnused(rt, aheader->getArena(), ArenaSize);
}
if (ok) {
@@ -2813,7 +2815,7 @@ ExpireChunksAndArenas(JSRuntime *rt, boo
{
if (Chunk *toFree = rt->gcChunkPool.expire(rt, shouldShrink)) {
AutoUnlockGC unlock(rt);
- FreeChunkList(toFree);
+ FreeChunkList(rt, toFree);
}
if (shouldShrink)
Index: mozilla-release/js/public/HeapAPI.h
===================================================================
--- mozilla-release.orig/js/public/HeapAPI.h
+++ mozilla-release/js/public/HeapAPI.h
@@ -11,24 +11,7 @@
namespace js {
namespace gc {
-/*
- * Page size must be static to support our arena pointer optimizations, so we
- * are forced to support each platform with non-4096 pages as a special case.
- * Note: The freelist supports a maximum arena shift of 15.
- * Note: Do not use JS_CPU_SPARC here, this header is used outside JS.
- */
-#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
- (defined(__sparc) || defined(__sparcv9) || defined(__ia64))
-const size_t PageShift = 13;
-const size_t ArenaShift = PageShift;
-#elif defined(__powerpc64__)
-const size_t PageShift = 16;
const size_t ArenaShift = 12;
-#else
-const size_t PageShift = 12;
-const size_t ArenaShift = PageShift;
-#endif
-const size_t PageSize = size_t(1) << PageShift;
const size_t ArenaSize = size_t(1) << ArenaShift;
const size_t ArenaMask = ArenaSize - 1;

1
sources Normal file
View file

@ -0,0 +1 @@
de09d603c3b768a1698d90141f3b2644 firefox-19.0.2.source.tar.bz2

View file

@ -0,0 +1,13 @@
diff -up xulrunner-15.0/mozilla-beta/toolkit/crashreporter/client/Makefile.in.gcc47 xulrunner-15.0/mozilla-beta/toolkit/crashreporter/client/Makefile.in
--- xulrunner-15.0/mozilla-beta/toolkit/crashreporter/client/Makefile.in.gcc47 2012-08-15 07:48:31.000000000 +0200
+++ xulrunner-15.0/mozilla-beta/toolkit/crashreporter/client/Makefile.in 2012-08-20 15:05:41.782947739 +0200
@@ -34,6 +34,9 @@ CPPSRCS = \
crashreporter.cpp \
$(NULL)
+# Needed for moz_free
+LIBS += -L$(LIBXUL_DIST)/lib -lmozalloc
+
ifeq ($(OS_ARCH),WINNT)
CPPSRCS += crashreporter_win.cpp
LIBS += \

View file

@ -0,0 +1,14 @@
Index: xulrunner-11.0/mozilla-release/memory/jemalloc/jemalloc.c
===================================================================
--- xulrunner-11.0.orig/mozilla-release/memory/mozjemalloc/jemalloc.c
+++ xulrunner-11.0/mozilla-release/memory/mozjemalloc/jemalloc.c
@@ -1089,7 +1089,9 @@ static unsigned ncpus;
* controlling the malloc behavior are defined as compile-time constants
* for best performance and cannot be altered at runtime.
*/
+#if !(defined(__powerpc__))
#define MALLOC_STATIC_SIZES 1
+#endif
#ifdef MALLOC_STATIC_SIZES

View file

@ -0,0 +1,31 @@
diff -up xulrunner-17.0/mozilla-release/gfx/ycbcr/chromium_types.h.chromium-types xulrunner-17.0/mozilla-release/gfx/ycbcr/chromium_types.h
--- xulrunner-17.0/mozilla-release/gfx/ycbcr/chromium_types.h.chromium-types 2012-11-16 20:56:29.000000000 +0100
+++ xulrunner-17.0/mozilla-release/gfx/ycbcr/chromium_types.h 2012-11-20 09:19:14.843448418 +0100
@@ -30,7 +30,11 @@ typedef int16_t int16;
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
-#elif defined(__ppc__) || defined(__powerpc) || defined(__PPC__)
+#elif defined(__powerpc64__)
+#define ARCH_CPU_PPC_FAMILY 1
+#define ARCH_CPU_PPC 1
+#define ARCH_CPU_64_BITS 1
+#elif defined(__ppc__) || defined(__powerpc__) || defined(__PPC__)
#define ARCH_CPU_PPC_FAMILY 1
#define ARCH_CPU_PPC 1
#define ARCH_CPU_32_BITS 1
@@ -42,6 +46,14 @@ typedef int16_t int16;
#define ARCH_CPU_SPARC_FAMILY 1
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_64_BITS 1
+#elif defined(__s390x__)
+#define ARCH_CPU_S390_FAMILY 1
+#define ARCH_CPU_S390 1
+#define ARCH_CPU_64_BITS 1
+#elif defined(__s390__)
+#define ARCH_CPU_S390_FAMILY 1
+#define ARCH_CPU_S390 1
+#define ARCH_CPU_32_BITS 1
#else
#warning Please add support for your architecture in chromium_types.h
#endif

View file

@ -0,0 +1,23 @@
diff -up mozilla-aurora-7676a9a06403/config/baseconfig.mk.dir mozilla-aurora-7676a9a06403/config/baseconfig.mk
--- mozilla-aurora-7676a9a06403/config/baseconfig.mk.dir 2012-09-13 14:18:35.000000000 +0200
+++ mozilla-aurora-7676a9a06403/config/baseconfig.mk 2012-09-26 10:13:45.258240426 +0200
@@ -2,7 +2,7 @@ INCLUDED_AUTOCONF_MK = 1
includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+installdir = $(libdir)/$(MOZ_APP_NAME)
sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
DIST = $(DEPTH)/dist
diff -up mozilla-aurora-7676a9a06403/js/src/config/baseconfig.mk.dir mozilla-aurora-7676a9a06403/js/src/config/baseconfig.mk
--- mozilla-aurora-7676a9a06403/js/src/config/baseconfig.mk.dir 2012-09-13 14:18:35.000000000 +0200
+++ mozilla-aurora-7676a9a06403/js/src/config/baseconfig.mk 2012-09-26 10:14:07.353351833 +0200
@@ -1,6 +1,6 @@
INCLUDED_AUTOCONF_MK = 1
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
+installdir = $(libdir)/$(MOZ_APP_NAME)
sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
ifneq (,$(filter /%,$(TOP_DIST)))

43
xulrunner-mozconfig Normal file
View file

@ -0,0 +1,43 @@
. $topsrcdir/xulrunner/config/mozconfig
# --with-system-png is disabled because Mozilla requires APNG support in libpng
#ac_add_options --with-system-png
ac_add_options --prefix="$PREFIX"
ac_add_options --libdir="$LIBDIR"
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-libvpx
ac_add_options --enable-system-hunspell
ac_add_options --with-pthreads
ac_add_options --disable-strip
ac_add_options --disable-tests
ac_add_options --disable-mochitest
ac_add_options --disable-installer
ac_add_options --enable-xinerama
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-pango
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-javaxpcom
ac_add_options --disable-crashreporter
ac_add_options --enable-safe-browsing
ac_add_options --enable-extensions=default
ac_add_options --enable-libnotify
ac_add_options --disable-necko-wifi
ac_add_options --enable-startup-notification
ac_add_options --disable-cpp-exceptions
ac_add_options --enable-shared-js
ac_add_options --enable-url-classifier
ac_add_options --enable-gio
ac_add_options --disable-gnomevfs
ac_add_options --disable-updater
ac_add_options --enable-chrome-format=omni
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_UA_BUILDID=20100101
mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir

View file

@ -0,0 +1,5 @@
# For mozilla's debuginfo:
export CFLAGS="$CFLAGS -gdwarf-2"
export CXXFLAGS="$CXXFLAGS -gdwarf-2"
export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-crashreporter

View file

@ -0,0 +1,8 @@
pref("app.update.enabled", false);
pref("app.update.autoInstallEnabled", false);
pref("general.smoothScroll", true);
pref("intl.locale.matchOS", true);
pref("network.manage-offline-status", true);
pref("toolkit.storage.synchronous", 0);
pref("toolkit.networkmanager.disable", false);
pref("offline.autoDetect", true);

69
xulrunner.sh.in Normal file
View file

@ -0,0 +1,69 @@
#!/bin/sh
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
##
## Usage:
##
## $ xulrunner
##
## This script is meant to run a xulrunner program from the xulrunner
## rpm installation.
##
cmdname=`basename $0`
##
## Variables
##
XUL_ARCH=$(uname -m)
case $XUL_ARCH in
x86_64 | ia64 | s390 )
XUL_LIB_DIR="/usr/lib64"
SECONDARY_LIB_DIR="/usr/lib"
;;
* )
XUL_LIB_DIR="/usr/lib"
SECONDARY_LIB_DIR="/usr/lib64"
;;
esac
if [ ! -x $XUL_LIB_DIR/xulrunner/xulrunner ]; then
if [ ! -x $SECONDARY_LIB_DIR/xulrunner/xulrunner ]; then
echo "Error: $XUL_LIB_DIR/xulrunner/xulrunner not found"
if [ -d $SECONDARY_LIB_DIR ]; then
echo " $SECONDARY_LIB_DIR/xulrunner/xulrunner not found"
fi
exit 1
fi
XUL_LIB_DIR="$SECONDARY_LIB_DIR"
fi
XUL_DIST_BIN="$XUL_LIB_DIR/xulrunner"
XUL_PROGRAM="$XUL_DIST_BIN/xulrunner"
##
## Enable WebGL
##
MOZ_GLX_IGNORE_BLACKLIST=1
export MOZ_GLX_IGNORE_BLACKLIST
exec $XUL_PROGRAM "$@"

1331
xulrunner.spec Normal file

File diff suppressed because it is too large Load diff