Patchwork Use libstdc++-raw-cxx.m4 in libjava

login
register
mail settings
Submitter H.J. Lu
Date Jan. 7, 2013, 5:49 p.m.
Message ID <CAMe9rOpVk5ennO774DRty+tz-yc_T=gPFjRQ_b-zc8sYyVWeHw@mail.gmail.com>
Download mbox | patch
Permalink /patch/210020/
State New
Headers show

Comments

H.J. Lu - Jan. 7, 2013, 5:49 p.m.
On Fri, Jan 4, 2013 at 6:56 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jan 4, 2013 at 2:06 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> On Thu, Jan 3, 2013 at 10:09 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>>>> "H.J. Lu" <hjl.tools@gmail.com> 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.

Patch

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 =