From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128608 invoked by alias); 7 Jan 2019 14:14:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 128582 invoked by uid 89); 7 Jan 2019 14:14:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=noticed X-HELO: mail-ua1-f65.google.com Received: from mail-ua1-f65.google.com (HELO mail-ua1-f65.google.com) (209.85.222.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Jan 2019 14:14:37 +0000 Received: by mail-ua1-f65.google.com with SMTP id u19so158404uae.4 for ; Mon, 07 Jan 2019 06:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7wk0QEdfwSr2mHhYWdl0q0Uxcybqhaz9PeFqtYEF16c=; b=jNBVZGUbWu8byd5NNdDh2poJrjL74iX/MVXdXK/GpQ/xxnOYm2TUw2Xc002/f4zKcR JZADINJK2d5ub6PBycbcQMeCVbNrdIQBvX5tOgwKWvLaa/FalHxZkhkgitHmSuLmbzw8 efXcDdCeGGv1ww4G9iuX3TwMYZ8vhctFp9zrE= MIME-Version: 1.0 References: <20190106223506.GA21904@redhat.com> <20190106223631.GM15627@redhat.com> <20190107094825.GN15627@redhat.com> <20190107123945.GP15627@redhat.com> In-Reply-To: <20190107123945.GP15627@redhat.com> From: Christophe Lyon Date: Mon, 07 Jan 2019 14:14:00 -0000 Message-ID: Subject: Re: [PATCH 2/2] PR libstdc++/86756 Move rest of std::filesystem to libstdc++.so To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc Patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00300.txt.bz2 On Mon, 7 Jan 2019 at 13:39, Jonathan Wakely wrote: > > On 07/01/19 09:48 +0000, Jonathan Wakely wrote: > >On 07/01/19 10:24 +0100, Christophe Lyon wrote: > >>Hi Jonathan > >> > >>On Sun, 6 Jan 2019 at 23:37, Jonathan Wakely wrote: > >>> > >>>Move std::filesystem directory iterators and operations from > >>>libstdc++fs.a to main libstdc++ library. These components have many > >>>dependencies on OS support, which is not available on all targets. Some > >>>additional autoconf checks and conditional compilation is needed to > >>>ensure the files will build for all targets. Previously this code was > >>>not compiled without --enable-libstdcxx-filesystem-ts but the C++17 > >>>components should be available for all hosted builds. > >>> > >>>The tests for these components no longer need to link to libstdc++fs.a, > >>>but are not expected to pass on all targets. To avoid numerous failures > >>>on targets which are not expected to pass the tests (due to missing OS > >>>functionality) leave the dg-require-filesystem-ts directives in place > >>>for now. This will ensure the tests only run for builds where the > >>>filesystem-ts library is built, which presumably means some level of OS > >>>support is present. > >>> > >>> > >>>Tested x86_64-linux (old/new string ABIs, 32/64 bit), x86_64-w64-mingw32. > >>> > >>>Committed to trunk. > >>> > >> > >>After this commit (r267616), I've noticed build failures for my > >>newlib-based toolchains: > >>aarch64-elf, arm-eabi: > >> > >>In file included from > >>/tmp/5241593_7.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/src/c++17/fs_ops.cc:57: > >>/tmp/5241593_7.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/src/c++17/../filesystem/ops-common.h:142:11: > >>error: '::truncate' has not been declared > >> 142 | using ::truncate; > >> | ^~~~~~~~ > >>/tmp/5241593_7.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/src/c++17/fs_ops.cc: > >>In function 'void std::filesystem::resize_file(const > >>std::filesystem::__cxx11::path&, uintmax_t, std::error_code&)': > >>/tmp/5241593_7.tmpdir/aci-gcc-fsf/sources/gcc-fsf/gccsrc/libstdc++-v3/src/c++17/fs_ops.cc:1274:19: > >>error: 'truncate' is not a member of 'posix' > >>1274 | else if (posix::truncate(p.c_str(), size)) > >> | ^~~~~~~~ > >>make[5]: *** [fs_ops.lo] Error 1 > >> > >>I'm not sure if there's an obvious fix? Note that I'm using a rather > >>old newlib version, if that matters. > > > >That's probably the reason, as I didn't see this in my tests with > >newlib builds. > > > >The fix is to add yet another autoconf check and guard the uses of > >truncate with a _GLIBCXX_USE_TRUNCATE macro. I'll do that now ... > > > Should be fixed with this patch, committed to trunk as r267647. > Yes, it works. Thanks! Christophe