From 8b75621078b42aa4cc41110a3388bdf65205056a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sat, 3 Oct 2015 00:21:41 +0100 Subject: [PATCH] Enable dual ABI for Filesystem library * src/filesystem/Makefile.am: Add cxx11_abi_sources. * src/filesystem/Makefile.in: Regenerate. * src/filesystem/cow-dir.cc: New. * src/filesystem/cow-ops.cc: New. * src/filesystem/cow-path.cc: New. * src/filesystem/dir.cc: Define macro for new ABI. * src/filesystem/ops.cc: Likewise. * src/filesystem/path.cc: Likewise. From-SVN: r228437 --- libstdc++-v3/ChangeLog | 11 +++++++++++ libstdc++-v3/src/filesystem/Makefile.am | 12 +++++++++++- libstdc++-v3/src/filesystem/Makefile.in | 15 +++++++++++--- libstdc++-v3/src/filesystem/cow-dir.cc | 26 +++++++++++++++++++++++++ libstdc++-v3/src/filesystem/cow-ops.cc | 26 +++++++++++++++++++++++++ libstdc++-v3/src/filesystem/cow-path.cc | 26 +++++++++++++++++++++++++ libstdc++-v3/src/filesystem/dir.cc | 4 ++++ libstdc++-v3/src/filesystem/ops.cc | 4 ++++ libstdc++-v3/src/filesystem/path.cc | 4 ++++ 9 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 libstdc++-v3/src/filesystem/cow-dir.cc create mode 100644 libstdc++-v3/src/filesystem/cow-ops.cc create mode 100644 libstdc++-v3/src/filesystem/cow-path.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fd05a65f009..c70a3a0cc49 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2015-10-03 Jonathan Wakely + + * src/filesystem/Makefile.am: Add cxx11_abi_sources. + * src/filesystem/Makefile.in: Regenerate. + * src/filesystem/cow-dir.cc: New. + * src/filesystem/cow-ops.cc: New. + * src/filesystem/cow-path.cc: New. + * src/filesystem/dir.cc: Define macro for new ABI. + * src/filesystem/ops.cc: Likewise. + * src/filesystem/path.cc: Likewise. + 2015-10-02 Jonathan Wakely * testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc: diff --git a/libstdc++-v3/src/filesystem/Makefile.am b/libstdc++-v3/src/filesystem/Makefile.am index 128cba9f52a..8e332ec4b01 100644 --- a/libstdc++-v3/src/filesystem/Makefile.am +++ b/libstdc++-v3/src/filesystem/Makefile.am @@ -26,10 +26,20 @@ toolexeclib_LTLIBRARIES = libstdc++fs.la headers = +if ENABLE_DUAL_ABI +cxx11_abi_sources = \ + cow-dir.cc \ + cow-ops.cc \ + cow-path.cc +else +cxx11_abi_sources = +endif + sources = \ dir.cc \ ops.cc \ - path.cc + path.cc \ + ${cxx11_abi_sources} # vpath % $(top_srcdir)/src/filesystem diff --git a/libstdc++-v3/src/filesystem/Makefile.in b/libstdc++-v3/src/filesystem/Makefile.in index a315bb63998..bbc45a87310 100644 --- a/libstdc++-v3/src/filesystem/Makefile.in +++ b/libstdc++-v3/src/filesystem/Makefile.in @@ -112,8 +112,10 @@ am__uninstall_files_from_dir = { \ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" LTLIBRARIES = $(toolexeclib_LTLIBRARIES) libstdc__fs_la_LIBADD = -am__objects_1 = dir.lo ops.lo path.lo -am_libstdc__fs_la_OBJECTS = $(am__objects_1) +@ENABLE_DUAL_ABI_TRUE@am__objects_1 = cow-dir.lo cow-ops.lo \ +@ENABLE_DUAL_ABI_TRUE@ cow-path.lo +am__objects_2 = dir.lo ops.lo path.lo $(am__objects_1) +am_libstdc__fs_la_OBJECTS = $(am__objects_2) libstdc__fs_la_OBJECTS = $(am_libstdc__fs_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = @@ -353,10 +355,17 @@ WARN_CXXFLAGS = \ AM_CPPFLAGS = $(GLIBCXX_INCLUDES) $(CPPFLAGS) toolexeclib_LTLIBRARIES = libstdc++fs.la headers = +@ENABLE_DUAL_ABI_FALSE@cxx11_abi_sources = +@ENABLE_DUAL_ABI_TRUE@cxx11_abi_sources = \ +@ENABLE_DUAL_ABI_TRUE@ cow-dir.cc \ +@ENABLE_DUAL_ABI_TRUE@ cow-ops.cc \ +@ENABLE_DUAL_ABI_TRUE@ cow-path.cc + sources = \ dir.cc \ ops.cc \ - path.cc + path.cc \ + ${cxx11_abi_sources} # vpath % $(top_srcdir)/src/filesystem diff --git a/libstdc++-v3/src/filesystem/cow-dir.cc b/libstdc++-v3/src/filesystem/cow-dir.cc new file mode 100644 index 00000000000..b4175ef0ee3 --- /dev/null +++ b/libstdc++-v3/src/filesystem/cow-dir.cc @@ -0,0 +1,26 @@ +// Class filesystem::directory_entry etc. -*- C++ -*- + +// Copyright (C) 2015 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include "dir.cc" diff --git a/libstdc++-v3/src/filesystem/cow-ops.cc b/libstdc++-v3/src/filesystem/cow-ops.cc new file mode 100644 index 00000000000..6096dec4bb7 --- /dev/null +++ b/libstdc++-v3/src/filesystem/cow-ops.cc @@ -0,0 +1,26 @@ +// Filesystem operations -*- C++ -*- + +// Copyright (C) 2015 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include "ops.cc" diff --git a/libstdc++-v3/src/filesystem/cow-path.cc b/libstdc++-v3/src/filesystem/cow-path.cc new file mode 100644 index 00000000000..386df59d335 --- /dev/null +++ b/libstdc++-v3/src/filesystem/cow-path.cc @@ -0,0 +1,26 @@ +// Class filesystem::path -*- C++ -*- + +// Copyright (C) 2015 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// Under Section 7 of GPL version 3, you are granted additional +// permissions described in the GCC Runtime Library Exception, version +// 3.1, as published by the Free Software Foundation. + +// You should have received a copy of the GNU General Public License and +// a copy of the GCC Runtime Library Exception along with this program; +// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +// . + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include "path.cc" diff --git a/libstdc++-v3/src/filesystem/dir.cc b/libstdc++-v3/src/filesystem/dir.cc index 33280ecdb07..63c10e716db 100644 --- a/libstdc++-v3/src/filesystem/dir.cc +++ b/libstdc++-v3/src/filesystem/dir.cc @@ -22,6 +22,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#ifndef _GLIBCXX_USE_CXX11_ABI +# define _GLIBCXX_USE_CXX11_ABI 1 +#endif + #include #include #include diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 7b261fb93aa..81525609698 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -22,6 +22,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#ifndef _GLIBCXX_USE_CXX11_ABI +# define _GLIBCXX_USE_CXX11_ABI 1 +#endif + #include #include #include diff --git a/libstdc++-v3/src/filesystem/path.cc b/libstdc++-v3/src/filesystem/path.cc index e85c9fccd9a..e9fe465d174 100644 --- a/libstdc++-v3/src/filesystem/path.cc +++ b/libstdc++-v3/src/filesystem/path.cc @@ -22,6 +22,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . +#ifndef _GLIBCXX_USE_CXX11_ABI +# define _GLIBCXX_USE_CXX11_ABI 1 +#endif + #include using std::experimental::filesystem::path; -- 2.30.2