summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Certner <olce.palemoon@certner.fr>2021-01-06 13:43:01 +0100
committerOlivier Certner <olce.palemoon@certner.fr>2021-01-07 17:49:14 +0100
commit3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2 (patch)
tree3f1e52902eb77babd3b917de778cf30b158a4b06
parent91f7c9d30e6bf58428cc06333ae04bf3abc03504 (diff)
downloadUXP-3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2.tar
UXP-3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2.tar.gz
UXP-3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2.tar.lz
UXP-3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2.tar.xz
UXP-3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2.zip
Issue #1699 - Part 3c: mozjemalloc: FreeBSD: Ensure early initialization
This guarantees that initialization is done in a single-thread context.
-rw-r--r--build/gecko_templates.mozbuild5
1 files changed, 5 insertions, 0 deletions
diff --git a/build/gecko_templates.mozbuild b/build/gecko_templates.mozbuild
index e2bc999b7..a15fdd77f 100644
--- a/build/gecko_templates.mozbuild
+++ b/build/gecko_templates.mozbuild
@@ -63,6 +63,11 @@ def GeckoBinary(linkage='dependent', msvcrt='dynamic', mozglue=None):
LDFLAGS += ['-rdynamic']
if CONFIG['MOZ_MEMORY']:
USE_LIBS += ['memory']
+ if CONFIG['OS_ARCH'] == 'FreeBSD':
+ # Make sure this function is linked in, so that it is
+ # executed at executable load (it has the 'constructor'
+ # flag).
+ LDFLAGS += ['-u', 'jemalloc_FreeBSD_init']
elif mozglue == 'library':
LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
if not CONFIG['MOZ_GLUE_IN_PROGRAM']: