public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
@ 2012-11-13 16:35 H.J. Lu
  2012-11-13 16:47 ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 16:35 UTC (permalink / raw)
  To: gcc-patches

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?

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): Removed.
	(--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.
	* install-sh: Removed.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.

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..30cb6c1 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -1,11 +1,60 @@
 #                                               -*- 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_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 +67,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 ]),
diff --git a/libsanitizer/install-sh b/libsanitizer/install-sh
deleted file mode 100644
index a9244eb..0000000
--- a/libsanitizer/install-sh
+++ /dev/null
@@ -1,527 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2011-01-19.21; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" ""	$nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
-     --help     display this help and exit.
-     --version  display version info and exit.
-
-  -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
-  -d            create directories instead of installing files.
-  -g GROUP      $chgrpprog installed files to GROUP.
-  -m MODE       $chmodprog installed files to MODE.
-  -o USER       $chownprog installed files to USER.
-  -s            $stripprog installed files.
-  -t DIRECTORY  install into DIRECTORY.
-  -T            report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
-  RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
-  case $1 in
-    -c) ;;
-
-    -C) copy_on_change=true;;
-
-    -d) dir_arg=true;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-	shift;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
-
-    -o) chowncmd="$chownprog $2"
-	shift;;
-
-    -s) stripcmd=$stripprog;;
-
-    -t) dst_arg=$2
-	# Protect names problematic for `test' and other utilities.
-	case $dst_arg in
-	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
-	esac
-	shift;;
-
-    -T) no_target_directory=true;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    --)	shift
-	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
-  esac
-  shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dst_arg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dst_arg"
-      shift # fnord
-    fi
-    shift # arg
-    dst_arg=$arg
-    # Protect names problematic for `test' and other utilities.
-    case $dst_arg in
-      -* | [=\(\)!]) dst_arg=./$dst_arg;;
-    esac
-  done
-fi
-
-if test $# -eq 0; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call `install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-if test -z "$dir_arg"; then
-  do_exit='(exit $ret); exit $ret'
-  trap "ret=129; $do_exit" 1
-  trap "ret=130; $do_exit" 2
-  trap "ret=141; $do_exit" 13
-  trap "ret=143; $do_exit" 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
-for src
-do
-  # Protect names problematic for `test' and other utilities.
-  case $src in
-    -* | [=\(\)!]) src=./$src;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
-
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dst_arg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-    dst=$dst_arg
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
-      fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
-    fi
-  fi
-
-  obsolete_mkdir_used=false
-
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
-
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
-
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
-
-      case $dstdir in
-	/*) prefix='/';;
-	[-=\(\)!]*) prefix='./';;
-	*)  prefix='';;
-      esac
-
-      eval "$initialize_posix_glob"
-
-      oIFS=$IFS
-      IFS=/
-      $posix_glob set -f
-      set fnord $dstdir
-      shift
-      $posix_glob set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test X"$d" = X && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
-      fi
-    fi
-  fi
-
-  if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
-  else
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
-    # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
-    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # If -C, don't bother to copy if it wouldn't change the file.
-    if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
-       set X $old && old=:$2:$4:$5:$6 &&
-       set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
-       test "$old" = "$new" &&
-       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
-    then
-      rm -f "$dsttmp"
-    else
-      # Rename the file to the real destination.
-      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
-      # The rename failed, perhaps because mv can't rename something else
-      # to itself, or perhaps because mv is so ancient that it does not
-      # support -f.
-      {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
-      }
-    fi || exit 1
-
-    trap '' 0
-  fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 16:35 [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer H.J. Lu
@ 2012-11-13 16:47 ` H.J. Lu
  2012-11-13 16:56   ` Jakub Jelinek
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 16:47 UTC (permalink / raw)
  To: gcc-patches

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 ]),
-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 16:47 ` H.J. Lu
@ 2012-11-13 16:56   ` Jakub Jelinek
  2012-11-13 17:03     ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Jakub Jelinek @ 2012-11-13 16:56 UTC (permalink / raw)
  To: H.J. Lu, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Paolo Bonzini, Ralf Wildenhues
  Cc: gcc-patches

On Tue, Nov 13, 2012 at 08:46:55AM -0800, H.J. Lu wrote:
> On Tue, Nov 13, 2012 at 08:34:56AM -0800, H.J. Lu wrote:
> > 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?

I believe libsanitizer/install-sh wasn't imported from LLVM, and
if it is not needed in the GCC tree, it IMHO should be just removed.
Similarly libsanitizer/missing, maybe libsanitizer/depcomp (the former
one isn't present in any other lib*/ in gcc, the latter only in boehm-gc,
so I'd guess non-essential).  Ditto ltmain.sh, config.sub, config.guess.

libsanitizer/ChangeLog.asan should probably be just libsanitizer/ChangeLog.

In any case, I'd prefer if configury maintainers could review that.

	Jakub

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 16:56   ` Jakub Jelinek
@ 2012-11-13 17:03     ` H.J. Lu
  2012-11-13 22:30       ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 17:03 UTC (permalink / raw)
  To: Jakub Jelinek
  Cc: Alexandre Oliva, Dodji Seketeli, DJ Delorie, Paolo Bonzini,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 8:56 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Tue, Nov 13, 2012 at 08:46:55AM -0800, H.J. Lu wrote:
>> On Tue, Nov 13, 2012 at 08:34:56AM -0800, H.J. Lu wrote:
>> > 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?
>
> I believe libsanitizer/install-sh wasn't imported from LLVM, and
> if it is not needed in the GCC tree, it IMHO should be just removed.
> Similarly libsanitizer/missing, maybe libsanitizer/depcomp (the former
> one isn't present in any other lib*/ in gcc, the latter only in boehm-gc,
> so I'd guess non-essential).  Ditto ltmain.sh, config.sub, config.guess.

That is true.  Those files aren't used in GCC tree.

> libsanitizer/ChangeLog.asan should probably be just libsanitizer/ChangeLog.
>
> In any case, I'd prefer if configury maintainers could review that.

Sure.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 17:03     ` H.J. Lu
@ 2012-11-13 22:30       ` Paolo Bonzini
       [not found]         ` <CAMe9rOqbv1rmOExJ-NLzMA789YhwqjeWSJwQfnSxq-_PwGrBgw@mail.gmail.com>
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-13 22:30 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

Il 13/11/2012 18:03, H.J. Lu ha scritto:
>> > libsanitizer/ChangeLog.asan should probably be just libsanitizer/ChangeLog.
>> >
>> > In any case, I'd prefer if configury maintainers could review that.
> Sure.

Let's first remove the files that are duplicated between the toplevel
and libsanitizer/.  This is preapproved after a successful bootstrap,
but please remember to rerun autoconf/automake in the libsanitizer/
directory.

Then, IIUC, H.J.'s first patch can be applied; I'll try to review it
tomorrow, otherwise please ping me again 1-2 days after removing the
duplicated files.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
       [not found]         ` <CAMe9rOqbv1rmOExJ-NLzMA789YhwqjeWSJwQfnSxq-_PwGrBgw@mail.gmail.com>
@ 2012-11-13 23:03           ` Paolo Bonzini
  2012-11-13 23:16             ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-13 23:03 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

Il 13/11/2012 23:45, H.J. Lu ha scritto:
>> >
>> > Let's first remove the files that are duplicated between the toplevel
>> > and libsanitizer/.  This is preapproved after a successful bootstrap,
>> > but please remember to rerun autoconf/automake in the libsanitizer/
>> > directory.
> We can't remove duplicated files without fixing configure.ac
> first.

What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?

I really would prefer to do it in the order I mentioned above.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:03           ` Paolo Bonzini
@ 2012-11-13 23:16             ` H.J. Lu
  2012-11-13 23:20               ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 23:16 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 3:03 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 13/11/2012 23:45, H.J. Lu ha scritto:
>>> >
>>> > Let's first remove the files that are duplicated between the toplevel
>>> > and libsanitizer/.  This is preapproved after a successful bootstrap,
>>> > but please remember to rerun autoconf/automake in the libsanitizer/
>>> > directory.
>> We can't remove duplicated files without fixing configure.ac
>> first.
>
> What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?
>
> I really would prefer to do it in the order I mentioned above.

We also need

[hjl@gnu-tools-1 libsanitizer]$ cat acinclude.m4
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([AM_PROG_LIBTOOL])
])
[hjl@gnu-tools-1 libsanitizer]$

Otherwise, autoconf won't work.

-- 
H.J.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:16             ` H.J. Lu
@ 2012-11-13 23:20               ` Paolo Bonzini
  2012-11-13 23:27                 ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-13 23:20 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

Il 14/11/2012 00:16, H.J. Lu ha scritto:
>> > What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?
>> >
>> > I really would prefer to do it in the order I mentioned above.
> We also need
> 
> [hjl@gnu-tools-1 libsanitizer]$ cat acinclude.m4
> 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([AM_PROG_LIBTOOL])
> ])
> [hjl@gnu-tools-1 libsanitizer]$
> 
> Otherwise, autoconf won't work.

Sure, that's fine to include too.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:20               ` Paolo Bonzini
@ 2012-11-13 23:27                 ` H.J. Lu
  2012-11-13 23:31                   ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 23:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 3:19 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 14/11/2012 00:16, H.J. Lu ha scritto:
>>> > What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?
>>> >
>>> > I really would prefer to do it in the order I mentioned above.
>> We also need
>>
>> [hjl@gnu-tools-1 libsanitizer]$ cat acinclude.m4
>> 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([AM_PROG_LIBTOOL])
>> ])
>> [hjl@gnu-tools-1 libsanitizer]$
>>
>> Otherwise, autoconf won't work.
>
> Sure, that's fine to include too.
>

We need all changes in:

	* 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.

Missing one will cause a problem.

-- 
H.J.
---
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..8e606e7
--- /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([AM_PROG_LIBTOOL])
+])
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 3f186c2..47a44d3 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -1,11 +1,60 @@
 #                                               -*- 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 sho
uld 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 +67,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/Ma
kefile ]),
-- 
1.7.11.7

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:27                 ` H.J. Lu
@ 2012-11-13 23:31                   ` Paolo Bonzini
  2012-11-13 23:43                     ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-13 23:31 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

Il 14/11/2012 00:27, H.J. Lu ha scritto:
> On Tue, Nov 13, 2012 at 3:19 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> Il 14/11/2012 00:16, H.J. Lu ha scritto:
>>>>> What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?
>>>>>
>>>>> I really would prefer to do it in the order I mentioned above.
>>> We also need
>>>
>>> [hjl@gnu-tools-1 libsanitizer]$ cat acinclude.m4
>>> 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([AM_PROG_LIBTOOL])
>>> ])
>>> [hjl@gnu-tools-1 libsanitizer]$
>>>
>>> Otherwise, autoconf won't work.
>>
>> Sure, that's fine to include too.
>>
> 
> We need all changes in:
> 
> 	* 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.
> 
> Missing one will cause a problem.

I don't understand why removing files needs
--enable-version-specific-runtime-libs or multilibs.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:31                   ` Paolo Bonzini
@ 2012-11-13 23:43                     ` H.J. Lu
  2012-11-13 23:48                       ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-13 23:43 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 3:31 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 14/11/2012 00:27, H.J. Lu ha scritto:
>> On Tue, Nov 13, 2012 at 3:19 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>>> Il 14/11/2012 00:16, H.J. Lu ha scritto:
>>>>>> What has to be fixed about it?  Anything except AC_PREREQ/AC_CONFIG_AUX_DIR?
>>>>>>
>>>>>> I really would prefer to do it in the order I mentioned above.
>>>> We also need
>>>>
>>>> [hjl@gnu-tools-1 libsanitizer]$ cat acinclude.m4
>>>> 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([AM_PROG_LIBTOOL])
>>>> ])
>>>> [hjl@gnu-tools-1 libsanitizer]$
>>>>
>>>> Otherwise, autoconf won't work.
>>>
>>> Sure, that's fine to include too.
>>>
>>
>> We need all changes in:
>>
>>       * 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.
>>
>> Missing one will cause a problem.
>
> I don't understand why removing files needs
> --enable-version-specific-runtime-libs or multilibs.
>

This works.

-- 
H.J.
--2012-11-13  H.J. Lu  <hongjiu.lu@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.

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..8e606e7
--- /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([AM_PROG_LIBTOOL])
+])
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 3f186c2..cd57a69 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -1,10 +1,10 @@
 #                                               -*- 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(..)
 AM_INIT_AUTOMAKE(foreign)

 # Checks for programs.
-

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:43                     ` H.J. Lu
@ 2012-11-13 23:48                       ` Paolo Bonzini
  2012-11-14  9:58                         ` Markus Trippelsdorf
                                           ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-13 23:48 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

Il 14/11/2012 00:43, H.J. Lu ha scritto:
> This works.

Ok, then please test remove install-sh and friends and do
autoconf/automake again.  If it works, commit the result (I don't care
if you make it one or two commits).

Then, wait 24 hours for breakages and commit the multilib patch.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:48                       ` Paolo Bonzini
@ 2012-11-14  9:58                         ` Markus Trippelsdorf
  2012-11-14 10:24                           ` Markus Trippelsdorf
  2012-11-14 12:23                         ` H.J. Lu
  2012-11-14 16:22                         ` H.J. Lu
  2 siblings, 1 reply; 25+ messages in thread
From: Markus Trippelsdorf @ 2012-11-14  9:58 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: H.J. Lu, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On 2012.11.14 at 00:48 +0100, Paolo Bonzini wrote:
> Il 14/11/2012 00:43, H.J. Lu ha scritto:
> > This works.
> 
> Ok, then please test remove install-sh and friends and do
> autoconf/automake again.  If it works, commit the result (I don't care
> if you make it one or two commits).
> 
> Then, wait 24 hours for breakages and commit the multilib patch.

This doesn't work on my system (with autoconf=2.69 installed)

configure.ac:5: error: Please use exactly Autoconf 2.64 instead of 2.69.
../config/override.m4:12: _GCC_AUTOCONF_VERSION_CHECK is expanded
from...
configure.ac:5: the top level
autom4te-2.69: m4 failed with exit status: 1
aclocal-1.11: autom4te failed with exit status: 1

make[2]: *** [/home/markus/gcc/libsanitizer/aclocal.m4] Error 1
make[2]: Leaving directory
`/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer'


-- 
Markus

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-14  9:58                         ` Markus Trippelsdorf
@ 2012-11-14 10:24                           ` Markus Trippelsdorf
  0 siblings, 0 replies; 25+ messages in thread
From: Markus Trippelsdorf @ 2012-11-14 10:24 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: H.J. Lu, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On 2012.11.14 at 10:57 +0100, Markus Trippelsdorf wrote:
> On 2012.11.14 at 00:48 +0100, Paolo Bonzini wrote:
> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
> > > This works.
> > 
> > Ok, then please test remove install-sh and friends and do
> > autoconf/automake again.  If it works, commit the result (I don't care
> > if you make it one or two commits).
> > 
> > Then, wait 24 hours for breakages and commit the multilib patch.
> 
> This doesn't work on my system (with autoconf=2.69 installed)
> 
> configure.ac:5: error: Please use exactly Autoconf 2.64 instead of 2.69.
> ../config/override.m4:12: _GCC_AUTOCONF_VERSION_CHECK is expanded
> from...
> configure.ac:5: the top level
> autom4te-2.69: m4 failed with exit status: 1
> aclocal-1.11: autom4te failed with exit status: 1
> 
> make[2]: *** [/home/markus/gcc/libsanitizer/aclocal.m4] Error 1
> make[2]: Leaving directory
> `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer'

With the right autotools installed locally, running:

ACLOCAL='aclocal -I .. -I ../config' autoreconf -v && rm -fr autom4te.cache

in gcc/libsanitizer and committing the diff should fix the issue.

-- 
Markus

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:48                       ` Paolo Bonzini
  2012-11-14  9:58                         ` Markus Trippelsdorf
@ 2012-11-14 12:23                         ` H.J. Lu
  2012-11-14 16:22                         ` H.J. Lu
  2 siblings, 0 replies; 25+ messages in thread
From: H.J. Lu @ 2012-11-14 12:23 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 14/11/2012 00:43, H.J. Lu ha scritto:
>> This works.
>
> Ok, then please test remove install-sh and friends and do
> autoconf/automake again.  If it works, commit the result (I don't care
> if you make it one or two commits).
>
> Then, wait 24 hours for breakages and commit the multilib patch.
>
> Paolo

GCC target libraries don't set AC_CONFIG_AUX_DIR.  I checked
in this patch to remove it and fix Makefile.in.

-- 
H.J.
---
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 6074d5b..c67c7f1 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* configure.ac (AC_CONFIG_AUX_DIR): Removed.
+	* Makefile.in: Regenerated.
+	* configure: Likewise.
+
 2012-11-13  H.J. Lu  <hongjiu.lu@intel.com>

 	PR other/55304
diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in
index 8049a7e..babe91f 100644
--- a/libsanitizer/Makefile.in
+++ b/libsanitizer/Makefile.in
@@ -38,11 +38,7 @@ DIST_COMMON = $(am__configure_deps)
$(srcdir)/../config.guess \
 	$(srcdir)/../config.sub $(srcdir)/../install-sh \
 	$(srcdir)/../ltmain.sh $(srcdir)/../missing \
 	$(srcdir)/../mkinstalldirs $(srcdir)/Makefile.am \
-	$(srcdir)/Makefile.in $(top_srcdir)/configure ../ABOUT-NLS \
-	../COPYING ../COPYING.LIB ../ChangeLog ../README ../compile \
-	../config.guess ../config.rpath ../config.sub ../depcomp \
-	../install-sh ../ltmain.sh ../missing ../mkinstalldirs \
-	../ylwrap
+	$(srcdir)/Makefile.in $(top_srcdir)/configure ChangeLog
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
 	$(top_srcdir)/../config/lead-dot.m4 \
diff --git a/libsanitizer/configure b/libsanitizer/configure
index ba6fe67..d69f5a7 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -2215,8 +2215,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu



+am__api_version='1.11'
+
 ac_aux_dir=
-for ac_dir in .. "$srcdir"/..; do
+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
@@ -2226,7 +2228,7 @@ for ac_dir in .. "$srcdir"/..; do
   done
 done
 if test -z "$ac_aux_dir"; then
-  as_fn_error "cannot find install-sh, install.sh, or shtool in ..
\"$srcdir\"/.." "$LINENO" 5
+  as_fn_error "cannot find install-sh, install.sh, or shtool in
\"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
 fi

 # These three variables are undocumented and unsupported,
@@ -2238,8 +2240,6 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  #
Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.


-am__api_version='1.11'
-
 # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index cd57a69..0b6cdef 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -4,7 +4,6 @@
 AC_PREREQ([2.64])
 AC_INIT(package-unused, version-unused, libsanitizer)
 AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
-AC_CONFIG_AUX_DIR(..)
 AM_INIT_AUTOMAKE(foreign)

 # Checks for programs.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-13 23:48                       ` Paolo Bonzini
  2012-11-14  9:58                         ` Markus Trippelsdorf
  2012-11-14 12:23                         ` H.J. Lu
@ 2012-11-14 16:22                         ` H.J. Lu
  2012-11-15  8:48                           ` Markus Trippelsdorf
  2 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-14 16:22 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Jakub Jelinek, Alexandre Oliva, Dodji Seketeli, DJ Delorie,
	Ralf Wildenhues, gcc-patches

On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 14/11/2012 00:43, H.J. Lu ha scritto:
>> This works.
>
> Ok, then please test remove install-sh and friends and do
> autoconf/automake again.  If it works, commit the result (I don't care
> if you make it one or two commits).
>
> Then, wait 24 hours for breakages and commit the multilib patch.
>
> Paolo

This is the multilib patch I will commit later.

-- 
H.J.
---
2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>

	PR other/55291
	* configure.ac (--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.
	(multilib_arg): New.
	* Makefile.in: Regenerated.
	* aclocal.m4: Likewise.
	* configure: Likewise.
	* asan/Makefile.in: Likewise.
	* interception/Makefile.in: Likewise.
	* sanitizer_common/Makefile.in: Likewise.

diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 0b6cdef..27a7f95 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -4,7 +4,56 @@
 AC_PREREQ([2.64])
 AC_INIT(package-unused, version-unused, libsanitizer)
 AC_CONFIG_SRCDIR([include/sanitizer/common_interface_defs.h])
+
+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
@@ -17,14 +66,11 @@ 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)
+if test "${multilib}" = "yes"; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi

 AC_CONFIG_FILES([Makefile])

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-14 16:22                         ` H.J. Lu
@ 2012-11-15  8:48                           ` Markus Trippelsdorf
  2012-11-15 14:01                             ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Markus Trippelsdorf @ 2012-11-15  8:48 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
> >> This works.
> >
> > Ok, then please test remove install-sh and friends and do
> > autoconf/automake again.  If it works, commit the result (I don't care
> > if you make it one or two commits).
> >
> > Then, wait 24 hours for breakages and commit the multilib patch.
> >
> > Paolo
> 
> This is the multilib patch I will commit later.

And it still doesn't work (after applying the fix in my other reply):

make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
 /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1

-- 
Markus

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15  8:48                           ` Markus Trippelsdorf
@ 2012-11-15 14:01                             ` H.J. Lu
  2012-11-15 14:19                               ` Markus Trippelsdorf
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-15 14:01 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On Thu, Nov 15, 2012 at 12:47 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
>> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
>> >> This works.
>> >
>> > Ok, then please test remove install-sh and friends and do
>> > autoconf/automake again.  If it works, commit the result (I don't care
>> > if you make it one or two commits).
>> >
>> > Then, wait 24 hours for breakages and commit the multilib patch.
>> >
>> > Paolo
>>
>> This is the multilib patch I will commit later.
>
> And it still doesn't work (after applying the fix in my other reply):
>
> make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
>  /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>  /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
> libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
> make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
>

It works for me.  Did you do

# ./contrib/gcc_update --touch

-- 
H.J.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 14:01                             ` H.J. Lu
@ 2012-11-15 14:19                               ` Markus Trippelsdorf
  2012-11-15 14:44                                 ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Markus Trippelsdorf @ 2012-11-15 14:19 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On 2012.11.15 at 06:01 -0800, H.J. Lu wrote:
> On Thu, Nov 15, 2012 at 12:47 AM, Markus Trippelsdorf
> <markus@trippelsdorf.de> wrote:
> > On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
> >> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
> >> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
> >> >> This works.
> >> >
> >> > Ok, then please test remove install-sh and friends and do
> >> > autoconf/automake again.  If it works, commit the result (I don't care
> >> > if you make it one or two commits).
> >> >
> >> > Then, wait 24 hours for breakages and commit the multilib patch.
> >> >
> >> > Paolo
> >>
> >> This is the multilib patch I will commit later.
> >
> > And it still doesn't work (after applying the fix in my other reply):
> >
> > make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
> >  /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
> >  /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
> > libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
> > make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
> >
> 
> It works for me.  Did you do
> 
> # ./contrib/gcc_update --touch

Yes.
I've used the following to configure gcc:

~/gcc/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-libsanitizer --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-initfini-array --with-gold --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/python --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-bootstrap --with-boot-ldflags="-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections" --enable-version-specific-runtime-libs --disable-libstdcxx-pch --enable-libstdcxx-time=yes

-- 
Markus

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 14:19                               ` Markus Trippelsdorf
@ 2012-11-15 14:44                                 ` H.J. Lu
  2012-11-15 15:14                                   ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-15 14:44 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On Thu, Nov 15, 2012 at 6:19 AM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> On 2012.11.15 at 06:01 -0800, H.J. Lu wrote:
>> On Thu, Nov 15, 2012 at 12:47 AM, Markus Trippelsdorf
>> <markus@trippelsdorf.de> wrote:
>> > On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
>> >> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> >> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
>> >> >> This works.
>> >> >
>> >> > Ok, then please test remove install-sh and friends and do
>> >> > autoconf/automake again.  If it works, commit the result (I don't care
>> >> > if you make it one or two commits).
>> >> >
>> >> > Then, wait 24 hours for breakages and commit the multilib patch.
>> >> >
>> >> > Paolo
>> >>
>> >> This is the multilib patch I will commit later.
>> >
>> > And it still doesn't work (after applying the fix in my other reply):
>> >
>> > make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
>> >  /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>> >  /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>> > libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
>> > make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
>> >
>>
>> It works for me.  Did you do
>>
>> # ./contrib/gcc_update --touch
>
> Yes.
> I've used the following to configure gcc:
>
> ~/gcc/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-libsanitizer --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-initfini-array --with-gold --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/python --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-bootstrap --with-boot-ldflags="-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections" --enable-version-specific-runtime-libs --disable-libstdcxx-pch --enable-libstdcxx-time=yes
>
> --
> Markus

I can reproduce it with --enable-version-specific-runtime-libs.  I am
taking a look.

-- 
H.J.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 14:44                                 ` H.J. Lu
@ 2012-11-15 15:14                                   ` H.J. Lu
  2012-11-15 16:02                                     ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-15 15:14 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On Thu, Nov 15, 2012 at 6:44 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Nov 15, 2012 at 6:19 AM, Markus Trippelsdorf
> <markus@trippelsdorf.de> wrote:
>> On 2012.11.15 at 06:01 -0800, H.J. Lu wrote:
>>> On Thu, Nov 15, 2012 at 12:47 AM, Markus Trippelsdorf
>>> <markus@trippelsdorf.de> wrote:
>>> > On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
>>> >> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>>> >> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
>>> >> >> This works.
>>> >> >
>>> >> > Ok, then please test remove install-sh and friends and do
>>> >> > autoconf/automake again.  If it works, commit the result (I don't care
>>> >> > if you make it one or two commits).
>>> >> >
>>> >> > Then, wait 24 hours for breakages and commit the multilib patch.
>>> >> >
>>> >> > Paolo
>>> >>
>>> >> This is the multilib patch I will commit later.
>>> >
>>> > And it still doesn't work (after applying the fix in my other reply):
>>> >
>>> > make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
>>> >  /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>>> >  /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>>> > libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
>>> > make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
>>> >
>>>
>>> It works for me.  Did you do
>>>
>>> # ./contrib/gcc_update --touch
>>
>> Yes.
>> I've used the following to configure gcc:
>>
>> ~/gcc/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-libsanitizer --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-initfini-array --with-gold --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/python --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-bootstrap --with-boot-ldflags="-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections" --enable-version-specific-runtime-libs --disable-libstdcxx-pch --enable-libstdcxx-time=yes
>>
>> --
>> Markus
>
> I can reproduce it with --enable-version-specific-runtime-libs.  I am
> taking a look.
>

I am checking in this patch.

H.J.
---
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 62e884e..b740253 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* asan/Makefile.am (gcc_version): New.
+	* interception/Makefile.am (gcc_version): Likewise.
+	* sanitizer_common/Makefile.am (gcc_version): Likewise.
+	* asan/Makefile.in: Regenerated.
+	* interception/Makefile.in: Likewise.
+	* sanitizer_common/Makefile.in: Likewise.
+
 2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>

 	PR other/55291
diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am
index c76c158..5a0a8c5 100644
--- a/libsanitizer/asan/Makefile.am
+++ b/libsanitizer/asan/Makefile.am
@@ -1,5 +1,8 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir)

+# May be used by toolexeclibdir.
+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
 ACLOCAL_AMFLAGS = -I m4
diff --git a/libsanitizer/interception/Makefile.am
b/libsanitizer/interception/Makefile.am
index 4fd200c..b92a180 100644
--- a/libsanitizer/interception/Makefile.am
+++ b/libsanitizer/interception/Makefile.am
@@ -1,5 +1,8 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include

+# May be used by toolexeclibdir.
+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 -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4
diff --git a/libsanitizer/sanitizer_common/Makefile.am
b/libsanitizer/sanitizer_common/Makefile.am
index 70df1d9..2968c05 100644
--- a/libsanitizer/sanitizer_common/Makefile.am
+++ b/libsanitizer/sanitizer_common/Makefile.am
@@ -1,5 +1,8 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include

+# May be used by toolexeclibdir.
+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 -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 15:14                                   ` H.J. Lu
@ 2012-11-15 16:02                                     ` H.J. Lu
  2012-11-15 16:08                                       ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-15 16:02 UTC (permalink / raw)
  To: Markus Trippelsdorf
  Cc: Paolo Bonzini, Jakub Jelinek, Alexandre Oliva, Dodji Seketeli,
	DJ Delorie, Ralf Wildenhues, gcc-patches

On Thu, Nov 15, 2012 at 7:14 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Nov 15, 2012 at 6:44 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Thu, Nov 15, 2012 at 6:19 AM, Markus Trippelsdorf
>> <markus@trippelsdorf.de> wrote:
>>> On 2012.11.15 at 06:01 -0800, H.J. Lu wrote:
>>>> On Thu, Nov 15, 2012 at 12:47 AM, Markus Trippelsdorf
>>>> <markus@trippelsdorf.de> wrote:
>>>> > On 2012.11.14 at 08:21 -0800, H.J. Lu wrote:
>>>> >> On Tue, Nov 13, 2012 at 3:48 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
>>>> >> > Il 14/11/2012 00:43, H.J. Lu ha scritto:
>>>> >> >> This works.
>>>> >> >
>>>> >> > Ok, then please test remove install-sh and friends and do
>>>> >> > autoconf/automake again.  If it works, commit the result (I don't care
>>>> >> > if you make it one or two commits).
>>>> >> >
>>>> >> > Then, wait 24 hours for breakages and commit the multilib patch.
>>>> >> >
>>>> >> > Paolo
>>>> >>
>>>> >> This is the multilib patch I will commit later.
>>>> >
>>>> > And it still doesn't work (after applying the fix in my other reply):
>>>> >
>>>> > make[4]: Entering directory `/var/tmp/gcc_build_dir/x86_64-pc-linux-gnu/libsanitizer/asan'
>>>> >  /bin/mkdir -p '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>>>> >  /bin/sh ../libtool   --mode=install /usr/bin/install -c   libasan.la '/usr/lib/gcc/x86_64-pc-linux-gnu/'
>>>> > libtool: install: error: cannot install `libasan.la' to a directory not ending in /usr/lib/gcc/x86_64-pc-linux-gnu/
>>>> > make[4]: *** [install-toolexeclibLTLIBRARIES] Error 1
>>>> >
>>>>
>>>> It works for me.  Did you do
>>>>
>>>> # ./contrib/gcc_update --touch
>>>
>>> Yes.
>>> I've used the following to configure gcc:
>>>
>>> ~/gcc/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.0 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --enable-libsanitizer --enable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-initfini-array --with-gold --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --disable-libgomp --enable-cld --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.0/python --disable-libgcj --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-bootstrap --with-boot-ldflags="-Wl,-O1,--hash-style=gnu,--as-needed,--gc-sections" --enable-version-specific-runtime-libs --disable-libstdcxx-pch --enable-libstdcxx-time=yes
>>>
>>> --
>>> Markus
>>
>> I can reproduce it with --enable-version-specific-runtime-libs.  I am
>> taking a look.
>>
>
> I am checking in this patch.
>
This is what I checked in.


-- 
H.J.
---
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index 62e884e..9b2420f 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,14 @@
+2012-11-15  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* configure.ac: Properly set MULTISUBDIR.
+	* asan/Makefile.am (gcc_version): New.
+	* interception/Makefile.am (gcc_version): Likewise.
+	* sanitizer_common/Makefile.am (gcc_version): Likewise.
+	* configure: Regenerated.
+	* asan/Makefile.in: Likewise.
+	* interception/Makefile.in: Likewise.
+	* sanitizer_common/Makefile.in: Likewise.
+
 2012-11-14  H.J. Lu  <hongjiu.lu@intel.com>

 	PR other/55291
diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am
index c76c158..3da1db3 100644
--- a/libsanitizer/asan/Makefile.am
+++ b/libsanitizer/asan/Makefile.am
@@ -1,8 +1,11 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir)

+# May be used by toolexeclibdir.
+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
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config

 toolexeclib_LTLIBRARIES = libasan.la

diff --git a/libsanitizer/asan/Makefile.in b/libsanitizer/asan/Makefile.in
index e4b2b5c..451490f 100644
--- a/libsanitizer/asan/Makefile.in
+++ b/libsanitizer/asan/Makefile.in
@@ -235,8 +235,11 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -I $(top_srcdir)/include -I $(top_srcdir)
+
+# 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
-fomit-frame-pointer -funwind-tables -fvisibility=hidden
-Wno-variadic-macros -Wno-c99-extensions
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config
 toolexeclib_LTLIBRARIES = libasan.la
 asan_files = \
 	asan_allocator.cc \
diff --git a/libsanitizer/configure b/libsanitizer/configure
index f42d2ac..9fbfccb 100755
--- a/libsanitizer/configure
+++ b/libsanitizer/configure
@@ -16693,6 +16693,9 @@ _EOF
    mv tmp$$ $ac_file
    rm vpsed$$
    echo 'MULTISUBDIR =' >> $ac_file
+   ml_norecursion=yes
+   . ${multi_basedir}/config-ml.in
+   { ml_norecursion=; unset ml_norecursion;}
  ;;
     "sanitizer_common/Makefile":F) cat > vpsed$$ << \_EOF
 s!`test -f '$<' || echo '$(srcdir)/'`!!
@@ -16701,6 +16704,9 @@ _EOF
    mv tmp$$ $ac_file
    rm vpsed$$
    echo 'MULTISUBDIR =' >> $ac_file
+   ml_norecursion=yes
+   . ${multi_basedir}/config-ml.in
+   { ml_norecursion=; unset ml_norecursion;}
  ;;
     "asan/Makefile":F) cat > vpsed$$ << \_EOF
 s!`test -f '$<' || echo '$(srcdir)/'`!!
@@ -16709,6 +16715,9 @@ _EOF
    mv tmp$$ $ac_file
    rm vpsed$$
    echo 'MULTISUBDIR =' >> $ac_file
+   ml_norecursion=yes
+   . ${multi_basedir}/config-ml.in
+   { ml_norecursion=; unset ml_norecursion;}
  ;;

   esac
diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 27a7f95..76a19b6 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -82,6 +82,9 @@ _EOF
    mv tmp$$ $ac_file
    rm vpsed$$
    echo 'MULTISUBDIR =' >> $ac_file
+   ml_norecursion=yes
+   . ${multi_basedir}/config-ml.in
+   AS_UNSET([ml_norecursion])
 ])

 AC_OUTPUT
diff --git a/libsanitizer/interception/Makefile.am
b/libsanitizer/interception/Makefile.am
index 4fd200c..b92a180 100644
--- a/libsanitizer/interception/Makefile.am
+++ b/libsanitizer/interception/Makefile.am
@@ -1,5 +1,8 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include

+# May be used by toolexeclibdir.
+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 -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4
diff --git a/libsanitizer/interception/Makefile.in
b/libsanitizer/interception/Makefile.in
index fa60646..a746ae5 100644
--- a/libsanitizer/interception/Makefile.in
+++ b/libsanitizer/interception/Makefile.in
@@ -203,6 +203,9 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -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
-fomit-frame-pointer -funwind-tables -fvisibility=hidden
-Wno-variadic-macros -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4
 noinst_LTLIBRARIES = libinterception.la
diff --git a/libsanitizer/sanitizer_common/Makefile.am
b/libsanitizer/sanitizer_common/Makefile.am
index 70df1d9..2968c05 100644
--- a/libsanitizer/sanitizer_common/Makefile.am
+++ b/libsanitizer/sanitizer_common/Makefile.am
@@ -1,5 +1,8 @@
 AM_CPPFLAGS = -I $(top_srcdir)/include

+# May be used by toolexeclibdir.
+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 -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4
diff --git a/libsanitizer/sanitizer_common/Makefile.in
b/libsanitizer/sanitizer_common/Makefile.in
index 42e08a0..1e6098c 100644
--- a/libsanitizer/sanitizer_common/Makefile.in
+++ b/libsanitizer/sanitizer_common/Makefile.in
@@ -208,6 +208,9 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AM_CPPFLAGS = -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
-fomit-frame-pointer -funwind-tables -fvisibility=hidden
-Wno-variadic-macros -Wno-c99-extensions
 ACLOCAL_AMFLAGS = -I m4
 noinst_LTLIBRARIES = libsanitizer_common.la

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 16:02                                     ` H.J. Lu
@ 2012-11-15 16:08                                       ` Paolo Bonzini
  2012-11-15 16:29                                         ` H.J. Lu
  0 siblings, 1 reply; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-15 16:08 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Markus Trippelsdorf, Jakub Jelinek, Alexandre Oliva,
	Dodji Seketeli, DJ Delorie, Ralf Wildenhues, gcc-patches

Il 15/11/2012 17:02, H.J. Lu ha scritto:
>>> >> I can reproduce it with --enable-version-specific-runtime-libs.  I am
>>> >> taking a look.
>>> >>
>> >
>> > I am checking in this patch.
>> >
> This is what I checked in.

libssp et al. do not need any of this stuff.

What's special about libsanitizer?

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 16:08                                       ` Paolo Bonzini
@ 2012-11-15 16:29                                         ` H.J. Lu
  2012-11-15 16:31                                           ` Paolo Bonzini
  0 siblings, 1 reply; 25+ messages in thread
From: H.J. Lu @ 2012-11-15 16:29 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Markus Trippelsdorf, Jakub Jelinek, Alexandre Oliva,
	Dodji Seketeli, DJ Delorie, Ralf Wildenhues, gcc-patches

On Thu, Nov 15, 2012 at 8:08 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> Il 15/11/2012 17:02, H.J. Lu ha scritto:
>>>> >> I can reproduce it with --enable-version-specific-runtime-libs.  I am
>>>> >> taking a look.
>>>> >>
>>> >
>>> > I am checking in this patch.
>>> >
>> This is what I checked in.
>
> libssp et al. do not need any of this stuff.
>
> What's special about libsanitizer?
>
> Paolo

Did you mean the

diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
index 27a7f95..76a19b6 100644
--- a/libsanitizer/configure.ac
+++ b/libsanitizer/configure.ac
@@ -82,6 +82,9 @@ _EOF
    mv tmp$$ $ac_file
    rm vpsed$$
    echo 'MULTISUBDIR =' >> $ac_file
+   ml_norecursion=yes
+   . ${multi_basedir}/config-ml.in
+   AS_UNSET([ml_norecursion])
 ])

part?  libstdc++ and libsanitizer are only libraries which need
it since they build libraries in subdirectories.  From
libstdc++-v3/configure.ac:

# Multilibs need MULTISUBDIR defined correctly in certain makefiles so
# that multilib installs will end up installed in the correct place.
# The testsuite needs it for multilib-aware ABI baseline files.
# To work around this not being passed down from config-ml.in ->
# srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually
# append it here.  Only modify Makefiles that have just been created.
#


-- 
H.J.

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer
  2012-11-15 16:29                                         ` H.J. Lu
@ 2012-11-15 16:31                                           ` Paolo Bonzini
  0 siblings, 0 replies; 25+ messages in thread
From: Paolo Bonzini @ 2012-11-15 16:31 UTC (permalink / raw)
  To: H.J. Lu
  Cc: Markus Trippelsdorf, Jakub Jelinek, Alexandre Oliva,
	Dodji Seketeli, DJ Delorie, Ralf Wildenhues, gcc-patches

Il 15/11/2012 17:28, H.J. Lu ha scritto:
> On Thu, Nov 15, 2012 at 8:08 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
>> Il 15/11/2012 17:02, H.J. Lu ha scritto:
>>>>>>> I can reproduce it with --enable-version-specific-runtime-libs.  I am
>>>>>>> taking a look.
>>>>>>>
>>>>>
>>>>> I am checking in this patch.
>>>>>
>>> This is what I checked in.
>>
>> libssp et al. do not need any of this stuff.
>>
>> What's special about libsanitizer?
>>
>> Paolo
> 
> Did you mean the
> 
> diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac
> index 27a7f95..76a19b6 100644
> --- a/libsanitizer/configure.ac
> +++ b/libsanitizer/configure.ac
> @@ -82,6 +82,9 @@ _EOF
>     mv tmp$$ $ac_file
>     rm vpsed$$
>     echo 'MULTISUBDIR =' >> $ac_file
> +   ml_norecursion=yes
> +   . ${multi_basedir}/config-ml.in
> +   AS_UNSET([ml_norecursion])
>  ])
> 
> part?  libstdc++ and libsanitizer are only libraries which need
> it since they build libraries in subdirectories.

I see, thanks.

Paolo

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-11-15 16:31 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-13 16:35 [PATCH] PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer H.J. Lu
2012-11-13 16:47 ` H.J. Lu
2012-11-13 16:56   ` Jakub Jelinek
2012-11-13 17:03     ` H.J. Lu
2012-11-13 22:30       ` Paolo Bonzini
     [not found]         ` <CAMe9rOqbv1rmOExJ-NLzMA789YhwqjeWSJwQfnSxq-_PwGrBgw@mail.gmail.com>
2012-11-13 23:03           ` Paolo Bonzini
2012-11-13 23:16             ` H.J. Lu
2012-11-13 23:20               ` Paolo Bonzini
2012-11-13 23:27                 ` H.J. Lu
2012-11-13 23:31                   ` Paolo Bonzini
2012-11-13 23:43                     ` H.J. Lu
2012-11-13 23:48                       ` Paolo Bonzini
2012-11-14  9:58                         ` Markus Trippelsdorf
2012-11-14 10:24                           ` Markus Trippelsdorf
2012-11-14 12:23                         ` H.J. Lu
2012-11-14 16:22                         ` H.J. Lu
2012-11-15  8:48                           ` Markus Trippelsdorf
2012-11-15 14:01                             ` H.J. Lu
2012-11-15 14:19                               ` Markus Trippelsdorf
2012-11-15 14:44                                 ` H.J. Lu
2012-11-15 15:14                                   ` H.J. Lu
2012-11-15 16:02                                     ` H.J. Lu
2012-11-15 16:08                                       ` Paolo Bonzini
2012-11-15 16:29                                         ` H.J. Lu
2012-11-15 16:31                                           ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).