diff options
author | athenian200 <athenian200@outlook.com> | 2019-10-02 19:51:00 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2019-10-21 04:53:42 -0500 |
commit | beea314ffe6c9cefeb232e9b38fcecf66154854f (patch) | |
tree | 3d7f8b703f779a89f696e0824294c8079f77e8bc /toolkit/library | |
parent | fca7c45a62542e0f625122222386cbee9b76243f (diff) | |
download | UXP-beea314ffe6c9cefeb232e9b38fcecf66154854f.tar UXP-beea314ffe6c9cefeb232e9b38fcecf66154854f.tar.gz UXP-beea314ffe6c9cefeb232e9b38fcecf66154854f.tar.lz UXP-beea314ffe6c9cefeb232e9b38fcecf66154854f.tar.xz UXP-beea314ffe6c9cefeb232e9b38fcecf66154854f.zip |
MoonchildProductions#1251 - Part 17: All the libffi and libxul.so issues, resolved.
https://bugzilla.mozilla.org/show_bug.cgi?id=1185424
http://www.mindfruit.co.uk/2012/06/relocations-relocations.html
The libxul.so fix was implemented by Mozilla in Firefox 57 and personally recommended to me by an Oracle employee on the OpenIndiana mailing list. It can easily be made ifdef XP_SOLARIS, but it seems like the new way is considered a better solution overall by the original author of the code that had it use that null pointer hack to begin with.
I can't link where I found the fix for libffi because I came up with it myself while looking at the way sysv.S does things. Something clicked in my brain while reading that mindfruit link above, though, and gave me enough of a sense of what was going on to be able to fix libffi.
The libffi fix looks a bit hairy because of all the FDE_ENCODE statements, but if you examine the code closely, you should find that it does exactly what it did before on all platforms besides Solaris. I later discovered that people who originally ported Firefox to Solaris never figured this out during the Firefox 52 era and had to use GNU LD for linking libxul.so while using the Sun LD for the rest of the build to make it work. For whatever reason, it works for me now without the GNU LD trick.
Diffstat (limited to 'toolkit/library')
-rw-r--r-- | toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp | 5 | ||||
-rw-r--r-- | toolkit/library/StaticXULComponentsStart.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp index 28fd9d484..8b5b1f4cb 100644 --- a/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp +++ b/toolkit/library/StaticXULComponentsEnd/StaticXULComponentsEnd.cpp @@ -10,4 +10,7 @@ # undef NSMODULE_SECTION # define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$Z"), dllexport) #endif -NSMODULE_DEFN(end_kPStaticModules) = nullptr; +/* This could be null, but this needs a dummy value to ensure it actually ends + * up in the same section as other NSMODULE_DEFNs, instead of being moved to a + * separate readonly section. */ +NSMODULE_DEFN(end_kPStaticModules) = (mozilla::Module*)&NSMODULE_NAME(end_kPStaticModules); diff --git a/toolkit/library/StaticXULComponentsStart.cpp b/toolkit/library/StaticXULComponentsStart.cpp index 1738aa810..d2e9a8828 100644 --- a/toolkit/library/StaticXULComponentsStart.cpp +++ b/toolkit/library/StaticXULComponentsStart.cpp @@ -1,3 +1,6 @@ #include "mozilla/Module.h" -NSMODULE_DEFN(start_kPStaticModules) = nullptr; +/* This could be null, but this needs a dummy value to ensure it actually ends + * up in the same section as other NSMODULE_DEFNs, instead of being moved to a + * separate readonly section. */ +NSMODULE_DEFN(start_kPStaticModules) = (mozilla::Module*)&NSMODULE_NAME(start_kPStaticModules); |