]> git.ipfire.org Git - thirdparty/gcc.git/blob - lto-plugin/Makefile.am
re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan))
[thirdparty/gcc.git] / lto-plugin / Makefile.am
1 # Makefile.am is used by automake 1.11 to generate Makefile.in.
2
3 ACLOCAL_AMFLAGS = -I .. -I ../config
4 AUTOMAKE_OPTIONS = no-dependencies
5
6 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
7 target_noncanonical := @target_noncanonical@
8 libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
9
10 AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
11 AM_CFLAGS = @ac_lto_plugin_warn_cflags@
12 AM_LDFLAGS = @ac_lto_plugin_ldflags@
13 AM_LIBTOOLFLAGS = --tag=disable-static
14 override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
15 override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
16
17 libexecsub_LTLIBRARIES = liblto_plugin.la
18 gcc_build_dir = ../$(host_subdir)/gcc
19 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
20
21 # Can be removed when libiberty becomes a normal convenience library
22 Wc=-Wc,
23 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
24
25 liblto_plugin_la_SOURCES = lto-plugin.c
26 liblto_plugin_la_LIBADD = \
27 $(if $(wildcard ../libiberty/noasan/libiberty.a),$(Wc)../libiberty/noasan/libiberty.a, \
28 $(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,))
29 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
30 liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
31 $(lt_host_flags) -module -bindir $(libexecsubdir) \
32 $(if $(wildcard ../libiberty/noasan/libiberty.a),, \
33 $(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a))
34 liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
35 ../libiberty/noasan/libiberty.a),../libiberty/noasan/libiberty.a, \
36 $(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,))
37 liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
38 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
39 $(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
40
41 all-local: $(in_gcc_libs)
42
43 $(in_gcc_libs) : $(gcc_build_dir)/%: %
44 @if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \
45 echo WARNING: $* is static, not copying to $@ >&2 ; \
46 else \
47 $(mkinstalldirs) $(gcc_build_dir) && \
48 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \
49 fi