From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10554 invoked by alias); 7 Jan 2013 17:49:44 -0000 Received: (qmail 10535 invoked by uid 22791); 7 Jan 2013 17:49:43 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_IB X-Spam-Check-By: sourceware.org Received: from mail-qc0-f182.google.com (HELO mail-qc0-f182.google.com) (209.85.216.182) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Jan 2013 17:49:37 +0000 Received: by mail-qc0-f182.google.com with SMTP id k19so12650572qcs.41 for ; Mon, 07 Jan 2013 09:49:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.177.143 with SMTP id bi15mr25922190qab.14.1357580976182; Mon, 07 Jan 2013 09:49:36 -0800 (PST) Received: by 10.49.12.210 with HTTP; Mon, 7 Jan 2013 09:49:36 -0800 (PST) In-Reply-To: References: <20130102111116.GP2315@tucnak.redhat.com> Date: Mon, 07 Jan 2013 17:49:00 -0000 Message-ID: Subject: Re: Use libstdc++-raw-cxx.m4 in libjava From: "H.J. Lu" To: Andreas Schwab Cc: Jakub Jelinek , Paolo Bonzini , DJ Delorie , neroden@gcc.gnu.org, Alexandre Oliva , Ralf Wildenhues , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00337.txt.bz2 On Fri, Jan 4, 2013 at 6:56 AM, H.J. Lu wrote: > On Fri, Jan 4, 2013 at 2:06 AM, Andreas Schwab wrote: >> "H.J. Lu" writes: >> >>> On Thu, Jan 3, 2013 at 10:09 AM, Andreas Schwab wrote: >>>> "H.J. Lu" writes: >>>> >>>>> diff --git a/libjava/Makefile.am b/libjava/Makefile.am >>>>> index c6c84e4..dd08a4f 100644 >>>>> --- a/libjava/Makefile.am >>>>> +++ b/libjava/Makefile.am >>>>> @@ -594,7 +594,7 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \ >>>>> $(AM_CPPFLAGS) \ >>>>> $(LIBSTDCXX_RAW_CXX_CXXFLAGS) >>>>> ## The mysterious backslash in the grep pattern is consumed by make. >>>>> -lib_gnu_awt_xlib_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LDLAGS) \ >>>>> +lib_gnu_awt_xlib_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LIBADD) \ >>>>> @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ >>>>> -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \ >>>>> -version-info `grep -v '^\#' $(srcdir)/libtool-version` >>>>> $(LIBGCJ_LD_SYMBOLIC) >>>> >>>> It is still wrong to use LDFLAGS for libraries to be linked in. >>>> All of $(LIBSTDCXX_RAW_CXX_LIBADD) @X_PRE_LIBS@ @X_LIBS@ -lX11 >>>> @X_EXTRA_LIBS@ should be on lib_gnu_awt_xlib_la_LDADD. >>>> >>> >>> This was how it was done before my change. If we want to >>> make a change, I can submit a separate patch. >> >> Libraries should never occur before the objects which reference them. >> > > This is in GCC 4.7: > > lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \ > @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ > -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \ > -version-info `grep -v '^\#' $(srcdir)/libtool-version` > $(LIBGCJ_LD_SYMBOLIC) > lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS) \ > $(lib_gnu_awt_xlib_la_version_arg) > > It does put libraries first. If it is a real bug, it should be fixed > separately. > > -- > H.J. I am checking in this patch to fix the typo. We can leave LIBADD change to 4.9. -- H.J. --- config/ 2013-01-07 H.J. Lu * libstdc++-raw-cxx.m4 (GCC_LIBSTDCXX_RAW_CXX_FLAGS): Remove "-I" from LIBSTDCXX_RAW_CXX_LDFLAGS. libjava/ 2013-01-07 H.J. Lu * Makefile.am (lib_gnu_awt_xlib_la_LDFLAGS): Replace LIBSTDCXX_RAW_CXX_LDLAGS with LIBSTDCXX_RAW_CXX_LDFLAGS. * Makefile.in: Regenerated. libsanitizer/ 2013-01-07 H.J. Lu * asan/Makefile.am (libasan_la_LIBADD): Replace LIBSTDCXX_RAW_CXX_LDLAGS with LIBSTDCXX_RAW_CXX_LDFLAGS. * tsan/Makefile.am (libtsan_la_LIBADD): Likewise. * Makefile.in: Regenerated. * configure: Likewise. * asan/Makefile.in: Likewise. * interception/Makefile.in: Likewise. * sanitizer_common/Makefile.in: Likewise. * tsan/Makefile.in: Likewise. diff --git a/config/libstdc++-raw-cxx.m4 b/config/libstdc++-raw-cxx.m4 index 8052c2f..aafa509 100644 --- a/config/libstdc++-raw-cxx.m4 +++ b/config/libstdc++-raw-cxx.m4 @@ -24,7 +24,7 @@ AC_DEFUN([GCC_LIBSTDCXX_RAW_CXX_FLAGS], [ -I\$(top_builddir)/../libstdc++-v3/include/\$(target_noncanonical) \ -I\$(top_srcdir)/../libstdc++-v3/libsupc++" LIBSTDCXX_RAW_CXX_LDFLAGS="\ - -I\$(top_builddir)/../libstdc++-v3/src/libstdc++.la" + \$(top_builddir)/../libstdc++-v3/src/libstdc++.la" AC_SUBST(LIBSTDCXX_RAW_CXX_CXXFLAGS) AC_SUBST(LIBSTDCXX_RAW_CXX_LDFLAGS) ]) diff --git a/libjava/Makefile.am b/libjava/Makefile.am index c6c84e4..a4941a9 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -594,7 +594,7 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ## The mysterious backslash in the grep pattern is consumed by make. -lib_gnu_awt_xlib_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LDLAGS) \ +lib_gnu_awt_xlib_la_LDFLAGS = $(LIBSTDCXX_RAW_CXX_LDFLAGS) \ @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \ -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \ -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC) diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am index 76cdcfd..04a621f 100644 --- a/libsanitizer/asan/Makefile.am +++ b/libsanitizer/asan/Makefile.am @@ -40,7 +40,7 @@ libasan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la else libasan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la endif -libasan_la_LIBADD += $(LIBSTDCXX_RAW_CXX_LDLAGS) +libasan_la_LIBADD += $(LIBSTDCXX_RAW_CXX_LDFLAGS) libasan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am index 435fe71..26d1af2 100644 --- a/libsanitizer/tsan/Makefile.am +++ b/libsanitizer/tsan/Makefile.am @@ -34,7 +34,7 @@ tsan_files = \ tsan_symbolize_addr2line_linux.cc libtsan_la_SOURCES = $(tsan_files) -libtsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDLAGS) +libtsan_la_LIBADD = $(top_builddir)/sanitizer_common/libsanitizer_common.la $(top_builddir)/interception/libinterception.la $(LIBSTDCXX_RAW_CXX_LDFLAGS) libtsan_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` -lpthread -ldl # Work around what appears to be a GNU make bug handling MAKEFLAGS