From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 1ADC53857C6F for ; Fri, 13 Nov 2020 11:07:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1ADC53857C6F Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-ky6j3uyeMr2tgGcMVP5bNQ-1; Fri, 13 Nov 2020 06:07:38 -0500 X-MC-Unique: ky6j3uyeMr2tgGcMVP5bNQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9AAE2100F7A4; Fri, 13 Nov 2020 11:07:36 +0000 (UTC) Received: from localhost (unknown [10.33.36.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA1DA5B4B0; Fri, 13 Nov 2020 11:07:35 +0000 (UTC) Date: Fri, 13 Nov 2020 11:07:35 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Rainer Orth , Iain Sandoe Subject: [PATCH] libstdc++: Fix error shown during Solaris build Message-ID: <20201113110735.GA505111@redhat.com> MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="CE+1k2dSO48ffgeK" Content-Disposition: inline X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 11:07:42 -0000 --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? --CE+1k2dSO48ffgeK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 5b9b2158b08650b15049564a4e87b7b5cac49759 Author: Jonathan Wakely 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 --CE+1k2dSO48ffgeK--