This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Remove AM_MAKEFLAGS from libsanitizer
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: DJ Delorie <dj at redhat dot com>, neroden at gcc dot gnu dot org, Alexandre Oliva <aoliva at redhat dot com>, Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 12 Dec 2012 06:41:48 -0800
- Subject: Re: PATCH: Remove AM_MAKEFLAGS from libsanitizer
- References: <CAMe9rOoY7acf1eZdTygAHrJni+E4QG6ns9RzhR8Yn2NqhNkjcw@mail.gmail.com> <50C844FC.9040604@gnu.org>
On Wed, Dec 12, 2012 at 12:49 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 11/12/2012 22:39, H.J. Lu ha scritto:
>> On Tue, Dec 11, 2012 at 6:36 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
>>> Il 11/12/2012 14:47, H.J. Lu ha scritto:
>>>> On Thu, Dec 6, 2012 at 7:07 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>>> On Thu, Nov 29, 2012 at 10:30 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> Since libsanitizer is used for bootstrap and compiled with raw_cxx,
>>>>>> we need to use explicit -I for libstdc++-v3 header files in
>>>>>> libsanitizer. Otherwise, we will get
>>>>>>
>>>>>> libtool: compile: unrecognized option `-D_GNU_SOURCE'
>>>>>> libtool: compile: Try `libtool --help' for more information.
>>>>>>
>>>>>> This patch fixes it. OK to install?
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>>> H.J.
>>>>>> ---
>>>>>> libsanitizer/Makefile.am | 2 --
>>>>>> libsanitizer/Makefile.in | 6 +++---
>>>>>> libsanitizer/aclocal.m4 | 1 +
>>>>>> libsanitizer/asan/Makefile.am | 6 ++++--
>>>>>> libsanitizer/asan/Makefile.in | 14 ++++++++++----
>>>>>> libsanitizer/configure | 22 ++++++++++++++++++++--
>>>>>> libsanitizer/configure.ac | 1 +
>>>>>> libsanitizer/interception/Makefile.am | 6 ++++--
>>>>>> libsanitizer/interception/Makefile.in | 14 ++++++++++----
>>>>>> libsanitizer/sanitizer_common/Makefile.am | 6 ++++--
>>>>>> libsanitizer/sanitizer_common/Makefile.in | 14 ++++++++++----
>>>>>> libsanitizer/tsan/Makefile.am | 6 ++++--
>>>>>> libsanitizer/tsan/Makefile.in | 13 +++++++++----
>>>>>> 14 files changed, 97 insertions(+), 31 deletions(-)
>>>>>> create mode 100644 libsanitizer/ChangeLog.asan
>>>>>>
>>>>>> 2012-11-22 H.J. Lu <hongjiu.lu@intel.com>
>>>>>>
>>>>>> * Makefile.am (AM_MAKEFLAGS): Remove CC and CXX.
>>>>>> * configure.ac (ACX_NONCANONICAL_TARGET): New.
>>>>>> * asan/Makefile.am (AM_CXXFLAGS): Add -I for libstdc++-v3 header
>>>>>> files.
>>>>>> (AM_MAKEFLAGS): Remove CC and CXX.
>>>>>> * interception/Makefile.am: Likewise.
>>>>>> * sanitizer_common/Makefile.am: Likewise.
>>>>>> * tsan/Makefile.am: Likewise.
>>>>>> * Makefile.in: Regenerated.
>>>>>> * aclocal.m4: Likewise.
>>>>>> * configure: Likewise.
>>>>>> * asan/Makefile.in: Likewise.
>>>>>> * interception/Makefile.in: Likewise.
>>>>>> * sanitizer_common/Makefile.in: Likewise.
>>>>>> * tsan/Makefile.in: Likewise.
>>>>>>
>>>>>> diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am
>>>>>> index 64d3d2e..cd4e92d 100644
>>>>>> --- a/libsanitizer/Makefile.am
>>>>>> +++ b/libsanitizer/Makefile.am
>>>>>> @@ -37,8 +37,6 @@ AM_MAKEFLAGS = \
>>>>>> "includedir=$(includedir)" \
>>>>>> "AR=$(AR)" \
>>>>>> "AS=$(AS)" \
>>>>>> - "CC=$(CC)" \
>>>>>> - "CXX=$(CXX)" \
>>>>>> "LD=$(LD)" \
>>>>>> "LIBCFLAGS=$(LIBCFLAGS)" \
>>>>>> "NM=$(NM)" \
>>>
>>> As a followup please check if AM_MAKEFLAGS is needed at all.
>>>
>>>>>> diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in
>>>>>> index 21c2711..53e0be9 100644
>>>>>> --- a/libsanitizer/Makefile.in
>>>>>> +++ b/libsanitizer/Makefile.in
>>>
>>> Please do not include regenerated files in the patch.
>>>
>>
>> Here is a patch to remove AM_MAKEFLAGS from
>> libsanitizer. Tested on Linux/x86-64. OK to install?
>>
>> Thanks.
>>
>>
>> H.J.
>> ---
>> 2012-12-11 H.J. Lu <hongjiu.lu@intel.com>
>>
>> * Makefile.am (AM_MAKEFLAGS): Removed.
>> * interception/Makefile.am: Likewise.
>> * sanitizer_common/Makefile.am: Likewise.
>> * tsan/Makefile.am: Likewise.
>> * Makefile.in: Regenerated.
>> * asan/Makefile.in: Likewise.
>> * interception/Makefile.in: Likewise.
>> * sanitizer_common/Makefile.in: Likewise.
>> * tsan/Makefile.in: Likewise.
>>
>> diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am
>> index 308d438..272a218 100644
>> --- a/libsanitizer/Makefile.am
>> +++ b/libsanitizer/Makefile.am
>> @@ -10,44 +10,6 @@ if USING_MAC_INTERPOSE
>> SUBDIRS = sanitizer_common asan
>> endif
>>
>> -# Work around what appears to be a GNU make bug handling MAKEFLAGS
>> -# values defined in terms of make variables, as is the case for CC and
>> -# friends when we are called from the top level Makefile.
>> -AM_MAKEFLAGS = \
>> - "AR_FLAGS=$(AR_FLAGS)" \
>> - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
>> - "CFLAGS=$(CFLAGS)" \
>> - "CXXFLAGS=$(CXXFLAGS)" \
>> - "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
>> - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
>> - "INSTALL=$(INSTALL)" \
>> - "INSTALL_DATA=$(INSTALL_DATA)" \
>> - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
>> - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
>> - "JC1FLAGS=$(JC1FLAGS)" \
>> - "LDFLAGS=$(LDFLAGS)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
>> - "MAKE=$(MAKE)" \
>> - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
>> - "SHELL=$(SHELL)" \
>> - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
>> - "exec_prefix=$(exec_prefix)" \
>> - "infodir=$(infodir)" \
>> - "libdir=$(libdir)" \
>> - "prefix=$(prefix)" \
>> - "includedir=$(includedir)" \
>> - "AR=$(AR)" \
>> - "AS=$(AS)" \
>> - "LD=$(LD)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "NM=$(NM)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "RANLIB=$(RANLIB)" \
>> - "DESTDIR=$(DESTDIR)"
>> -
>> MAKEOVERRIDES=
>>
>> ## ################################################################
>> diff --git a/libsanitizer/interception/Makefile.am
>> b/libsanitizer/interception/Makefile.am
>> index 6ae59b5..aab68f0 100644
>> --- a/libsanitizer/interception/Makefile.am
>> +++ b/libsanitizer/interception/Makefile.am
>> @@ -17,44 +17,6 @@ interception_files = \
>>
>> libinterception_la_SOURCES = $(interception_files)
>>
>> -# Work around what appears to be a GNU make bug handling MAKEFLAGS
>> -# values defined in terms of make variables, as is the case for CC and
>> -# friends when we are called from the top level Makefile.
>> -AM_MAKEFLAGS = \
>> - "AR_FLAGS=$(AR_FLAGS)" \
>> - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
>> - "CFLAGS=$(CFLAGS)" \
>> - "CXXFLAGS=$(CXXFLAGS)" \
>> - "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
>> - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
>> - "INSTALL=$(INSTALL)" \
>> - "INSTALL_DATA=$(INSTALL_DATA)" \
>> - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
>> - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
>> - "JC1FLAGS=$(JC1FLAGS)" \
>> - "LDFLAGS=$(LDFLAGS)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
>> - "MAKE=$(MAKE)" \
>> - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
>> - "SHELL=$(SHELL)" \
>> - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
>> - "exec_prefix=$(exec_prefix)" \
>> - "infodir=$(infodir)" \
>> - "libdir=$(libdir)" \
>> - "prefix=$(prefix)" \
>> - "includedir=$(includedir)" \
>> - "AR=$(AR)" \
>> - "AS=$(AS)" \
>> - "LD=$(LD)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "NM=$(NM)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "RANLIB=$(RANLIB)" \
>> - "DESTDIR=$(DESTDIR)"
>> -
>> MAKEOVERRIDES=
>>
>> ## ################################################################
>> diff --git a/libsanitizer/sanitizer_common/Makefile.am
>> b/libsanitizer/sanitizer_common/Makefile.am
>> index 708b2a4..8d414b3 100644
>> --- a/libsanitizer/sanitizer_common/Makefile.am
>> +++ b/libsanitizer/sanitizer_common/Makefile.am
>> @@ -29,44 +29,6 @@ sanitizer_common_files = \
>>
>> libsanitizer_common_la_SOURCES = $(sanitizer_common_files)
>>
>> -# Work around what appears to be a GNU make bug handling MAKEFLAGS
>> -# values defined in terms of make variables, as is the case for CC and
>> -# friends when we are called from the top level Makefile.
>> -AM_MAKEFLAGS = \
>> - "AR_FLAGS=$(AR_FLAGS)" \
>> - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
>> - "CFLAGS=$(CFLAGS)" \
>> - "CXXFLAGS=$(CXXFLAGS)" \
>> - "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
>> - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
>> - "INSTALL=$(INSTALL)" \
>> - "INSTALL_DATA=$(INSTALL_DATA)" \
>> - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
>> - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
>> - "JC1FLAGS=$(JC1FLAGS)" \
>> - "LDFLAGS=$(LDFLAGS)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
>> - "MAKE=$(MAKE)" \
>> - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
>> - "SHELL=$(SHELL)" \
>> - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
>> - "exec_prefix=$(exec_prefix)" \
>> - "infodir=$(infodir)" \
>> - "libdir=$(libdir)" \
>> - "prefix=$(prefix)" \
>> - "includedir=$(includedir)" \
>> - "AR=$(AR)" \
>> - "AS=$(AS)" \
>> - "LD=$(LD)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "NM=$(NM)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "RANLIB=$(RANLIB)" \
>> - "DESTDIR=$(DESTDIR)"
>> -
>> MAKEOVERRIDES=
>>
>> ## ################################################################
>> diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am
>> index 867c152..a4e3e51 100644
>> --- a/libsanitizer/tsan/Makefile.am
>> +++ b/libsanitizer/tsan/Makefile.am
>> @@ -37,44 +37,6 @@ libtsan_la_SOURCES = $(tsan_files)
>> libtsan_la_LIBADD =
>> $(top_builddir)/sanitizer_common/libsanitizer_common.la
>> $(top_builddir)/interception/libinterception.la
>> $(top_builddir)/../libstdc++-v3/src/libstdc++.la
>> libtsan_la_LDFLAGS = -version-info `grep -v '^\#'
>> $(srcdir)/libtool-version` -lpthread -ldl
>>
>> -# Work around what appears to be a GNU make bug handling MAKEFLAGS
>> -# values defined in terms of make variables, as is the case for CC and
>> -# friends when we are called from the top level Makefile.
>> -AM_MAKEFLAGS = \
>> - "AR_FLAGS=$(AR_FLAGS)" \
>> - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
>> - "CFLAGS=$(CFLAGS)" \
>> - "CXXFLAGS=$(CXXFLAGS)" \
>> - "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
>> - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
>> - "INSTALL=$(INSTALL)" \
>> - "INSTALL_DATA=$(INSTALL_DATA)" \
>> - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
>> - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
>> - "JC1FLAGS=$(JC1FLAGS)" \
>> - "LDFLAGS=$(LDFLAGS)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
>> - "MAKE=$(MAKE)" \
>> - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
>> - "SHELL=$(SHELL)" \
>> - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
>> - "exec_prefix=$(exec_prefix)" \
>> - "infodir=$(infodir)" \
>> - "libdir=$(libdir)" \
>> - "prefix=$(prefix)" \
>> - "includedir=$(includedir)" \
>> - "AR=$(AR)" \
>> - "AS=$(AS)" \
>> - "LD=$(LD)" \
>> - "LIBCFLAGS=$(LIBCFLAGS)" \
>> - "NM=$(NM)" \
>> - "PICFLAG=$(PICFLAG)" \
>> - "RANLIB=$(RANLIB)" \
>> - "DESTDIR=$(DESTDIR)"
>> -
>> MAKEOVERRIDES=
>
> You need to remove MAKEOVERRIDES too.
>
> Ok with that change.
>
> Paolo
MAKEOVERRIDES is used for multilib. I got
/bin/sh ../libtool --tag=CXX --mode=compile -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 -I.
-I/export/gnu/import/git/gcc/libsanitizer/asan -I
/export/gnu/import/git/gcc/libsanitizer/include -I
/export/gnu/import/git/gcc/libsanitizer -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
-I../../libstdc++-v3/include
-I../../libstdc++-v3/include/x86_64-unknown-linux-gnu
-I/export/gnu/import/git/gcc/libsanitizer/../libstdc++-v3/libsupc++ -g
-O2 -D_GNU_SOURCE -m32 -MT asan_malloc_linux.lo -MD -MP -MF
.deps/asan_malloc_linux.Tpo -c -o asan_malloc_linux.lo
/export/gnu/import/git/gcc/libsanitizer/asan/asan_malloc_linux.cc
libtool: compile: unrecognized option `-D_GNU_SOURCE'
libtool: compile: Try `libtool --help' for more information.
make[8]: *** [asan_allocator.lo] Error 1
make[8]: *** Waiting for unfinished jobs....
libtool: compile: unrecognized option `-D_GNU_SOURCE'
libtool: compile: Try `libtool --help' for more information
I checked in this patch to restore MAKEOVERRIDES.
--
H.J.
---
Index: ChangeLog
===================================================================
--- ChangeLog (revision 194449)
+++ ChangeLog (working copy)
@@ -1,5 +1,18 @@
2012-12-12 H.J. Lu <hongjiu.lu@intel.com>
+ * Makefile.am (MAKEOVERRIDES): Restored.
+ * asan/Makefile.am: Likewise.
+ * interception/Makefile.am: Likewise.
+ * sanitizer_common/Makefile.am: Likewise.
+ * tsan/Makefile.am: Likewise.
+ * Makefile.in: Regenerated.
+ * asan/Makefile.in: Likewise.
+ * interception/Makefile.in: Likewise.
+ * sanitizer_common/Makefile.in: Likewise.
+ * tsan/Makefile.in: Likewise.
+
+2012-12-12 H.J. Lu <hongjiu.lu@intel.com>
+
* asan/Makefile.am (libasan_la_LIBADD): Use $(LIBSTDCXX_RAW_CXX_LDLAGS).
* tsan/Makefile.am (libtsan_la_LIBADD): Likewise.
* Makefile.in: Regenerated.
Index: Makefile.am
===================================================================
--- Makefile.am (revision 194449)
+++ Makefile.am (working copy)
@@ -10,5 +10,7 @@ if USING_MAC_INTERPOSE
SUBDIRS = sanitizer_common asan
endif
+MAKEOVERRIDES=
+
## ################################################################
Index: asan/Makefile.am
===================================================================
--- asan/Makefile.am (revision 194449)
+++ asan/Makefile.am (working copy)
@@ -44,5 +44,7 @@ libasan_la_LIBADD += $(LIBSTDCXX_RAW_CXX
libasan_la_LDFLAGS = -version-info `grep -v '^\#'
$(srcdir)/libtool-version` -lpthread -ldl
+MAKEOVERRIDES=
+
## ################################################################
Index: interception/Makefile.am
===================================================================
--- interception/Makefile.am (revision 194449)
+++ interception/Makefile.am (working copy)
@@ -17,5 +17,7 @@ interception_files = \
libinterception_la_SOURCES = $(interception_files)
+MAKEOVERRIDES=
+
## ################################################################
Index: sanitizer_common/Makefile.am
===================================================================
--- sanitizer_common/Makefile.am (revision 194449)
+++ sanitizer_common/Makefile.am (working copy)
@@ -29,5 +29,7 @@ sanitizer_common_files = \
libsanitizer_common_la_SOURCES = $(sanitizer_common_files)
+MAKEOVERRIDES=
+
## ################################################################
Index: tsan/Makefile.am
===================================================================
--- tsan/Makefile.am (revision 194449)
+++ tsan/Makefile.am (working copy)
@@ -37,5 +37,7 @@ libtsan_la_SOURCES = $(tsan_files)
libtsan_la_LIBADD =
$(top_builddir)/sanitizer_common/libsanitizer_common.la
$(top_builddir)/interception/libinterception.la
$(LIBSTDCXX_RAW_CXX_LDLAGS)
libtsan_la_LDFLAGS = -version-info `grep -v '^\#'
$(srcdir)/libtool-version` -lpthread -ldl
+MAKEOVERRIDES=
+
## ################################################################