On Tue, Dec 11, 2012 at 8:19 AM, Paolo Bonzini <bonz...@gnu.org> wrote: > Il 11/12/2012 16:03, H.J. Lu ha scritto: >>>>>> diff --git a/libsanitizer/asan/Makefile.am >>>>>> b/libsanitizer/asan/Makefile.am >>>>>> index 3da1db3..45fb3b3 100644 >>>>>> --- a/libsanitizer/asan/Makefile.am >>>>>> +++ b/libsanitizer/asan/Makefile.am >>>>>> @@ -5,6 +5,10 @@ gcc_version := $(shell cat >>>>>> $(top_srcdir)/../gcc/BASE-VER) >>>>>> >>>>>> DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS >>>>>> -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 >>>>>> -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 >>>>>> AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic >>>>>> -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer >>>>>> -funwind-tables -fvisibility=hidden -Wno-variadic-macros >>>>>> -Wno-c99-extensions >>>>>> +## We require libstdc++-v3 to be in the same build tree. >>>>>> +AM_CXXFLAGS += -I../../libstdc++-v3/include \ >>>>>> + -I../../libstdc++-v3/include/$(target_noncanonical) \ >>>>>> + -I$(srcdir)/../../libstdc++-v3/libsupc++ >>> >>> As a followup, please bring back the possibility to build libsanitizer >>> standalone, also wrapping the chooice of flags to link to libstdc++-v3 >>> in a new config/libstdc++-raw-cxx.m4 file. >> >> I don't believe it is possible with libsanitizer in GCC since it >> uses GCC toplevel files. Where do you get those toplevel files >> when you compile it standalone? > > Does it use any GCC toplevel files except when regenerating the > configury? But I think it's a useful refactoring anyway.
libsanitizer started as standalone and it didn't work with GCC build. We removed all those extra files to get it compile as the part of GCC build: 2012-11-13 H.J. Lu <hongjiu...@intel.com> PR other/55304 * acinclude.m4: New file. * Makefile.am (ACLOCAL_AMFLAGS): New. * configure.ac (AC_PREREQ): Set to 2.64. (AC_CONFIG_AUX_DIR): Set to "..". * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * asan/Makefile.in: Likewise. * interception/Makefile.in: Likewise. * sanitizer_common/Makefile.in: Likewise. * config.guess: Removed. * config.sub: Likewise. * depcomp: Likewise. * install-sh: Likewise. * ltmain.sh: Likewise. * missing: Likewise. Are we going back now? >>> Bonus points for using this macro elsewhere in the tree. >>> >>>>>> ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config >>>>>> >>>>>> toolexeclib_LTLIBRARIES = libasan.la >>>>>> @@ -64,8 +68,6 @@ AM_MAKEFLAGS = \ >>>>>> "includedir=$(includedir)" \ >>>>>> "AR=$(AR)" \ >>>>>> "AS=$(AS)" \ >>>>>> - "CC=$(CC)" \ >>>>>> - "CXX=$(CXX)" \ >>>>>> "LD=$(LD)" \ >>>>>> "LIBCFLAGS=$(LIBCFLAGS)" \ >>>>>> "NM=$(NM)" \ >>> >>> Same as above, and same for other .am files. >> >> I prefer to leave them where they are so that >> >> # cd asan >> # make >> >> can compile. If they are passed from the parent directory, >> this won't work. > > What do you mean? > >>>>>> diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac >>>>>> index 2d62ec4..9c73904 100644 >>>>>> --- a/libsanitizer/configure.ac >>>>>> +++ b/libsanitizer/configure.ac >>>>>> @@ -19,6 +19,7 @@ AC_MSG_RESULT($version_specific_libs) >>>>>> # Do not delete or change the following two lines. For why, see >>>>>> # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html >>>>>> AC_CANONICAL_SYSTEM >>>>>> +ACX_NONCANONICAL_TARGET >>> >>> Note that if you create a new macro, ACX_NONCANONICAL_TARGET should be >>> AC_REQUIREd there. >> >> How do I AC_REQUIRE it? I just copied it from other places: >> >> [hjl@gnu-6 gcc]$ grep ACX_NONCANONICAL_TARGET */configure.* >> boehm-gc/configure.ac:ACX_NONCANONICAL_TARGET >> fixincludes/configure.ac:ACX_NONCANONICAL_TARGET >> gcc/configure.ac:ACX_NONCANONICAL_TARGET >> gnattools/configure.ac:ACX_NONCANONICAL_TARGET >> libada/configure.ac:ACX_NONCANONICAL_TARGET >> libgcc/configure.ac:ACX_NONCANONICAL_TARGET >> libgfortran/configure.ac:ACX_NONCANONICAL_TARGET >> libmudflap/configure.ac:ACX_NONCANONICAL_TARGET >> libobjc/configure.ac:ACX_NONCANONICAL_TARGET >> libquadmath/configure.ac:ACX_NONCANONICAL_TARGET >> libssp/configure.ac:ACX_NONCANONICAL_TARGET > > This is connected to the change proposed above, of getting the -I > options to a separate macro in config/*.m4. I will take a look. -- H.J.