mozilla-bmo1512162.patch
author Wolfgang Rosenauer <wr@rosenauer.org>
Tue, 02 Nov 2021 13:21:17 +0100
branchfirefox91
changeset 1167 7852ceef239b
parent 1152 4cfe46c9a944
permissions -rw-r--r--
Firefox 91.2.0esr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1109
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     1
# HG changeset patch
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
     2
# Parent  f9f5af4c88f2f3172a4f30d7e42bd2131bf24146
1109
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     3
This fixes a broken build for gcc < 9 on ppc64le.
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     4
This patch can be removed for newer gcc-versions.
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
     5
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
     6
diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
     7
--- a/js/xpconnect/src/XPCWrappedNative.cpp
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
     8
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
     9
@@ -1072,17 +1072,21 @@ class MOZ_STACK_CLASS CallMethodHelper f
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    10
                                                uint32_t* result);
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    11
 
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    12
   MOZ_ALWAYS_INLINE bool GetInterfaceTypeFromParam(const nsXPTType& type,
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    13
                                                    nsID* result) const;
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    14
 
1109
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    15
   MOZ_ALWAYS_INLINE bool GetOutParamSource(uint8_t paramIndex,
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    16
                                            MutableHandleValue srcp) const;
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    17
 
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    18
-  MOZ_ALWAYS_INLINE bool GatherAndConvertResults();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    19
+#if !(__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    20
+// Work around a compiler bug on ppc64le (bug 1512162).
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    21
+  MOZ_ALWAYS_INLINE
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    22
+#endif
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    23
+  bool GatherAndConvertResults();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    24
 
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    25
   MOZ_ALWAYS_INLINE bool QueryInterfaceFastPath();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    26
 
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    27
   nsXPTCVariant* GetDispatchParam(uint8_t paramIndex) {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    28
     if (paramIndex >= mJSContextIndex) {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    29
       paramIndex += 1;
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    30
     }
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    31
     if (paramIndex >= mOptArgcIndex) {
1152
4cfe46c9a944 Firefox 84.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1123
diff changeset
    32
@@ -1119,17 +1123,21 @@ class MOZ_STACK_CLASS CallMethodHelper f
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    33
 
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    34
   {
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    35
     // Success checked later.
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    36
     mIFaceInfo->GetMethodInfo(mVTableIndex, &mMethodInfo);
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    37
   }
1109
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    38
 
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    39
   ~CallMethodHelper();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    40
 
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    41
-  MOZ_ALWAYS_INLINE bool Call();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    42
+#if !(__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    43
+// Work around a compiler bug on ppc64le (bug 1512162).
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    44
+  MOZ_ALWAYS_INLINE
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    45
+#endif
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    46
+  bool Call();
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    47
 
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    48
   // Trace implementation so we can put our CallMethodHelper in a Rooted<T>.
972f68ac6b1a Firefox 69.0 as released to Factory/Tumbleweed
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
diff changeset
    49
   void trace(JSTracer* aTrc);
1123
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    50
 };
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    51
 
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    52
 // static
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    53
 bool XPCWrappedNative::CallMethod(XPCCallContext& ccx,
7fa561e5d7c7 Firefox 74.0
Wolfgang Rosenauer <wr@rosenauer.org>
parents: 1109
diff changeset
    54
                                   CallMode mode /*= CALL_METHOD */) {