]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix error shown during Solaris build
authorJonathan Wakely <jwakely@redhat.com>
Fri, 13 Nov 2020 19:11:02 +0000 (19:11 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 16 Nov 2020 11:54:22 +0000 (11:54 +0000)
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.

libstdc++-v3/src/Makefile.am
libstdc++-v3/src/Makefile.in

index 1eda70edb3796ae33d02fc02310430473500f307..21b6db7fb1c3accf9dfccab3db5a7577264e0ce6 100644 (file)
@@ -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
index 7f5591713550b76c3f0074cb465d5a1d6dcf4b82..e7ccdaeceab11e8e7b6d189b6f6ad579dfbadd0f 100644 (file)
@@ -1022,8 +1022,8 @@ compatibility-condvar.o: compatibility-condvar.cc
 @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@ perl $(toplevel_srcdir)/contrib/make_sunver.pl \
 @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@   libstdc++-symbols.ver \
 @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@   $(libstdc___la_OBJECTS:%.lo=.libs/%.o) \
-@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@  `echo $(libstdc___la_LIBADD) | \
-@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@     sed 's,/\([^/.]*\)\.la,/.libs/\1.a,g'` \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@  `echo ' $(libstdc___la_LIBADD) ' | \
+@ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@     sed -e 's,/\([^/.]*\)\.la,/.libs/\1.a,g' -e 's/ -l[^ ]* / /'` \
 @ENABLE_SYMVERS_SUN_TRUE@@ENABLE_SYMVERS_TRUE@  > $@ || (rm -f $@ ; exit 1)
 @ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@libstdc++-symbols.explist : libstdc++-symbols.ver \
 @ENABLE_SYMVERS_DARWIN_TRUE@@ENABLE_SYMVERS_TRUE@              ${glibcxx_srcdir}/scripts/make_exports.pl \