mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
b1bf2671b2
Every program run during the build which loads a NM library must preload libasan.so if the address sanitizer is enabled. Add a macro to set the needed environment variables and use it when performing the shared object link tests.
12 lines
442 B
Makefile
12 lines
442 B
Makefile
# NetworkManager Makefile helpers
|
|
|
|
set_sanitizer_env = \
|
|
[ -n "$(SANITIZER_ENV)" ] && export $(SANITIZER_ENV) ; \
|
|
if [ -n "$(1)" ] && echo $(CFLAGS) | grep -e -fsanitize=address ; then \
|
|
export LD_PRELOAD="$${LD_PRELOAD}:$$(ldd $(1) | grep libasan\.so\.. -o | head -n 1)"; \
|
|
fi
|
|
|
|
check_so_symbols = \
|
|
$(call set_sanitizer_env,$(1)); \
|
|
LD_BIND_NOW=1 LD_PRELOAD=$${LD_PRELOAD}:$(1) $(top_builddir)/src/NetworkManager --version >/dev/null
|