Patchwork PR other/55291: Add support for GCC multilib run-time libraries to libsanitizer

login
register
mail settings
Submitter H.J. Lu
Date Nov. 15, 2012, 4:02 p.m.
Message ID <CAMe9rOoYBZR+2vacAkdVXbX5dkQhctipxzBbv-xkLeV7xFn3bg@mail.gmail.com>
Download mbox | patch
Permalink /patch/199335/
State New
Headers show

Comments

H.J. Lu - Nov. 15, 2012, 4:02 p.m.
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.
Paolo Bonzini - Nov. 15, 2012, 4:08 p.m.
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

Patch

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