Skip to content

Commit db96977

Browse files
wannabetechie946frap129
wannabetechie946
authored andcommitted
allow replacing the malloc with LC_PRELOAD
Preloading a different memory alloctor, for example [hardened_malloc](github.com/grapheneos/hardened_malloc) is possible but disabled in upstream firefox. This caused [this bug](secureblue/secureblue#171) The build flag was already enabled in Fedora: [Issue](https://bugzilla.redhat.com/show_bug.cgi?id=2260766) [Changelog]( https://bodhi.fedoraproject.org/updates/FEDORA-2024-7af93e63f3) This only does something when the user uses LD_PRELOAD to preload a different memory allocator, i.e. nothing on most systems. Other systems may chose to not yet compile glibc/musl with that memory allocator, so they use this trick to still allow using a different memory allocator. This also allows them to use the regular malloc as a "fallback", which may be wanted. This flag is not compatible with `--disable-jemalloc` which does not compile jemalloc at all. That flag create a perfectly usable binary, but only on systems where a different one, e.g. hardened_malloc is preloaded. For the future it could be possible to do this in Librewolf, but this would require lots of testing, I left the comment in there anyways.
1 parent b1f8e03 commit db96977

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

assets/mozconfig.new

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ ac_add_options --enable-jxl
1111
ac_add_options --enable-optimize
1212
ac_add_options --enable-release
1313
ac_add_options --enable-rust-simd
14+
# allow replacing malloc manually, will not affect regular systems
15+
# not compatible with ac_add_options --disable-jemalloc, which only works when preloading custom malloc
16+
ac_add_options --enable-replace-malloc
1417

1518
ac_add_options --with-app-name=hyperfox
1619
ac_add_options --with-branding=browser/branding/librewolf

0 commit comments

Comments
 (0)