Files
firefox/mozglue/build/replace_malloc.mk
T
Mike Hommey 4e76f217db Bug 1401118 - Avoid having to modify replace-malloc.mk every time we add an allocator API entry point. r=froydnj
For obscure linkage reasons, we need all the replace-malloc symbols
being passed to the linker to tell it to allow them being undefined.

That list actually duplicates what's in malloc_decls.h somehow, and
every time we add an entry point, we end up having to modify those two
files (and others, addressed in different bugs), which is suboptimal.

So we generate the list of those symbols from malloc_decls.h.
2017-09-19 16:09:56 +09:00

14 lines
576 B
Makefile

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
ifeq (Darwin_1,$(OS_TARGET)_$(MOZ_REPLACE_MALLOC))
# Technically, ) is not a necessary delimiter in the awk call, but make
# doesn't like the opening ( there being alone...
OS_LDFLAGS += \
$(shell awk -F'[(),]' '/^MALLOC_DECL/{print "-Wl,-U,_replace_" $$2}' $(topsrcdir)/memory/build/malloc_decls.h) \
$(NULL)
EXTRA_DEPS += $(topsrcdir)/memory/build/malloc_decls.h
endif