public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Fix error shown during Solaris build
@ 2020-11-13 11:07 Jonathan Wakely
  2020-11-13 11:16 ` Jonathan Wakely
  2020-11-16 10:17 ` Rainer Orth
  0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Wakely @ 2020-11-13 11:07 UTC (permalink / raw)
  To: libstdc++, gcc-patches; +Cc: Rainer Orth, Iain Sandoe

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

Currently this is shown when building libstdc++ on Solaris:

-lrt: open: No such file or directory

The error comes from the make_sunver.pl script which tries to open each
of its arguments. The arguments are passed by this make rule:

	perl ${glibcxx_srcdir}/scripts/make_exports.pl \
	  libstdc++-symbols.ver \
	  $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
	 `echo $(libstdc___la_LIBADD) | \
	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
	 > $@ || (rm -f $@ ; exit 1)

The $(libstdc___la_LIBADD) variable includes $(GLIBCXX_LIBS) which
contains -lrt on Solaris.

This patch adds another sed script to filter -l arguments from the echo
command. In order to reliably match ' -l[^ ]* ' the echo arguments are
quoted and a space added before and after them. This might be overkill
just to remove -lrt from the start of the string, but should be robust
in case other -l arguments are added to $(GLIBCXX_LIBS), or in case the
$(libstdc___la_LIBADD) libraries are reordered.

libstdc++-v3/ChangeLog:

	* src/Makefile.am (libstdc++-symbols.ver-sun): Remove -lrt from
	arguments passed to make_sunver.pl script.
	* src/Makefile.in: Regenerate.

Tested sparc-solaris2.11. Rainer, does this look OK?

Iain, the libstdc++-symbols.explist target for Darwin is very similar,
but I don't know if it's a problem there. Does GLIBCXX_LIBS contain
anything in $target/libstdc++-v3/src/Makefile on Darwin?

Should we make the same change just in case?



[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2134 bytes --]

commit 5b9b2158b08650b15049564a4e87b7b5cac49759
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 13 10:39:23 2020

    libstdc++: Fix error shown during Solaris build
    
    Currently this is shown when building libstdc++ on Solaris:
    
    -lrt: open: No such file or directory
    
    The error comes from the make_sunver.pl script which tries to open each
    of its arguments. The arguments are passed by this make rule:
    
            perl ${glibcxx_srcdir}/scripts/make_exports.pl \
              libstdc++-symbols.ver \
              $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
             `echo $(libstdc___la_LIBADD) | \
                sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
             > $@ || (rm -f $@ ; exit 1)
    
    The $(libstdc___la_LIBADD) variable includes $(GLIBCXX_LIBS) which
    contains -lrt on Solaris.
    
    This patch adds another sed script to filter -l arguments from the echo
    command. In order to reliably match ' -l[^ ]* ' the echo arguments are
    quoted and a space added before and after them. This might be overkill
    just to remove -lrt from the start of the string, but should be robust
    in case other -l arguments are added to $(GLIBCXX_LIBS), or in case the
    $(libstdc___la_LIBADD) libraries are reordered.
    
    libstdc++-v3/ChangeLog:
    
            * src/Makefile.am (libstdc++-symbols.ver-sun): Remove -lrt from
            arguments passed to make_sunver.pl script.
            * src/Makefile.in: Regenerate.

diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index 1eda70edb379..21b6db7fb1c3 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -269,8 +269,8 @@ libstdc++-symbols.ver-sun : libstdc++-symbols.ver \
 	perl $(toplevel_srcdir)/contrib/make_sunver.pl \
 	  libstdc++-symbols.ver \
 	  $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
-	 `echo $(libstdc___la_LIBADD) | \
-	    sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+	 `echo ' $(libstdc___la_LIBADD) ' | \
+	    sed -e 's,/\([^/.]*\)\.la,/.libs/\1.a,g' -e 's/ -l[^ ]* / /'` \
 	 > $@ || (rm -f $@ ; exit 1)
 endif
 if ENABLE_SYMVERS_DARWIN

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

end of thread, other threads:[~2020-11-16 11:55 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 11:07 [PATCH] libstdc++: Fix error shown during Solaris build Jonathan Wakely
2020-11-13 11:16 ` Jonathan Wakely
2020-11-13 11:22   ` Iain Sandoe
2020-11-16 10:23   ` Rainer Orth
2020-11-16 10:28     ` Jonathan Wakely
2020-11-16 10:17 ` Rainer Orth
2020-11-16 10:32   ` Jonathan Wakely
2020-11-16 10:37     ` Jonathan Wakely
2020-11-16 11:47       ` Rainer Orth
2020-11-16 11:46     ` Rainer Orth
2020-11-16 11:54       ` Jonathan Wakely

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