From patchwork Tue Nov 13 16:46:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 198741 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]) by ozlabs.org (Postfix) with SMTP id 9BBC22C00A9 for ; Wed, 14 Nov 2012 03:47:13 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1353430034; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=gG2sUFq foGLs4IjqQnzMpJ5/M0s=; b=PLTEhbTNduC6EanaD1m+f+AhoP8qS56/fyOv98j DgBiuFKnE6gkmO6NHIJfnKoNY8A0XRswfS6QrAu7PCSQPycQbAgVMnT9pQvN+e0k rDLml6puLVHGW0D8+VZZtT7K5WsN/ZTC9mJGKjuwGzKR+pcFp95kPytUtjRLL22C HPXQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=OtqKKSlDxOlA0aFr9L0GD0Qya4uSh/riMElNzifLzkLwZXatTHbPUrOl+IEelL LaARaUHbN+RrpVfUksP12EGTf3LuYoPxCFwLPhviKHfriq8opKgU50uxmGUw+phk zxTGQCv8buzDXRpsGqJqHV5aItjps9DkJf5RnnSBh/kzI=; Received: (qmail 15062 invoked by alias); 13 Nov 2012 16:47:07 -0000 Received: (qmail 15048 invoked by uid 22791); 13 Nov 2012 16:47:06 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Nov 2012 16:46:59 +0000 Received: by mail-ie0-f175.google.com with SMTP id c13so11476949ieb.20 for ; Tue, 13 Nov 2012 08:46:59 -0800 (PST) Received: by 10.50.6.169 with SMTP id c9mr11715617iga.24.1352825219239; Tue, 13 Nov 2012 08:46:59 -0800 (PST) Received: from gnu-tools-1.localdomain (76-220-57-190.lightspeed.sntcca.sbcglobal.net. [76.220.57.190]) by mx.google.com with ESMTPS id s20sm9351063igs.10.2012.11.13.08.46.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Nov 2012 08:46:58 -0800 (PST) Received: by gnu-tools-1.localdomain (Postfix, from userid 1000) id ECAD31A062A; Tue, 13 Nov 2012 08:46:55 -0800 (PST) Date: Tue, 13 Nov 2012 08:46:55 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer Message-ID: <20121113164655.GA9969@gmail.com> References: <20121113163456.GA25438@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20121113163456.GA25438@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 On Tue, Nov 13, 2012 at 08:34:56AM -0800, H.J. Lu wrote: > Hi, > > This patch adds support for GCC multilib run-time libraries to > libsanitizer. I have to delete install-sh. Otherwise ac_aux_dir will > be wrong: > > ac_aux_dir= > for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do > for ac_t in install-sh install.sh shtool; do > if test -f "$ac_dir/$ac_t"; then > ac_aux_dir=$ac_dir > ac_install_sh="$ac_aux_dir/$ac_t -c" > break 2 > fi > > Tested with GCC autoconf/automake on Linux/x86-64. OK to install? > Here is a smaller patch without removing install-sh. Instead, it sets AC_CONFIG_AUX_DIR to "..". OK to install? Thanks. H.J. --- PR other/55291 * acinclude.m4: New file. * Makefile.am (ACLOCAL_AMFLAGS): New. * configure.ac (AC_PREREQ): Set to 2.64. (AC_CONFIG_AUX_DIR): Set to "..". (--enable-version-specific-runtime-libs): New option. (AC_CANONICAL_SYSTEM): New. (AM_ENABLE_MULTILIB): Moved right after AM_INIT_AUTOMAKE. (toolexecdir): Support multilib. (toolexeclibdir): Likewise. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise. * asan/Makefile.in: Likewise. * interception/Makefile.in: Likewise. * sanitizer_common/Makefile.in: Likewise. --- libsanitizer/Makefile.am | 2 ++ libsanitizer/acinclude.m4 | 10 ++++++++ libsanitizer/configure.ac | 63 ++++++++++++++++++++++++++++++++++++++-------- diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am index b28eb32..91e3434 100644 --- a/libsanitizer/Makefile.am +++ b/libsanitizer/Makefile.am @@ -1,3 +1,5 @@ +ACLOCAL_AMFLAGS = -I .. -I ../config + SUBDIRS = interception sanitizer_common asan # Work around what appears to be a GNU make bug handling MAKEFLAGS diff --git a/libsanitizer/acinclude.m4 b/libsanitizer/acinclude.m4 new file mode 100644 index 0000000..7be603e --- /dev/null +++ b/libsanitizer/acinclude.m4 @@ -0,0 +1,10 @@ +dnl ---------------------------------------------------------------------- +dnl This whole bit snagged from libgfortran. + +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring an installed +dnl libtool.m4 into aclocal.m4, while still arranging for automake to +dnl add a definition of LIBTOOL to Makefile.in. +ifelse(,,,[AC_SUBST(LIBTOOL) +AC_DEFUN([AC_LIBTOOL_DLOPEN]) +]) diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index 3f186c2..6129536 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -1,11 +1,61 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -AC_PREREQ([2.68]) +AC_PREREQ([2.64]) AC_INIT(package-unused, version-unused, libsanitizer) AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h]) -AC_CONFIG_AUX_DIR(.) +AC_CONFIG_AUX_DIR(..) + +AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) +AC_ARG_ENABLE(version-specific-runtime-libs, +[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ], +[case "$enableval" in + yes) version_specific_libs=yes ;; + no) version_specific_libs=no ;; + *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; + esac], +[version_specific_libs=no]) +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 + +target_alias=${target_alias-$host_alias} +AC_SUBST(target_alias) + AM_INIT_AUTOMAKE(foreign) +AM_ENABLE_MULTILIB(, ..) + +# Calculate toolexeclibdir +# Also toolexecdir, though it's only used in toolexeclibdir +case ${version_specific_libs} in + yes) + # Need the gcc compiler version to know where to install libraries + # and header files if --enable-version-specific-runtime-libs option + # is selected. + toolexecdir='$(libdir)/gcc/$(target_alias)' + toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)' + ;; + no) + if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + # Install a library built with a cross compiler in tooldir, not libdir. + toolexecdir='$(exec_prefix)/$(target_alias)' + toolexeclibdir='$(toolexecdir)/lib' + else + toolexecdir='$(libdir)/gcc-lib/$(target_alias)' + toolexeclibdir='$(libdir)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in + .) ;; # Avoid trailing /. + *) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; + esac + ;; +esac +AC_SUBST(toolexecdir) +AC_SUBST(toolexeclibdir) # Checks for programs. AC_PROG_CC @@ -18,15 +68,6 @@ AM_PROG_LIBTOOL AC_SUBST(enable_shared) AC_SUBST(enable_static) -#AM_ENABLE_MULTILIB(, ..) -target_alias=${target_alias-$host_alias} -AC_SUBST(target_alias) - -toolexecdir='$(libdir)/gcc-lib/$(target_alias)' -toolexeclibdir='$(libdir)' -AC_SUBST(toolexecdir) -AC_SUBST(toolexeclibdir) - AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES(AC_FOREACH([DIR], [interception sanitizer_common asan], [DIR/Makefile ]),