From patchwork Thu Nov 28 11:29:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Gribov X-Patchwork-Id: 294862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B6CC52C0092 for ; Thu, 28 Nov 2013 22:30:56 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=F7X1w/nS+S2ihVpeD o4Hol6wl1oU+2uUpCmuemPmxyTzhes5j46rW+yFb4SlU21fd1rWa8zvoiP5Gx0HG PkNXWcGIZW2HRwspYmJCSGNSk4wz2TP5Pde3/0A7XHuZfLbeVRUVPiXl7kucPE2D HeqIbM3cJpmXCrR/boASBEyhm8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=1HIHQ5UgrPUtLoTITK7y70I e8zo=; b=q5Vj9Oqu6Gek7Q9UCKjsSNz42plxzqdyTYg/dVu2UgWGpjtdEP3iJMi YjDX2tyy3BDKytu7/K7FR0YEj3ogBm0b13fqfpaWp8WapFWuJIa0H9yGNRoRffdV WPuz6ATp8pxnDKeyRVUTwa3OOwxZeqFMOd9iLXnRIiJ8UMqFA+rI= Received: (qmail 7465 invoked by alias); 28 Nov 2013 11:30:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 7444 invoked by uid 89); 28 Nov 2013 11:30:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=AWL, BAYES_99, RDNS_NONE, SPF_HELO_PASS, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mailout1.w1.samsung.com Received: from Unknown (HELO mailout1.w1.samsung.com) (210.118.77.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (DES-CBC3-SHA encrypted) ESMTPS; Thu, 28 Nov 2013 11:29:08 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MWZ004M218AS050@mailout1.w1.samsung.com> for gcc-patches@gcc.gnu.org; Thu, 28 Nov 2013 11:28:58 +0000 (GMT) Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 73.20.06082.AF827925; Thu, 28 Nov 2013 11:28:58 +0000 (GMT) Received: from [106.109.8.8] by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MWZ0010P1896P60@eusync3.samsung.com>; Thu, 28 Nov 2013 11:28:58 +0000 (GMT) Message-id: <529728FE.4080407@samsung.com> Date: Thu, 28 Nov 2013 15:29:02 +0400 From: Yury Gribov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-version: 1.0 To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org, Viacheslav Garbuzov , Evgeny Gavrin Subject: Re: [PATCH] Get rid of useless -fno-rtti for libubsan References: <5295A6EE.8050906@samsung.com> <20131128083701.GN892@tucnak.redhat.com> In-reply-to: <20131128083701.GN892@tucnak.redhat.com> Content-type: multipart/mixed; boundary=------------050106070804040405020000 > I wonder if this can't be done through > just adding -fno-rtti to AM_CXXFLAGS and say > ubsan_handlers_cxx.% ubsan_type_hash.% : AM_CXXFLAGS += -frtti Yup, that did the trick. Attaching modified patch. 2013-11-28 Jakub Jelinek Yury Gribov PR sanitizer/59106 * ubsan/Makefile.am (AM_CXXFLAGS): Disable -frtti for files that don't need it. * ubsan/Makefile.in: Regenerated. diff --git a/libsanitizer/ubsan/Makefile.am b/libsanitizer/ubsan/Makefile.am index e98984a..86fcaca 100644 --- a/libsanitizer/ubsan/Makefile.am +++ b/libsanitizer/ubsan/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include 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 -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 +AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I m4 @@ -13,11 +13,13 @@ toolexeclib_LTLIBRARIES = libubsan.la ubsan_files = \ ubsan_diag.cc \ ubsan_handlers.cc \ - ubsan_handlers_cxx.cc \ - ubsan_type_hash.cc \ ubsan_value.cc -libubsan_la_SOURCES = $(ubsan_files) +ubsan_cxx_files = \ + ubsan_handlers_cxx.cc \ + ubsan_type_hash.cc + +libubsan_la_SOURCES = $(ubsan_files) $(ubsan_cxx_files) libubsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la if !USING_MAC_INTERPOSE libubsan_la_LIBADD += $(top_builddir)/interception/libinterception.la @@ -25,6 +27,9 @@ endif libubsan_la_LIBADD += $(LIBSTDCXX_RAW_CXX_LDFLAGS) libubsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl +# Use special rules for files that require RTTI support. +ubsan_handlers_cxx.% ubsan_type_hash.% : AM_CXXFLAGS += -frtti + # 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. diff --git a/libsanitizer/ubsan/Makefile.in b/libsanitizer/ubsan/Makefile.in index 6812538..2e85384 100644 --- a/libsanitizer/ubsan/Makefile.in +++ b/libsanitizer/ubsan/Makefile.in @@ -81,9 +81,9 @@ am__DEPENDENCIES_1 = libubsan_la_DEPENDENCIES = \ $(top_builddir)/sanitizer_common/libsanitizer_common.la \ $(am__append_1) $(am__DEPENDENCIES_1) -am__objects_1 = ubsan_diag.lo ubsan_handlers.lo ubsan_handlers_cxx.lo \ - ubsan_type_hash.lo ubsan_value.lo -am_libubsan_la_OBJECTS = $(am__objects_1) +am__objects_1 = ubsan_diag.lo ubsan_handlers.lo ubsan_value.lo +am__objects_2 = ubsan_handlers_cxx.lo ubsan_type_hash.lo +am_libubsan_la_OBJECTS = $(am__objects_1) $(am__objects_2) libubsan_la_OBJECTS = $(am_libubsan_la_OBJECTS) libubsan_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ @@ -240,7 +240,7 @@ AM_CPPFLAGS = -I $(top_srcdir) -I $(top_srcdir)/include # May be used by toolexeclibdir. gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic \ - -Wno-long-long -fPIC -fno-builtin -fno-exceptions \ + -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti \ -fomit-frame-pointer -funwind-tables -fvisibility=hidden \ -Wno-variadic-macros $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I m4 @@ -248,11 +248,13 @@ toolexeclib_LTLIBRARIES = libubsan.la ubsan_files = \ ubsan_diag.cc \ ubsan_handlers.cc \ - ubsan_handlers_cxx.cc \ - ubsan_type_hash.cc \ ubsan_value.cc -libubsan_la_SOURCES = $(ubsan_files) +ubsan_cxx_files = \ + ubsan_handlers_cxx.cc \ + ubsan_type_hash.cc + +libubsan_la_SOURCES = $(ubsan_files) $(ubsan_cxx_files) libubsan_la_LIBADD = \ $(top_builddir)/sanitizer_common/libsanitizer_common.la \ $(am__append_1) $(LIBSTDCXX_RAW_CXX_LDFLAGS) @@ -575,6 +577,9 @@ uninstall-am: uninstall-toolexeclibLTLIBRARIES tags uninstall uninstall-am uninstall-toolexeclibLTLIBRARIES +# Use special rules for files that require RTTI support. +ubsan_handlers_cxx.% ubsan_type_hash.% : AM_CXXFLAGS += -frtti + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: