From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id 6B2973987907; Thu, 17 Sep 2020 16:47:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B2973987907 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600361275; bh=ELG8zJnxeeRaeQCp53g7sv5v4VIJA82dBnidEcrn180=; h=From:To:Subject:Date:From; b=X6wE02UXfe+USRHWUmK/mvpCxNQbzHI0shM6Gb+xrN4iz/UmZEDhCOaxjFOlfXt9K +yvb0rdjrnTMVDWXoDCPiibnv8IneBIQJdUsL0kIi6n8JPBRg8czxNYxoGXbdxKepU qxDJ8BmkeNOcLsMU8JbrJJyuz+pm6ocinPVoBwvQ= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/redhat/heads/gcc-8-branch)] libstdc++: Simplify makefile rule for largefile-config.h (PR91947) X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/redhat/heads/gcc-8-branch X-Git-Oldrev: e82acdcb56a07b94fcc2e159fee61396d01c9e3d X-Git-Newrev: 38d8d02eb9ce431f0746a3a0606b89da8c18f133 Message-Id: <20200917164755.6B2973987907@sourceware.org> Date: Thu, 17 Sep 2020 16:47:55 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 16:47:55 -0000 https://gcc.gnu.org/g:38d8d02eb9ce431f0746a3a0606b89da8c18f133 commit 38d8d02eb9ce431f0746a3a0606b89da8c18f133 Author: Jonathan Wakely Date: Fri Jan 24 11:13:55 2020 +0000 libstdc++: Simplify makefile rule for largefile-config.h (PR91947) The previous rule could leave an incomplete file if the build was interrupted, which would then not be remade if make was run again. This makes the rule more robust by writing to a temporary file and only moving it into place as the final step. It also simplifies the rule so that only the essential macro definitions are written to the file, not the explanatory comments and commented out #undef lines. Also, the macro for enabling LFS on Mac OS X 10.5 is now set unconditionally, which is a bug fix from upstream autoconf. Backport from mainline 2020-01-23 Jonathan Wakely PR libstdc++/91947 * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify rule. * include/Makefile.in: Regenerate. Diff: --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/include/Makefile.am | 22 ++++++---------------- libstdc++-v3/include/Makefile.in | 22 ++++++---------------- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8b4a53d564f..ab768b957c4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,13 @@ 2020-02-26 Jonathan Wakely + Backport from mainline + 2020-01-23 Jonathan Wakely + + PR libstdc++/91947 + * include/Makefile.am (${host_builddir}/largefile-config.h): Simplify + rule. + * include/Makefile.in: Regenerate. + Backport from mainlne 2019-10-04 Jonathan Wakely diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index f98d88a5133..482cba7361f 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -1240,22 +1240,12 @@ stamp-float128: endif # This header is not installed, it's only used to build libstdc++ itself. -${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \ - ${glibcxx_srcdir}/include/bits/c++config - @echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@ - @echo '# error "This file must be included before any others"' >> $@ - @echo '#endif' >> $@ - @echo >> $@ - @echo '/* Enable large inode numbers on Mac OS X 10.5. */' >> $@ - @echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@ - @echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@ - @echo '#endif' >> $@ - @echo >> $@ - @echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@ - @grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@ - @echo >> $@ - @echo '/* Define for large files, on AIX-style hosts. */' >> $@ - @grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@ +${host_builddir}/largefile-config.h: ${CONFIG_HEADER} + @rm -f $@.tmp + @-grep 'define _DARWIN_USE_64_BIT_INODE' ${CONFIG_HEADER} >> $@.tmp + @-grep 'define _FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@.tmp + @-grep 'define _LARGE_FILES' ${CONFIG_HEADER} >> $@.tmp + @mv $@.tmp $@ # NB: The non-empty default ldbl_compat works around an AIX sed # oddity, see libstdc++/31957 for details. diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 7fb509a3fb8..d8f93c805ca 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -1670,22 +1670,12 @@ stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_head @ENABLE_FLOAT128_FALSE@ echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128 # This header is not installed, it's only used to build libstdc++ itself. -${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \ - ${glibcxx_srcdir}/include/bits/c++config - @echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@ - @echo '# error "This file must be included before any others"' >> $@ - @echo '#endif' >> $@ - @echo >> $@ - @echo '/* Enable large inode numbers on Mac OS X 10.5. */' >> $@ - @echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@ - @echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@ - @echo '#endif' >> $@ - @echo >> $@ - @echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@ - @grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@ - @echo >> $@ - @echo '/* Define for large files, on AIX-style hosts. */' >> $@ - @grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@ +${host_builddir}/largefile-config.h: ${CONFIG_HEADER} + @rm -f $@.tmp + @-grep 'define _DARWIN_USE_64_BIT_INODE' ${CONFIG_HEADER} >> $@.tmp + @-grep 'define _FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@.tmp + @-grep 'define _LARGE_FILES' ${CONFIG_HEADER} >> $@.tmp + @mv $@.tmp $@ # NB: The non-empty default ldbl_compat works around an AIX sed # oddity, see libstdc++/31957 for details.