Unverified Commit e11bcbb4 authored by Martin Weinelt's avatar Martin Weinelt
Browse files

buildMozillaMach: prune obsolete patches

parent 9aa5a393
Loading
Loading
Loading
Loading
+0 −57
Original line number Diff line number Diff line
From 45d40b3eeb393051bd3a49feebcefe39dc6e4e93 Mon Sep 17 00:00:00 2001
From: Peter Collingbourne <pcc@google.com>
Date: Wed, 23 Apr 2025 21:13:38 -0700
Subject: [PATCH] build: fix RELRHACK_LINKER setting when linker name is target
 triple prefixed

RELRHACK_LINKER is used as the name of a binary installed in a
directory specified with -B to override the linker. Both Clang and
GCC will only look for a binary named "ld" (or "ld.$fuse_ld_setting"
if -fuse-ld= is specified) in the -B directories, which means that
if the linker name does not follow this pattern, for example if it
is named $target_triple-ld", the relrhack linker will not be found,
the compiler will use the normal linker and the link will fail. To fix
this problem, use the correct pattern to name the relrhack executable.
---
 toolkit/moz.configure | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index 6c47287a5b..1a9c368e5e 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -1843,23 +1843,23 @@ with only_when("--enable-compile-environment"):
     use_relrhack = depends(which_elf_hack)(lambda x: x == "relr")
     set_config("RELRHACK", True, when=use_relrhack)
 
-    @depends(c_compiler, linker_ldflags, when=use_relrhack)
-    def relrhack_real_linker(c_compiler, linker_ldflags):
+    @depends(linker_ldflags, when=use_relrhack)
+    def relrhack_linker(linker_ldflags):
         ld = "ld"
         for flag in linker_ldflags:
             if flag.startswith("-fuse-ld="):
                 ld = "ld." + flag[len("-fuse-ld=") :]
+        return ld
+
+    set_config("RELRHACK_LINKER", relrhack_linker)
+
+    @depends(c_compiler, relrhack_linker, when=use_relrhack)
+    def relrhack_real_linker(c_compiler, ld):
         ld = check_cmd_output(
             c_compiler.compiler, f"--print-prog-name={ld}", *c_compiler.flags
         )
         return ld.rstrip()
 
-    @depends(relrhack_real_linker, when=use_relrhack)
-    def relrhack_linker(ld):
-        return os.path.basename(ld)
-
-    set_config("RELRHACK_LINKER", relrhack_linker)
-
     std_filesystem = host_cxx_compiler.try_run(
         header="#include <filesystem>",
         body='auto foo = std::filesystem::absolute("");',
-- 
2.49.0.805.g082f7c87e0-goog
+1 −27
Original line number Diff line number Diff line
@@ -304,15 +304,7 @@ buildStdenv.mkDerivation {
  ];

  patches =
    lib.optionals (lib.versionAtLeast version "111" && lib.versionOlder version "133") [
      ./env_var_for_system_dir-ff111.patch
    ]
    ++ lib.optionals (lib.versionAtLeast version "133") [ ./env_var_for_system_dir-ff133.patch ]
    ++ lib.optionals (lib.versionAtLeast version "121" && lib.versionOlder version "136") [
      ./no-buildconfig-ffx121.patch
    ]
    ++ lib.optionals (lib.versionAtLeast version "136") [ ./no-buildconfig-ffx136.patch ]
    ++ lib.optionals (lib.versionAtLeast version "139" && lib.versionOlder version "141") [
    lib.optionals (lib.versionAtLeast version "139" && lib.versionOlder version "141") [
      # https://bugzilla.mozilla.org/show_bug.cgi?id=1955112
      # https://hg-edge.mozilla.org/mozilla-central/rev/aa8a29bd1fb9
      ./139-wayland-drag-animation.patch
@@ -326,24 +318,6 @@ buildStdenv.mkDerivation {
        [
          ./142-relax-apple-sdk.patch
        ]
    ++ lib.optionals (lib.versionOlder version "139") [
      # Fix for missing vector header on macOS
      # https://bugzilla.mozilla.org/show_bug.cgi?id=1959377
      # Fixed on Firefox 139
      ./firefox-mac-missing-vector-header.patch
    ]
    ++ lib.optionals (lib.versionOlder version "140") [
      # https://bugzilla.mozilla.org/show_bug.cgi?id=1962497
      # https://phabricator.services.mozilla.com/D246545
      # Fixed on Firefox 140
      ./build-fix-RELRHACK_LINKER-setting-when-linker-name-i.patch
    ]
    ++ lib.optionals (lib.versionOlder version "138") [
      # https://bugzilla.mozilla.org/show_bug.cgi?id=1941479
      # https://phabricator.services.mozilla.com/D240572
      # Fixed on Firefox 138
      ./firefox-cannot-find-type-Allocator.patch
    ]
    ++ extraPatches;

  postPatch = ''
+0 −22
Original line number Diff line number Diff line
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 6db876975187..5882c5d7f1d6 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -11,6 +11,7 @@
 
 #include "jsapi.h"
 #include "xpcpublic.h"
+#include "prenv.h"
 #include "prprf.h"
 
 #include "nsIAppStartup.h"
@@ -309,7 +310,8 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
       "/usr/lib/mozilla"_ns
 #    endif
       ;
-  rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
+  const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR");
+  rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast<const nsCString&>(dirname), false, getter_AddRefs(localDir));
 #  endif
 
   if (NS_SUCCEEDED(rv)) {
+0 −22
Original line number Diff line number Diff line
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 6db876975187..5882c5d7f1d6 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -11,6 +11,7 @@
 
 #include "jsapi.h"
 #include "xpcpublic.h"
+#include "prenv.h"
 #include "prprf.h"
 
 #include "nsIAppStartup.h"
@@ -297,7 +297,8 @@ static nsresult GetSystemParentDirectory(nsIFile** aFile) {
       "/usr/lib/mozilla"_ns
 #    endif
       ;
-  rv = NS_NewNativeLocalFile(dirname, getter_AddRefs(localDir));
+  const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR");
+  rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast<const nsCString&>(dirname), getter_AddRefs(localDir));
 #  endif
 
   if (NS_SUCCEEDED(rv)) {
+0 −26
Original line number Diff line number Diff line
From 518049ce568d01413eeda304e8e9c341ab8849f6 Mon Sep 17 00:00:00 2001
From: Mike Hommey <mh+mozilla@glandium.org>
Date: Thu, 6 Mar 2025 09:36:10 +0000
Subject: [PATCH] Bug 1941479 - Mark mozilla::SmallPointerArray_Element as
 opaque. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D240572
---
 layout/style/ServoBindings.toml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml
index 86c6c3026ce7..2b9a34a81a0f 100644
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -301,6 +301,7 @@ opaque-types = [
     "mozilla::dom::Touch",
     "mozilla::dom::Sequence",
     "mozilla::SmallPointerArray",
+    "mozilla::SmallPointerArray_Element",
     "mozilla::dom::Optional",
     "mozilla::dom::OwningNodeOrString_Value",
     "mozilla::dom::Nullable",
-- 
2.49.0
Loading