summaryrefslogtreecommitdiff
path: root/config/external
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2019-10-02 19:51:00 -0500
committerathenian200 <athenian200@outlook.com>2019-10-21 04:53:42 -0500
commit8c31823543f450437d37df2c02d604cc67272807 (patch)
tree3d7f8b703f779a89f696e0824294c8079f77e8bc /config/external
parent60412ff9a5d26a18122de429b02fe10207f67098 (diff)
downloadaura-central-8c31823543f450437d37df2c02d604cc67272807.tar.gz
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 'config/external')
-rw-r--r--config/external/ffi/moz.build21
1 files changed, 18 insertions, 3 deletions
diff --git a/config/external/ffi/moz.build b/config/external/ffi/moz.build
index e9ef07de3..3a5478967 100644
--- a/config/external/ffi/moz.build
+++ b/config/external/ffi/moz.build
@@ -35,9 +35,17 @@ else:
'FFI_NO_RAW_API': True,
'HAVE_AS_ASCII_PSEUDO_OP': True,
'HAVE_AS_STRING_PSEUDO_OP': True,
- 'HAVE_AS_X86_64_UNWIND_SECTION_TYPE': True,
})
+# This should NEVER be true on 32-bit x86 systems. It's called x86_64 unwind
+# section type for a reason. By rights the way it was before should have broken
+# all 32-bit builds on x86.
+
+ if CONFIG['FFI_TARGET'] == 'X86':
+ DEFINES['HAVE_AS_X86_64_UNWIND_SECTION_TYPE'] = False
+ else:
+ DEFINES['HAVE_AS_X86_64_UNWIND_SECTION_TYPE'] = True
+
if CONFIG['MOZ_DEBUG']:
DEFINES['FFI_DEBUG'] = True
if not CONFIG['MOZ_NO_DEBUG_RTL']:
@@ -49,13 +57,20 @@ else:
if CONFIG['OS_TARGET'] not in ('WINNT', 'Darwin'):
DEFINES['HAVE_HIDDEN_VISIBILITY_ATTRIBUTE'] = True
- if CONFIG['INTEL_ARCHITECTURE']:
+# Solaris uses datarel encoding for x86. This causes a lot of really stupid
+# problems, like the vast majority of x86 assembler not being considered PIC
+# on Solaris.
+
+ if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['OS_TARGET'] != 'SunOS':
DEFINES['HAVE_AS_X86_PCREL'] = True
# Don't bother setting EH_FRAME_FLAGS on Windows.
# Quoted defines confuse msvcc.sh, and the value isn't used there.
if CONFIG['OS_TARGET'] != 'WINNT':
- if CONFIG['FFI_TARGET'] == 'ARM':
+ # Solaris seems to require EH_FRAME to be writable even on x86.
+ # It works fine most of the time and there's no rule against it,
+ # but it causes a lot of weird problems.
+ if CONFIG['FFI_TARGET'] == 'ARM' or CONFIG['OS_ARCH'] == 'SunOS':
DEFINES['EH_FRAME_FLAGS'] = '"aw"'
else:
DEFINES['EH_FRAME_FLAGS'] = '"a"'