Commit 4f148bbc by Jakub Jelinek Committed by Jakub Jelinek

re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (missing -lasan))

	PR sanitizer/56781
lto-plugin/
	* Makefile.am (CFLAGS, LDFLAGS): Filter out -fsanitize=address.
	(liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS,
	liblto_plugin_la_DEPENDENCIES): Prefer ../libiberty/noasan/libiberty.a
	over ../libiberty/pic/libiberty.a if the former exists.
	* Makefile.in: Regenerated.
libiberty/
	* maint-tool: Also emit rule for noasan/ subdirectory.
	* configure.ac (NOASANFLAG): Set and substitute.
	* Makefile.in: Regenerated.
	(NOASANFLAG): Set.
	(all, $(TARGETLIB), mostlyclean): Handle noasan subdir like pic
	subdir.
	(stamp-noasandir): New goal.
	* configure: Regenerated.

From-SVN: r209476
parent ffe7f7a7
2014-04-17 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/56781
* maint-tool: Also emit rule for noasan/ subdirectory.
* configure.ac (NOASANFLAG): Set and substitute.
* Makefile.in: Regenerated.
(NOASANFLAG): Set.
(all, $(TARGETLIB), mostlyclean): Handle noasan subdir like pic
subdir.
(stamp-noasandir): New goal.
* configure: Regenerated.
2014-04-01 Richard Biener <rguenther@suse.de> 2014-04-01 Richard Biener <rguenther@suse.de>
* simple-object.c (simple_object_internal_write): Handle * simple-object.c (simple_object_internal_write): Handle
......
...@@ -594,6 +594,7 @@ pexecute ...@@ -594,6 +594,7 @@ pexecute
target_header_dir target_header_dir
CHECK CHECK
LIBOBJS LIBOBJS
NOASANFLAG
PICFLAG PICFLAG
INSTALL_DATA INSTALL_DATA
INSTALL_SCRIPT INSTALL_SCRIPT
...@@ -4971,6 +4972,12 @@ if [ "${shared}" != "yes" ]; then ...@@ -4971,6 +4972,12 @@ if [ "${shared}" != "yes" ]; then
fi fi
NOASANFLAG=
case " ${CFLAGS} " in
*\ -fsanitize=address\ *) NOASANFLAG=-fno-sanitize=address ;;
esac
echo "# Warning: this fragment is automatically generated" > temp-frag echo "# Warning: this fragment is automatically generated" > temp-frag
if [ -n "${frag}" ] && [ -f "${frag}" ]; then if [ -n "${frag}" ] && [ -f "${frag}" ]; then
......
...@@ -236,6 +236,12 @@ if [[ "${shared}" != "yes" ]]; then ...@@ -236,6 +236,12 @@ if [[ "${shared}" != "yes" ]]; then
fi fi
AC_SUBST(PICFLAG) AC_SUBST(PICFLAG)
NOASANFLAG=
case " ${CFLAGS} " in
*\ -fsanitize=address\ *) NOASANFLAG=-fno-sanitize=address ;;
esac
AC_SUBST(NOASANFLAG)
echo "# Warning: this fragment is automatically generated" > temp-frag echo "# Warning: this fragment is automatically generated" > temp-frag
if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then if [[ -n "${frag}" ]] && [[ -f "${frag}" ]]; then
......
#!/usr/bin/perl #!/usr/bin/perl
# -*- perl -*- # -*- perl -*-
# Copyright (C) 2001, 2007, 2010 # Copyright (C) 2001, 2007, 2010, 2014
# Free Software Foundation # Free Software Foundation
# #
# This file is part of the libiberty library. # This file is part of the libiberty library.
...@@ -215,6 +215,9 @@ sub deps { ...@@ -215,6 +215,9 @@ sub deps {
$crule = "\tif [ x\"\$(PICFLAG)\" != x ]; then \\\n"; $crule = "\tif [ x\"\$(PICFLAG)\" != x ]; then \\\n";
$crule .= "\t \$(COMPILE.c) \$(PICFLAG) \$< -o pic/\$@; \\\n"; $crule .= "\t \$(COMPILE.c) \$(PICFLAG) \$< -o pic/\$@; \\\n";
$crule .= "\telse true; fi\n"; $crule .= "\telse true; fi\n";
$crule .= "\tif [ x\"\$(NOASANFLAG)\" != x ]; then \\\n";
$crule .= "\t \$(COMPILE.c) \$(PICFLAG) \$(NOASANFLAG) \$< -o noasan/\$@; \\\n";
$crule .= "\telse true; fi\n";
$crule .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n"; $crule .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n";
$crule .= "\n"; $crule .= "\n";
......
2014-04-17 Jakub Jelinek <jakub@redhat.com> 2014-04-17 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/56781 PR sanitizer/56781
* Makefile.am (CFLAGS, LDFLAGS): Filter out -fsanitize=address.
(liblto_plugin_la_LIBADD, liblto_plugin_la_LDFLAGS,
liblto_plugin_la_DEPENDENCIES): Prefer ../libiberty/noasan/libiberty.a
over ../libiberty/pic/libiberty.a if the former exists.
* Makefile.in: Regenerated.
PR sanitizer/56781
* Makefile.am (LTLDFLAGS, liblto_plugin_la_LINK): New variables. * Makefile.am (LTLDFLAGS, liblto_plugin_la_LINK): New variables.
* Makefile.in: Regenerated. * Makefile.in: Regenerated.
......
...@@ -11,6 +11,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS) ...@@ -11,6 +11,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
AM_CFLAGS = @ac_lto_plugin_warn_cflags@ AM_CFLAGS = @ac_lto_plugin_warn_cflags@
AM_LDFLAGS = @ac_lto_plugin_ldflags@ AM_LDFLAGS = @ac_lto_plugin_ldflags@
AM_LIBTOOLFLAGS = --tag=disable-static AM_LIBTOOLFLAGS = --tag=disable-static
override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
libexecsub_LTLIBRARIES = liblto_plugin.la libexecsub_LTLIBRARIES = liblto_plugin.la
gcc_build_dir = ../$(host_subdir)/gcc gcc_build_dir = ../$(host_subdir)/gcc
...@@ -22,13 +24,16 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) ...@@ -22,13 +24,16 @@ LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
liblto_plugin_la_SOURCES = lto-plugin.c liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = \ liblto_plugin_la_LIBADD = \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,) $(if $(wildcard ../libiberty/noasan/libiberty.a),$(Wc)../libiberty/noasan/libiberty.a, \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,))
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \ liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
$(lt_host_flags) -module -bindir $(libexecsubdir) \ $(lt_host_flags) -module -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) $(if $(wildcard ../libiberty/noasan/libiberty.a),, \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a))
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) ../libiberty/noasan/libiberty.a),../libiberty/noasan/libiberty.a, \
$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,))
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@ $(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
......
...@@ -239,15 +239,18 @@ Wc = -Wc, ...@@ -239,15 +239,18 @@ Wc = -Wc,
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS)) LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
liblto_plugin_la_SOURCES = lto-plugin.c liblto_plugin_la_SOURCES = lto-plugin.c
liblto_plugin_la_LIBADD = \ liblto_plugin_la_LIBADD = \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,) $(if $(wildcard ../libiberty/noasan/libiberty.a),$(Wc)../libiberty/noasan/libiberty.a, \
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,))
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \ liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
$(lt_host_flags) -module -bindir $(libexecsubdir) \ $(lt_host_flags) -module -bindir $(libexecsubdir) \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a) $(if $(wildcard ../libiberty/noasan/libiberty.a),, \
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a))
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \ liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,) ../libiberty/noasan/libiberty.a),../libiberty/noasan/libiberty.a, \
$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,))
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
...@@ -539,6 +542,8 @@ uninstall-am: uninstall-libexecsubLTLIBRARIES ...@@ -539,6 +542,8 @@ uninstall-am: uninstall-libexecsubLTLIBRARIES
pdf pdf-am ps ps-am tags uninstall uninstall-am \ pdf pdf-am ps ps-am tags uninstall uninstall-am \
uninstall-libexecsubLTLIBRARIES uninstall-libexecsubLTLIBRARIES
override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
all-local: $(in_gcc_libs) all-local: $(in_gcc_libs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment