From 661a3100b1ec075974926f18d0c1fda5ad95c6e6 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Sun, 9 Apr 2017 21:02:41 +0200 Subject: [PATCH] stdcxx: update to version 6.3.0 Issue #2372 --- repos/base/mk/global.mk | 7 +- repos/libports/include/stdcxx/README | 16 +- .../libports/include/stdcxx/bits/basic_file.h | 1 - .../include/stdcxx/bits/c++allocator.h | 1 - .../libports/include/stdcxx/bits/c++config.h | 364 +++++++++++++++--- repos/libports/include/stdcxx/bits/c++io.h | 1 - .../libports/include/stdcxx/bits/c++locale.h | 1 - repos/libports/include/stdcxx/bits/gthr.h | 298 -------------- .../libports/include/stdcxx/bits/opt_random.h | 38 -- repos/libports/lib/import/import-stdcxx.mk | 4 +- repos/libports/lib/mk/stdcxx-c++98.mk | 43 +++ repos/libports/lib/mk/stdcxx.mk | 37 +- repos/libports/ports/stdcxx.hash | 2 +- repos/libports/ports/stdcxx.port | 54 ++- .../src/lib/stdcxx/include_next.patch | 46 +++ 15 files changed, 459 insertions(+), 454 deletions(-) delete mode 100644 repos/libports/include/stdcxx/bits/basic_file.h delete mode 100644 repos/libports/include/stdcxx/bits/c++allocator.h delete mode 100644 repos/libports/include/stdcxx/bits/c++io.h delete mode 100644 repos/libports/include/stdcxx/bits/c++locale.h delete mode 100644 repos/libports/include/stdcxx/bits/gthr.h delete mode 100644 repos/libports/include/stdcxx/bits/opt_random.h create mode 100644 repos/libports/lib/mk/stdcxx-c++98.mk create mode 100644 repos/libports/src/lib/stdcxx/include_next.patch diff --git a/repos/base/mk/global.mk b/repos/base/mk/global.mk index 24cdd718c8..246d90128d 100644 --- a/repos/base/mk/global.mk +++ b/repos/base/mk/global.mk @@ -136,9 +136,12 @@ CC_RUSTC_OPT += $(foreach lib,$(LIBS),-L$(LIB_CACHE_DIR)/$(lib)) # # Enable C++11 by default # +# We substitute '.' characters by '_' to allow a source-file-specific +# C++ standard option for files with more than one dot in their name. +# CC_CXX_OPT_STD ?= -std=gnu++11 -CC_CXX_OPT += $(CC_CXX_OPT_STD) - +CC_CXX_OPT += $(lastword $(CC_CXX_OPT_STD) $(CC_CXX_OPT_STD_$(subst .,_,$*))) + # # Linker options # diff --git a/repos/libports/include/stdcxx/README b/repos/libports/include/stdcxx/README index 961cfdc4c2..800aa2f49e 100644 --- a/repos/libports/include/stdcxx/README +++ b/repos/libports/include/stdcxx/README @@ -2,11 +2,15 @@ file origins ------------ - bits/gstdint.h: manually created -- bits/gthr.h: renamed copy of 'libgcc/gthr-single.h' from GCC source - bits/c++config.h: - - run 'make noux-pkg/gcc_x86' for a 32-bit x86 platform - - run 'make noux-pkg/gcc_x86' for a 64-bit x86 platform - - run 'make noux-pkg/gcc_arm' for a 32-bit ARM platform - - compare the generated 'c++config.h' files - - create a combined 'c++config.h' file by making the differing macros + - apply https://github.com/cproc/genode_stuff/blob/stdcxx/stdcxx_update_genode.patch + (update the gcc port hash if it conflicts) + - prepare the modified gcc port + - run 'make noux-pkg/gcc_x86' for the 'x86_32' platform + - find 'build/x86_32/noux-pkg/gcc_x86/x86_64-pc-elf/32/libstdc++-v3/include/x86_64-pc-elf/bits/c++config.h' + - run 'make noux-pkg/gcc_x86' for the 'x86_64' platform + - find 'build/x86_64/noux-pkg/gcc_x86/x86_64-pc-elf/64/libstdc++-v3/include/x86_64-pc-elf/bits/c++config.h' + - run 'make noux-pkg/gcc_arm' for the 'pbxa9' platform + - find 'build/pbxa9/noux-pkg/gcc_arm/arm-none-eabi/libstdc++-v3/include/arm-none-eabi/bits/c++config.h' + - create a combined 'c++config.h' file by making the differing macros of the three generated files depend on the '__x86_64__' and '__ARM_EABI__' macros diff --git a/repos/libports/include/stdcxx/bits/basic_file.h b/repos/libports/include/stdcxx/bits/basic_file.h deleted file mode 100644 index 6c8b4d1b72..0000000000 --- a/repos/libports/include/stdcxx/bits/basic_file.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/repos/libports/include/stdcxx/bits/c++allocator.h b/repos/libports/include/stdcxx/bits/c++allocator.h deleted file mode 100644 index af7a845e9a..0000000000 --- a/repos/libports/include/stdcxx/bits/c++allocator.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/repos/libports/include/stdcxx/bits/c++config.h b/repos/libports/include/stdcxx/bits/c++config.h index 9b8c776a2b..4f5bad590d 100644 --- a/repos/libports/include/stdcxx/bits/c++config.h +++ b/repos/libports/include/stdcxx/bits/c++config.h @@ -1,7 +1,6 @@ // Predefined symbols and macros -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, -// 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +// Copyright (C) 1997-2016 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 @@ -32,7 +31,7 @@ #define _GLIBCXX_CXX_CONFIG_H 1 // The current version of the C++ library in compressed ISO date format. -#define __GLIBCXX__ 20120920 +#define __GLIBCXX__ 20161221 // Macros for various attributes. // _GLIBCXX_PURE @@ -59,14 +58,6 @@ # endif #endif -#ifndef _GLIBCXX_THROW_OR_ABORT -# if __EXCEPTIONS -# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) -# else -# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) -# endif -#endif - // Macros for visibility attributes. // _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY // _GLIBCXX_VISIBILITY @@ -87,7 +78,7 @@ # define _GLIBCXX_USE_DEPRECATED 1 #endif -#if defined(__DEPRECATED) && defined(__GXX_EXPERIMENTAL_CXX0X__) +#if defined(__DEPRECATED) && (__cplusplus >= 201103L) # define _GLIBCXX_DEPRECATED __attribute__ ((__deprecated__)) #else # define _GLIBCXX_DEPRECATED @@ -98,11 +89,12 @@ # define _GLIBCXX_ABI_TAG_CXX11 __attribute ((__abi_tag__ ("cxx11"))) #endif + #if __cplusplus // Macro for constexpr, to support in mixed 03/0x mode. #ifndef _GLIBCXX_CONSTEXPR -# ifdef __GXX_EXPERIMENTAL_CXX0X__ +# if __cplusplus >= 201103L # define _GLIBCXX_CONSTEXPR constexpr # define _GLIBCXX_USE_CONSTEXPR constexpr # else @@ -111,14 +103,24 @@ # endif #endif +#ifndef _GLIBCXX14_CONSTEXPR +# if __cplusplus >= 201402L +# define _GLIBCXX14_CONSTEXPR constexpr +# else +# define _GLIBCXX14_CONSTEXPR +# endif +#endif + // Macro for noexcept, to support in mixed 03/0x mode. #ifndef _GLIBCXX_NOEXCEPT -# ifdef __GXX_EXPERIMENTAL_CXX0X__ +# if __cplusplus >= 201103L # define _GLIBCXX_NOEXCEPT noexcept +# define _GLIBCXX_NOEXCEPT_IF(_COND) noexcept(_COND) # define _GLIBCXX_USE_NOEXCEPT noexcept # define _GLIBCXX_THROW(_EXC) # else # define _GLIBCXX_NOEXCEPT +# define _GLIBCXX_NOEXCEPT_IF(_COND) # define _GLIBCXX_USE_NOEXCEPT throw() # define _GLIBCXX_THROW(_EXC) throw(_EXC) # endif @@ -128,7 +130,15 @@ # define _GLIBCXX_NOTHROW _GLIBCXX_USE_NOEXCEPT #endif -// Macro for extern template, ie controling template linkage via use +#ifndef _GLIBCXX_THROW_OR_ABORT +# if __cpp_exceptions +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (throw (_EXC)) +# else +# define _GLIBCXX_THROW_OR_ABORT(_EXC) (__builtin_abort()) +# endif +#endif + +// Macro for extern template, ie controlling template linkage via use // of extern keyword on template declaration. As documented in the g++ // manual, it inhibits all implicit instantiations and is used // throughout the library to avoid multiple weak definitions for @@ -169,6 +179,11 @@ namespace placeholders { } namespace regex_constants { } namespace this_thread { } + inline namespace literals { + inline namespace chrono_literals { } + inline namespace complex_literals { } + inline namespace string_literals { } + } } namespace abi { } @@ -186,11 +201,42 @@ namespace std typedef __SIZE_TYPE__ size_t; typedef __PTRDIFF_TYPE__ ptrdiff_t; -#ifdef __GXX_EXPERIMENTAL_CXX0X__ +#if __cplusplus >= 201103L typedef decltype(nullptr) nullptr_t; #endif } +# define _GLIBCXX_USE_DUAL_ABI 1 + +#if ! _GLIBCXX_USE_DUAL_ABI +// Ignore any pre-defined value of _GLIBCXX_USE_CXX11_ABI +# undef _GLIBCXX_USE_CXX11_ABI +#endif + +#ifndef _GLIBCXX_USE_CXX11_ABI +# define _GLIBCXX_USE_CXX11_ABI 1 +#endif + +#if _GLIBCXX_USE_CXX11_ABI +namespace std +{ + inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } +} +namespace __gnu_cxx +{ + inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } +} +# define _GLIBCXX_NAMESPACE_CXX11 __cxx11:: +# define _GLIBCXX_BEGIN_NAMESPACE_CXX11 namespace __cxx11 { +# define _GLIBCXX_END_NAMESPACE_CXX11 } +# define _GLIBCXX_DEFAULT_ABI_TAG _GLIBCXX_ABI_TAG_CXX11 +#else +# define _GLIBCXX_NAMESPACE_CXX11 +# define _GLIBCXX_BEGIN_NAMESPACE_CXX11 +# define _GLIBCXX_END_NAMESPACE_CXX11 +# define _GLIBCXX_DEFAULT_ABI_TAG +#endif + // Defined if inline namespaces are used for versioning. # define _GLIBCXX_INLINE_VERSION 0 @@ -222,8 +268,13 @@ namespace std namespace regex_constants { inline namespace __7 { } } namespace this_thread { inline namespace __7 { } } + inline namespace literals { + inline namespace chrono_literals { inline namespace __7 { } } + inline namespace complex_literals { inline namespace __7 { } } + inline namespace string_literals { inline namespace __7 { } } + } + namespace __detail { inline namespace __7 { } } - namespace __regex { inline namespace __7 { } } } namespace __gnu_cxx @@ -247,9 +298,13 @@ namespace std // Non-inline namespace for components replaced by alternates in active mode. namespace __cxx1998 { -#if _GLIBCXX_INLINE_VERSION - inline namespace __7 { } -#endif +# if _GLIBCXX_INLINE_VERSION + inline namespace __7 { } +# endif + +# if _GLIBCXX_USE_CXX11_ABI + inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } +# endif } // Inline namespace for debug mode. @@ -301,9 +356,7 @@ namespace std # define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \ namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_CONTAINER \ - } _GLIBCXX_END_NAMESPACE_VERSION -# undef _GLIBCXX_EXTERN_TEMPLATE -# define _GLIBCXX_EXTERN_TEMPLATE -1 + _GLIBCXX_END_NAMESPACE_VERSION } #endif #ifdef _GLIBCXX_PARALLEL @@ -311,7 +364,7 @@ namespace std # define _GLIBCXX_BEGIN_NAMESPACE_ALGO \ namespace _GLIBCXX_STD_A { _GLIBCXX_BEGIN_NAMESPACE_VERSION # define _GLIBCXX_END_NAMESPACE_ALGO \ - } _GLIBCXX_END_NAMESPACE_VERSION + _GLIBCXX_END_NAMESPACE_VERSION } #endif #ifndef _GLIBCXX_STD_A @@ -356,11 +409,30 @@ namespace std # define _GLIBCXX_BEGIN_NAMESPACE_LDBL # define _GLIBCXX_END_NAMESPACE_LDBL #endif +#if _GLIBCXX_USE_CXX11_ABI +# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_CXX11 +# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_CXX11 +# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_CXX11 +#else +# define _GLIBCXX_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_NAMESPACE_LDBL +# define _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_BEGIN_NAMESPACE_LDBL +# define _GLIBCXX_END_NAMESPACE_LDBL_OR_CXX11 _GLIBCXX_END_NAMESPACE_LDBL +#endif + +// Debug Mode implies checking assertions. +#ifdef _GLIBCXX_DEBUG +# define _GLIBCXX_ASSERTIONS 1 +#endif + +// Disable std::string explicit instantiation declarations in order to assert. +#ifdef _GLIBCXX_ASSERTIONS +# undef _GLIBCXX_EXTERN_TEMPLATE +# define _GLIBCXX_EXTERN_TEMPLATE -1 +#endif // Assert. -#if !defined(_GLIBCXX_DEBUG) && !defined(_GLIBCXX_PARALLEL) -# define __glibcxx_assert(_Condition) -#else +#if defined(_GLIBCXX_ASSERTIONS) \ + || defined(_GLIBCXX_PARALLEL) || defined(_GLIBCXX_PARALLEL_ASSERTIONS) namespace std { // Avoid the use of assert, because we're trying to keep the @@ -374,7 +446,7 @@ namespace std __builtin_abort(); } } -#define __glibcxx_assert(_Condition) \ +#define __glibcxx_assert_impl(_Condition) \ do \ { \ if (! (_Condition)) \ @@ -383,6 +455,12 @@ namespace std } while (false) #endif +#if defined(_GLIBCXX_ASSERTIONS) +# define __glibcxx_assert(_Condition) __glibcxx_assert_impl(_Condition) +#else +# define __glibcxx_assert(_Condition) +#endif + // Macros for race detectors. // _GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE(A) and // _GLIBCXX_SYNCHRONIZATION_HAPPENS_AFTER(A) should be used to explain @@ -415,6 +493,8 @@ namespace std # define _GLIBCXX_BEGIN_EXTERN_C extern "C" { # define _GLIBCXX_END_EXTERN_C } +# define _GLIBCXX_USE_ALLOCATOR_NEW 1 + #else // !__cplusplus # define _GLIBCXX_BEGIN_EXTERN_C # define _GLIBCXX_END_EXTERN_C @@ -442,6 +522,28 @@ namespace std # define _GLIBCXX_WEAK_DEFINITION #endif +// By default, we assume that __GXX_WEAK__ also means that there is support +// for declaring functions as weak while not defining such functions. This +// allows for referring to functions provided by other libraries (e.g., +// libitm) without depending on them if the respective features are not used. +#ifndef _GLIBCXX_USE_WEAK_REF +# define _GLIBCXX_USE_WEAK_REF __GXX_WEAK__ +#endif + +// Conditionally enable annotations for the Transactional Memory TS on C++11. +// Most of the following conditions are due to limitations in the current +// implementation. +#if __cplusplus >= 201103L && _GLIBCXX_USE_CXX11_ABI \ + && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L \ + && !_GLIBCXX_FULLY_DYNAMIC_STRING && _GLIBCXX_USE_WEAK_REF \ + && _GLIBCXX_USE_ALLOCATOR_NEW +#define _GLIBCXX_TXN_SAFE transaction_safe +#define _GLIBCXX_TXN_SAFE_DYN transaction_safe_dynamic +#else +#define _GLIBCXX_TXN_SAFE +#define _GLIBCXX_TXN_SAFE_DYN +#endif + // The remainder of the prewritten config is automatic; all the // user hooks are listed above. @@ -463,6 +565,42 @@ namespace std #undef min #undef max +// N.B. these _GLIBCXX_USE_C99_XXX macros are defined unconditionally +// so they should be tested with #if not with #ifdef. +#if __cplusplus >= 201103L +# ifndef _GLIBCXX_USE_C99_MATH +# define _GLIBCXX_USE_C99_MATH _GLIBCXX11_USE_C99_MATH +# endif +# ifndef _GLIBCXX_USE_C99_COMPLEX +# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX11_USE_C99_COMPLEX +# endif +# ifndef _GLIBCXX_USE_C99_STDIO +# define _GLIBCXX_USE_C99_STDIO _GLIBCXX11_USE_C99_STDIO +# endif +# ifndef _GLIBCXX_USE_C99_STDLIB +# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX11_USE_C99_STDLIB +# endif +# ifndef _GLIBCXX_USE_C99_WCHAR +# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX11_USE_C99_WCHAR +# endif +#else +# ifndef _GLIBCXX_USE_C99_MATH +# define _GLIBCXX_USE_C99_MATH _GLIBCXX98_USE_C99_MATH +# endif +# ifndef _GLIBCXX_USE_C99_COMPLEX +# define _GLIBCXX_USE_C99_COMPLEX _GLIBCXX98_USE_C99_COMPLEX +# endif +# ifndef _GLIBCXX_USE_C99_STDIO +# define _GLIBCXX_USE_C99_STDIO _GLIBCXX98_USE_C99_STDIO +# endif +# ifndef _GLIBCXX_USE_C99_STDLIB +# define _GLIBCXX_USE_C99_STDLIB _GLIBCXX98_USE_C99_STDLIB +# endif +# ifndef _GLIBCXX_USE_C99_WCHAR +# define _GLIBCXX_USE_C99_WCHAR _GLIBCXX98_USE_C99_WCHAR +# endif +#endif + // End of prewritten config; the settings discovered at configure time follow. /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ @@ -494,6 +632,9 @@ namespace std /* Define to 1 if you have the `atanl' function. */ /* #undef _GLIBCXX_HAVE_ATANL */ +/* Define to 1 if you have the `at_quick_exit' function. */ +/* #undef _GLIBCXX_HAVE_AT_QUICK_EXIT */ + /* Define to 1 if the target assembler supports thread-local storage. */ /* #undef _GLIBCXX_HAVE_CC_TLS */ @@ -518,6 +659,9 @@ namespace std /* Define to 1 if you have the `cosl' function. */ /* #undef _GLIBCXX_HAVE_COSL */ +/* Define to 1 if you have the header file. */ +#define _GLIBCXX_HAVE_DIRENT_H 1 + /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_DLFCN_H 1 @@ -596,6 +740,9 @@ namespace std /* Define to 1 if you have the `fabsl' function. */ /* #undef _GLIBCXX_HAVE_FABSL */ +/* Define to 1 if you have the header file. */ +#define _GLIBCXX_HAVE_FCNTL_H 1 + /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_FENV_H 1 @@ -638,7 +785,7 @@ namespace std /* Define if _Unwind_GetIPInfo is available. */ #define _GLIBCXX_HAVE_GETIPINFO 1 -/* Define if gets is available in . */ +/* Define if gets is available in before C++14. */ #define _GLIBCXX_HAVE_GETS 1 /* Define to 1 if you have the `hypot' function. */ @@ -762,8 +909,14 @@ namespace std /* Define to 1 if you have the header file. */ /* #undef _GLIBCXX_HAVE_NAN_H */ +/* Define if defines obsolete isinf function. */ +#define _GLIBCXX_HAVE_OBSOLETE_ISINF 1 + +/* Define if defines obsolete isnan function. */ +#define _GLIBCXX_HAVE_OBSOLETE_ISNAN 1 + /* Define if poll is available in . */ -/* #undef _GLIBCXX_HAVE_POLL */ +#define _GLIBCXX_HAVE_POLL 1 /* Define to 1 if you have the `powf' function. */ /* #undef _GLIBCXX_HAVE_POWF */ @@ -774,6 +927,9 @@ namespace std /* Define to 1 if you have the `qfpclass' function. */ /* #undef _GLIBCXX_HAVE_QFPCLASS */ +/* Define to 1 if you have the `quick_exit' function. */ +/* #undef _GLIBCXX_HAVE_QUICK_EXIT */ + /* Define to 1 if you have the `setenv' function. */ /* #undef _GLIBCXX_HAVE_SETENV */ @@ -798,6 +954,9 @@ namespace std /* Define to 1 if you have the `sinl' function. */ /* #undef _GLIBCXX_HAVE_SINL */ +/* Defined if sleep exists. */ +#define _GLIBCXX_HAVE_SLEEP 1 + /* Define to 1 if you have the `sqrtf' function. */ /* #undef _GLIBCXX_HAVE_SQRTF */ @@ -834,6 +993,9 @@ namespace std /* Define to 1 if you have the `strtold' function. */ /* #undef _GLIBCXX_HAVE_STRTOLD */ +/* Define to 1 if `d_type' is a member of `struct dirent'. */ +#define _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE 1 + /* Define if strxfrm_l is available in . */ /* #undef _GLIBCXX_HAVE_STRXFRM_L */ @@ -862,9 +1024,15 @@ namespace std /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_RESOURCE_H 1 +/* Define to 1 if you have a suitable header file */ +/* #undef _GLIBCXX_HAVE_SYS_SDT_H */ + /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_SEM_H 1 +/* Define to 1 if you have the header file. */ +#define _GLIBCXX_HAVE_SYS_STATVFS_H 1 + /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_SYS_STAT_H 1 @@ -904,9 +1072,18 @@ namespace std /* Define to 1 if the target supports thread-local storage. */ /* #undef _GLIBCXX_HAVE_TLS */ +/* Define to 1 if you have the header file. */ +/* #undef _GLIBCXX_HAVE_UCHAR_H */ + /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_UNISTD_H 1 +/* Defined if usleep exists. */ +#define _GLIBCXX_HAVE_USLEEP 1 + +/* Define to 1 if you have the header file. */ +#define _GLIBCXX_HAVE_UTIME_H 1 + /* Defined if vfwscanf exists. */ #define _GLIBCXX_HAVE_VFWSCANF 1 @@ -925,6 +1102,9 @@ namespace std /* Define to 1 if you have the header file. */ #define _GLIBCXX_HAVE_WCTYPE_H 1 +/* Defined if Sleep exists. */ +/* #undef _GLIBCXX_HAVE_WIN32_SLEEP */ + /* Define if writev is available in . */ #define _GLIBCXX_HAVE_WRITEV 1 @@ -1114,6 +1294,9 @@ namespace std /* Define to 1 if you have the `_tanl' function. */ /* #undef _GLIBCXX_HAVE__TANL */ +/* Define to 1 if you have the `__cxa_thread_atexit_impl' function. */ +/* #undef _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL */ + /* Define as const if the declaration of iconv() needs const. */ /* #undef _GLIBCXX_ICONV_CONST */ @@ -1163,8 +1346,52 @@ namespace std /* Version number of package */ /* #undef _GLIBCXX_VERSION */ +/* Define if C99 functions in should be used in for + C++11. Using compiler builtins for these functions requires corresponding + C99 library functions to be present. */ +/* #undef _GLIBCXX11_USE_C99_COMPLEX */ + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++11. */ +#define _GLIBCXX11_USE_C99_MATH 1 + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++11. */ +#define _GLIBCXX11_USE_C99_STDIO 1 + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++11. */ +/* #undef _GLIBCXX11_USE_C99_STDLIB */ + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++11. */ +/* #undef _GLIBCXX11_USE_C99_WCHAR */ + +/* Define if C99 functions in should be used in for + C++98. Using compiler builtins for these functions requires corresponding + C99 library functions to be present. */ +/* #undef _GLIBCXX98_USE_C99_COMPLEX */ + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++98. */ +#define _GLIBCXX98_USE_C99_MATH 1 + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++98. */ +#define _GLIBCXX98_USE_C99_STDIO 1 + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++98. */ +/* #undef _GLIBCXX98_USE_C99_STDLIB */ + +/* Define if C99 functions or macros in should be imported in + in namespace std for C++98. */ +/* #undef _GLIBCXX98_USE_C99_WCHAR */ + /* Define if the compiler supports C++11 atomics. */ +#ifndef __ARM_EABI__ #define _GLIBCXX_ATOMIC_BUILTINS 1 +#endif /* Define to use concept checking code from the boost libraries. */ /* #undef _GLIBCXX_CONCEPT_CHECKS */ @@ -1181,6 +1408,13 @@ namespace std /* Define if compatibility should be provided for -mlong-double-64. */ +/* Define to the letter to which size_t is mangled. */ +#ifdef __x86_64__ +#define _GLIBCXX_MANGLE_SIZE_T m +#else +#define _GLIBCXX_MANGLE_SIZE_T j +#endif + /* Define if ptrdiff_t is int. */ #ifndef __x86_64__ #define _GLIBCXX_PTRDIFF_T_IS_INT 1 @@ -1194,9 +1428,6 @@ namespace std #define _GLIBCXX_SIZE_T_IS_UINT 1 #endif -/* Define if the compiler is configured for setjmp/longjmp exceptions. */ -/* #undef _GLIBCXX_SJLJ_EXCEPTIONS */ - /* Define to the value of the EOF integer constant. */ #define _GLIBCXX_STDIO_EOF -1 @@ -1221,15 +1452,14 @@ namespace std /* Define to use Sun versioning in the shared library. */ /* #undef _GLIBCXX_SYMVER_SUN */ +/* Define if C11 functions in should be imported into namespace std + in . */ +/* #undef _GLIBCXX_USE_C11_UCHAR_CXX11 */ + /* Define if C99 functions or macros from , , , , and can be used or exposed. */ #define _GLIBCXX_USE_C99 1 -/* Define if C99 functions in should be used in . Using - compiler builtins for these functions requires corresponding C99 library - functions to be present. */ -#define _GLIBCXX_USE_C99_COMPLEX 1 - /* Define if C99 functions in should be used in . Using compiler builtins for these functions requires corresponding C99 library functions to be present. */ @@ -1251,10 +1481,6 @@ namespace std in namespace std::tr1. */ /* #undef _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 */ -/* Define if C99 functions or macros in should be imported in - in namespace std. */ -#define _GLIBCXX_USE_C99_MATH 1 - /* Define if C99 functions or macros in should be imported in in namespace std::tr1. */ /* #undef _GLIBCXX_USE_C99_MATH_TR1 */ @@ -1263,6 +1489,10 @@ namespace std namespace std::tr1. */ #define _GLIBCXX_USE_C99_STDINT_TR1 1 +/* Defined if clock_gettime syscall has monotonic and realtime clock support. + */ +/* #undef _GLIBCXX_USE_CLOCK_GETTIME_SYSCALL */ + /* Defined if clock_gettime has monotonic clock support. */ /* #undef _GLIBCXX_USE_CLOCK_MONOTONIC */ @@ -1273,6 +1503,12 @@ namespace std this host. */ /* #undef _GLIBCXX_USE_DECIMAL_FLOAT */ +/* Define if fchmod is available in . */ +#define _GLIBCXX_USE_FCHMOD 1 + +/* Define if fchmodat is available in . */ +#define _GLIBCXX_USE_FCHMODAT 1 + /* Define if __float128 is supported on this host. */ #ifndef __ARM_EABI__ #define _GLIBCXX_USE_FLOAT128 1 @@ -1304,10 +1540,16 @@ namespace std /* Define if pthreads_num_processors_np is available in . */ /* #undef _GLIBCXX_USE_PTHREADS_NUM_PROCESSORS_NP */ +/* Define if POSIX read/write locks are available in . */ +/* #undef _GLIBCXX_USE_PTHREAD_RWLOCK_T */ + /* Define if /dev/random and /dev/urandom are available for the random_device of TR1 (Chapter 5.1). */ /* #undef _GLIBCXX_USE_RANDOM_TR1 */ +/* Define if usable realpath is available in . */ +/* #undef _GLIBCXX_USE_REALPATH */ + /* Defined if sched_yield is available. */ /* #undef _GLIBCXX_USE_SCHED_YIELD */ @@ -1317,28 +1559,44 @@ namespace std /* Define if _SC_NPROC_ONLN is available in . */ /* #undef _GLIBCXX_USE_SC_NPROC_ONLN */ +/* Define if sendfile is available in . */ +/* #undef _GLIBCXX_USE_SENDFILE */ + +/* Define if struct stat has timespec members. */ +/* #undef _GLIBCXX_USE_ST_MTIM */ + /* Define if sysctl(), CTL_HW and HW_NCPU are available in . */ /* #undef _GLIBCXX_USE_SYSCTL_HW_NCPU */ +/* Define if obsolescent tmpnam is available in . */ +#define _GLIBCXX_USE_TMPNAM 1 + +/* Define if utimensat and UTIME_OMIT are available in and + AT_FDCWD in . */ +/* #undef _GLIBCXX_USE_UTIMENSAT */ + /* Define if code specialized for wchar_t should be used. */ #define _GLIBCXX_USE_WCHAR_T 1 +/* Define to 1 if a verbose library is built, or 0 otherwise. */ +#define _GLIBCXX_VERBOSE 1 + +/* Defined if as can handle rdrand. */ +#ifndef __ARM_EABI__ +#define _GLIBCXX_X86_RDRAND 1 +#endif + /* Define to 1 if mutex_timedlock is available. */ #define _GTHREAD_USE_MUTEX_TIMEDLOCK 1 -/* Define if all C++ overloads are available in . */ -#if __cplusplus >= 199711L -/* #undef __CORRECT_ISO_CPP_MATH_H_PROTO1 */ +/* Define if all C++11 floating point overloads are available in . */ +#if __cplusplus >= 201103L +/* #undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP */ #endif -/* Define if only double std::abs(double) is available in . */ -#if __cplusplus >= 199711L -/* #undef __CORRECT_ISO_CPP_MATH_H_PROTO2 */ -#endif - -/* Define if all C++ overloads are available in . */ -#if __cplusplus >= 199711L -/* #undef __CORRECT_ISO_CPP_STDLIB_H_PROTO */ +/* Define if all C++11 integral type overloads are available in . */ +#if __cplusplus >= 201103L +/* #undef __CORRECT_ISO_CPP11_MATH_H_PROTO_INT */ #endif #if defined (_GLIBCXX_HAVE__ACOSF) && ! defined (_GLIBCXX_HAVE_ACOSF) diff --git a/repos/libports/include/stdcxx/bits/c++io.h b/repos/libports/include/stdcxx/bits/c++io.h deleted file mode 100644 index a8ee90def6..0000000000 --- a/repos/libports/include/stdcxx/bits/c++io.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/repos/libports/include/stdcxx/bits/c++locale.h b/repos/libports/include/stdcxx/bits/c++locale.h deleted file mode 100644 index 90cdc1918f..0000000000 --- a/repos/libports/include/stdcxx/bits/c++locale.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/repos/libports/include/stdcxx/bits/gthr.h b/repos/libports/include/stdcxx/bits/gthr.h deleted file mode 100644 index f1266b7a2b..0000000000 --- a/repos/libports/include/stdcxx/bits/gthr.h +++ /dev/null @@ -1,298 +0,0 @@ -/* Threads compatibility routines for libgcc2 and libobjc. */ -/* Compile this one with gcc. */ -/* Copyright (C) 1997-2014 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC 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. - -GCC 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 -. */ - -#ifndef GCC_GTHR_SINGLE_H -#define GCC_GTHR_SINGLE_H - -/* Just provide compatibility for mutex handling. */ - -typedef int __gthread_key_t; -typedef int __gthread_once_t; -typedef int __gthread_mutex_t; -typedef int __gthread_recursive_mutex_t; - -#define __GTHREAD_ONCE_INIT 0 -#define __GTHREAD_MUTEX_INIT 0 -#define __GTHREAD_MUTEX_INIT_FUNCTION(mx) -#define __GTHREAD_RECURSIVE_MUTEX_INIT 0 - -#define UNUSED __attribute__((unused)) - -#ifdef _LIBOBJC - -/* Thread local storage for a single thread */ -static void *thread_local_storage = NULL; - -/* Backend initialization functions */ - -/* Initialize the threads subsystem. */ -static inline int -__gthread_objc_init_thread_system (void) -{ - /* No thread support available */ - return -1; -} - -/* Close the threads subsystem. */ -static inline int -__gthread_objc_close_thread_system (void) -{ - /* No thread support available */ - return -1; -} - -/* Backend thread functions */ - -/* Create a new thread of execution. */ -static inline objc_thread_t -__gthread_objc_thread_detach (void (* func)(void *), void * arg UNUSED) -{ - /* No thread support available */ - return NULL; -} - -/* Set the current thread's priority. */ -static inline int -__gthread_objc_thread_set_priority (int priority UNUSED) -{ - /* No thread support available */ - return -1; -} - -/* Return the current thread's priority. */ -static inline int -__gthread_objc_thread_get_priority (void) -{ - return OBJC_THREAD_INTERACTIVE_PRIORITY; -} - -/* Yield our process time to another thread. */ -static inline void -__gthread_objc_thread_yield (void) -{ - return; -} - -/* Terminate the current thread. */ -static inline int -__gthread_objc_thread_exit (void) -{ - /* No thread support available */ - /* Should we really exit the program */ - /* exit (&__objc_thread_exit_status); */ - return -1; -} - -/* Returns an integer value which uniquely describes a thread. */ -static inline objc_thread_t -__gthread_objc_thread_id (void) -{ - /* No thread support, use 1. */ - return (objc_thread_t) 1; -} - -/* Sets the thread's local storage pointer. */ -static inline int -__gthread_objc_thread_set_data (void *value) -{ - thread_local_storage = value; - return 0; -} - -/* Returns the thread's local storage pointer. */ -static inline void * -__gthread_objc_thread_get_data (void) -{ - return thread_local_storage; -} - -/* Backend mutex functions */ - -/* Allocate a mutex. */ -static inline int -__gthread_objc_mutex_allocate (objc_mutex_t mutex UNUSED) -{ - return 0; -} - -/* Deallocate a mutex. */ -static inline int -__gthread_objc_mutex_deallocate (objc_mutex_t mutex UNUSED) -{ - return 0; -} - -/* Grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_lock (objc_mutex_t mutex UNUSED) -{ - /* There can only be one thread, so we always get the lock */ - return 0; -} - -/* Try to grab a lock on a mutex. */ -static inline int -__gthread_objc_mutex_trylock (objc_mutex_t mutex UNUSED) -{ - /* There can only be one thread, so we always get the lock */ - return 0; -} - -/* Unlock the mutex */ -static inline int -__gthread_objc_mutex_unlock (objc_mutex_t mutex UNUSED) -{ - return 0; -} - -/* Backend condition mutex functions */ - -/* Allocate a condition. */ -static inline int -__gthread_objc_condition_allocate (objc_condition_t condition UNUSED) -{ - return 0; -} - -/* Deallocate a condition. */ -static inline int -__gthread_objc_condition_deallocate (objc_condition_t condition UNUSED) -{ - return 0; -} - -/* Wait on the condition */ -static inline int -__gthread_objc_condition_wait (objc_condition_t condition UNUSED, - objc_mutex_t mutex UNUSED) -{ - return 0; -} - -/* Wake up all threads waiting on this condition. */ -static inline int -__gthread_objc_condition_broadcast (objc_condition_t condition UNUSED) -{ - return 0; -} - -/* Wake up one thread waiting on this condition. */ -static inline int -__gthread_objc_condition_signal (objc_condition_t condition UNUSED) -{ - return 0; -} - -#else /* _LIBOBJC */ - -static inline int -__gthread_active_p (void) -{ - return 0; -} - -static inline int -__gthread_once (__gthread_once_t *__once UNUSED, void (*__func) (void) UNUSED) -{ - return 0; -} - -static inline int UNUSED -__gthread_key_create (__gthread_key_t *__key UNUSED, void (*__func) (void *) UNUSED) -{ - return 0; -} - -static int UNUSED -__gthread_key_delete (__gthread_key_t __key UNUSED) -{ - return 0; -} - -static inline void * -__gthread_getspecific (__gthread_key_t __key UNUSED) -{ - return 0; -} - -static inline int -__gthread_setspecific (__gthread_key_t __key UNUSED, const void *__v UNUSED) -{ - return 0; -} - -static inline int -__gthread_mutex_destroy (__gthread_mutex_t *__mutex UNUSED) -{ - return 0; -} - -static inline int -__gthread_mutex_lock (__gthread_mutex_t *__mutex UNUSED) -{ - return 0; -} - -static inline int -__gthread_mutex_trylock (__gthread_mutex_t *__mutex UNUSED) -{ - return 0; -} - -static inline int -__gthread_mutex_unlock (__gthread_mutex_t *__mutex UNUSED) -{ - return 0; -} - -static inline int -__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex) -{ - return __gthread_mutex_lock (__mutex); -} - -static inline int -__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex) -{ - return __gthread_mutex_trylock (__mutex); -} - -static inline int -__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex) -{ - return __gthread_mutex_unlock (__mutex); -} - -static inline int -__gthread_recursive_mutex_destroy (__gthread_recursive_mutex_t *__mutex) -{ - return __gthread_mutex_destroy (__mutex); -} - -#endif /* _LIBOBJC */ - -#undef UNUSED - -#endif /* ! GCC_GTHR_SINGLE_H */ diff --git a/repos/libports/include/stdcxx/bits/opt_random.h b/repos/libports/include/stdcxx/bits/opt_random.h deleted file mode 100644 index 76c91556bb..0000000000 --- a/repos/libports/include/stdcxx/bits/opt_random.h +++ /dev/null @@ -1,38 +0,0 @@ -// Optimizations for random number handling, generic version -*- C++ -*- - -// Copyright (C) 2012-2013 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 -// . - -/** @file bits/opt_random.h - * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{random} - */ - -#ifndef _BITS_OPT_RANDOM_H -#define _BITS_OPT_RANDOM_H 1 - -#pragma GCC system_header - - - - -#endif // _BITS_OPT_RANDOM_H diff --git a/repos/libports/lib/import/import-stdcxx.mk b/repos/libports/lib/import/import-stdcxx.mk index 62d270466d..9880b5bce7 100644 --- a/repos/libports/lib/import/import-stdcxx.mk +++ b/repos/libports/lib/import/import-stdcxx.mk @@ -2,16 +2,14 @@ STDCXX_INCLUDE_DIR := $(call select_from_repositories,include/stdcxx) INC_DIR += $(STDCXX_INCLUDE_DIR) \ $(STDCXX_INCLUDE_DIR)/std \ - $(STDCXX_INCLUDE_DIR)/c_std \ $(STDCXX_INCLUDE_DIR)/c_global STDCXX_PORT_INCLUDE_DIR := $(call select_from_ports,stdcxx)/include/stdcxx INC_DIR += $(STDCXX_PORT_INCLUDE_DIR) \ $(STDCXX_PORT_INCLUDE_DIR)/std \ - $(STDCXX_PORT_INCLUDE_DIR)/c_std \ $(STDCXX_PORT_INCLUDE_DIR)/c_global -LIBS += libc libm +# stdcxx headers include libc headers include $(call select_from_repositories,lib/import/import-libc.mk) # prevent gcc headers from defining mbstate diff --git a/repos/libports/lib/mk/stdcxx-c++98.mk b/repos/libports/lib/mk/stdcxx-c++98.mk new file mode 100644 index 0000000000..02dbe2a429 --- /dev/null +++ b/repos/libports/lib/mk/stdcxx-c++98.mk @@ -0,0 +1,43 @@ +STDCXX_PORT_DIR := $(call select_from_ports,stdcxx) + +include $(REP_DIR)/lib/import/import-stdcxx.mk + +# determine location of libstdc++ source tree +STDCXX_DIR := $(STDCXX_PORT_DIR)/src/lib/stdcxx + +# exclude code that is no single compilation unit +FILTER_OUT = hash-long-double-tr1-aux.cc + +# exclude deprecated parts +FILTER_OUT += strstream.cc + +# add libstdc++ sources +SRC_CC += $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(STDCXX_DIR)/src/c++98/*.cc))) + +CC_CXX_OPT_STD = -std=gnu++98 +CC_CXX_OPT_STD_locale_init = -std=gnu++11 +CC_CXX_OPT_STD_localename = -std=gnu++11 + +CC_OPT_collate_members_cow += -D_GLIBCXX_USE_CXX11_ABI=0 +CC_OPT_messages_members_cow += -D_GLIBCXX_USE_CXX11_ABI=0 +CC_OPT_monetary_members_cow += -D_GLIBCXX_USE_CXX11_ABI=0 +CC_OPT_numeric_members_cow += -D_GLIBCXX_USE_CXX11_ABI=0 + +# add config/cpu/generic sources +SRC_CC += $(notdir $(wildcard $(STDCXX_DIR)/config/cpu/generic/*.cc)) + +# add config/locale/generic sources +SRC_CC += $(notdir $(wildcard $(STDCXX_DIR)/config/locale/generic/*.cc)) + +# add config/os/generic sources +SRC_CC += $(notdir $(wildcard $(STDCXX_DIR)/config/os/generic/*.cc)) + +# add config/io backend +SRC_CC += basic_file_stdio.cc +INC_DIR += $(STDCXX_DIR)/config/io + +vpath %.cc $(STDCXX_DIR)/src/c++98 +vpath %.cc $(STDCXX_DIR)/config/cpu/generic +vpath %.cc $(STDCXX_DIR)/config/locale/generic +vpath %.cc $(STDCXX_DIR)/config/os/generic +vpath %.cc $(STDCXX_DIR)/config/io diff --git a/repos/libports/lib/mk/stdcxx.mk b/repos/libports/lib/mk/stdcxx.mk index f561be3351..682fe9977f 100644 --- a/repos/libports/lib/mk/stdcxx.mk +++ b/repos/libports/lib/mk/stdcxx.mk @@ -1,54 +1,27 @@ STDCXX_PORT_DIR := $(call select_from_ports,stdcxx) +include $(REP_DIR)/lib/import/import-stdcxx.mk + # determine location of libstdc++ source tree STDCXX_DIR := $(STDCXX_PORT_DIR)/src/lib/stdcxx -# public headers from port -INC_DIR += $(STDCXX_PORT_DIR)/include/stdcxx - -# enable 'atomic.cc' to find 'gstdint.h' +# enable 'compatibility-atomic-c++0x.cc' to find 'gstdint.h' INC_DIR += $(REP_DIR)/include/stdcxx/bits -## enable 'allocator-inst.cc' to find 'memory' -#INC_DIR += $(REP_DIR)/include/stdcxx/std - -# exclude code that is no single compilation unit -FILTER_OUT = hash-long-double-tr1-aux.cc - -# exclude deprecated parts -FILTER_OUT += strstream.cc - # add libstdc++ sources SRC_CC += $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(STDCXX_DIR)/src/c++11/*.cc))) -SRC_CC += $(filter-out $(FILTER_OUT),$(notdir $(wildcard $(STDCXX_DIR)/src/c++98/*.cc))) - -# add config/locale/generic sources -SRC_CC += $(notdir $(wildcard $(STDCXX_DIR)/config/locale/generic/*.cc)) - -# add config/os/generic sources -SRC_CC += $(notdir $(wildcard $(STDCXX_DIR)/config/os/generic/*.cc)) - -CC_OPT += -D__GXX_EXPERIMENTAL_CXX0X__ -std=c++11 - -# add config/io backend -SRC_CC += basic_file_stdio.cc -INC_DIR += $(STDCXX_DIR)/config/io # add bits of libsupc++ (most parts are already contained in the cxx library) SRC_CC += new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc new_handler.cc -SRC_CC += del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc +SRC_CC += del_op.cc del_opnt.cc del_ops.cc del_opv.cc del_opvnt.cc del_opvs.cc SRC_CC += bad_array_length.cc bad_array_new.cc bad_cast.cc bad_alloc.cc bad_typeid.cc SRC_CC += eh_aux_runtime.cc hash_bytes.cc SRC_CC += tinfo.cc INC_DIR += $(STDCXX_DIR)/libsupc++ -include $(REP_DIR)/lib/import/import-stdcxx.mk +LIBS += stdcxx-c++98 libc libm vpath %.cc $(STDCXX_DIR)/src/c++11 -vpath %.cc $(STDCXX_DIR)/src/c++98 -vpath %.cc $(STDCXX_DIR)/config/locale/generic -vpath %.cc $(STDCXX_DIR)/config/os/generic -vpath %.cc $(STDCXX_DIR)/config/io vpath %.cc $(STDCXX_DIR)/libsupc++ SHARED_LIB = yes diff --git a/repos/libports/ports/stdcxx.hash b/repos/libports/ports/stdcxx.hash index c221ff97c4..ed0b3ae610 100644 --- a/repos/libports/ports/stdcxx.hash +++ b/repos/libports/ports/stdcxx.hash @@ -1 +1 @@ -e718998ad84312ca17d023013fc1e1e981c144be +bddb20f71bfb31a164f4eb5a7ec3bd8a88af1deb diff --git a/repos/libports/ports/stdcxx.port b/repos/libports/ports/stdcxx.port index 247170fcad..837b8e5618 100644 --- a/repos/libports/ports/stdcxx.port +++ b/repos/libports/ports/stdcxx.port @@ -1,48 +1,68 @@ LICENSE := LGPL -VERSION := 4.9.2 +VERSION := 6.3.0 DOWNLOADS := gcc.archive URL(gcc) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.bz2 -SHA(gcc) := 79dbcb09f44232822460d80b033c962c0237c6d8 +SHA(gcc) := 928ab552666ee08eed645ff20ceb49d139205dea DIR(gcc) := src/lib/stdcxx SIG(gcc) := ${URL(gcc)} KEY(gcc) := GNU -TAR_OPT(gcc) := gcc-$(VERSION)/libstdc++-v3 --strip-components=2 +TAR_OPT(gcc) := gcc-$(VERSION)/libstdc++-v3 \ + gcc-$(VERSION)/libgcc/gthr-single.h \ + --strip-components=2 -PATCHES := src/lib/stdcxx/type_traits.patch +PATCHES := src/lib/stdcxx/*.patch PATCH_OPT := -p1 -d src/lib/stdcxx DIRS := include/stdcxx DIR_CONTENT(include/stdcxx) := \ src/lib/stdcxx/include/* \ - src/lib/stdcxx/libsupc++/new \ + src/lib/stdcxx/include/c_compatibility/complex.h \ + src/lib/stdcxx/include/c_compatibility/fenv.h \ + src/lib/stdcxx/include/c_compatibility/tgmath.h \ + src/lib/stdcxx/libsupc++/cxxabi.h \ src/lib/stdcxx/libsupc++/exception \ - src/lib/stdcxx/libsupc++/typeinfo \ - src/lib/stdcxx/libsupc++/initializer_list + src/lib/stdcxx/libsupc++/initializer_list \ + src/lib/stdcxx/libsupc++/new \ + src/lib/stdcxx/libsupc++/typeinfo DIRS += include/stdcxx/bits DIR_CONTENT(include/stdcxx/bits) := \ - src/lib/stdcxx/libsupc++/hash_bytes.h \ + src/lib/stdcxx/libsupc++/atomic_lockfree_defines.h \ + src/lib/stdcxx/libsupc++/cxxabi_forced.h \ src/lib/stdcxx/libsupc++/exception_defines.h \ src/lib/stdcxx/libsupc++/exception_ptr.h \ + src/lib/stdcxx/libsupc++/hash_bytes.h \ src/lib/stdcxx/libsupc++/nested_exception.h \ - src/lib/stdcxx/libsupc++/cxxabi_forced.h \ - src/lib/stdcxx/libsupc++/atomic_lockfree_defines.h \ + src/lib/stdcxx/config/cpu/generic/atomic_word.h \ src/lib/stdcxx/config/cpu/generic/cpu_defines.h \ src/lib/stdcxx/config/cpu/generic/cxxabi_tweaks.h \ - src/lib/stdcxx/config/os/generic/error_constants.h \ - src/lib/stdcxx/config/os/generic/os_defines.h \ - src/lib/stdcxx/config/cpu/generic/atomic_word.h \ + src/lib/stdcxx/config/cpu/generic/opt/bits/opt_random.h \ src/lib/stdcxx/config/os/generic/ctype_base.h \ src/lib/stdcxx/config/os/generic/ctype_inline.h \ - src/lib/stdcxx/config/locale/generic/time_members.h \ - src/lib/stdcxx/config/locale/generic/messages_members.h + src/lib/stdcxx/config/os/generic/error_constants.h \ + src/lib/stdcxx/config/os/generic/os_defines.h \ + src/lib/stdcxx/config/locale/generic/messages_members.h \ + src/lib/stdcxx/config/locale/generic/time_members.h DIRS += include/stdcxx/config DIR_CONTENT(include/stdcxx/config) := \ src/lib/stdcxx/config/allocator/new_allocator_base.h \ - src/lib/stdcxx/config/locale/generic/c_locale.h \ src/lib/stdcxx/config/io/basic_file_stdio.h \ - src/lib/stdcxx/config/io/c_io_stdio.h + src/lib/stdcxx/config/io/c_io_stdio.h \ + src/lib/stdcxx/config/locale/generic/c_locale.h +default: symlinks + +symlinks: $(DOWNLOADS) + ln -s ../../config/io/basic_file_stdio.h src/lib/stdcxx/include/bits/basic_file.h + ln -s ../../config/allocator/new_allocator_base.h src/lib/stdcxx/include/bits/c++allocator.h + ln -s ../../config/io/c_io_stdio.h src/lib/stdcxx/include/bits/c++io.h + ln -s ../../config/locale/generic/c_locale.h src/lib/stdcxx/include/bits/c++locale.h + ln -s ../../gthr-single.h src/lib/stdcxx/include/bits/gthr.h + ln -s atomicity_builtins/atomicity.h src/lib/stdcxx/config/cpu/generic/atomicity.cc + ln -s collate_members.cc src/lib/stdcxx/config/locale/generic/collate_members_cow.cc + ln -s messages_members.cc src/lib/stdcxx/config/locale/generic/messages_members_cow.cc + ln -s monetary_members.cc src/lib/stdcxx/config/locale/generic/monetary_members_cow.cc + ln -s numeric_members.cc src/lib/stdcxx/config/locale/generic/numeric_members_cow.cc diff --git a/repos/libports/src/lib/stdcxx/include_next.patch b/repos/libports/src/lib/stdcxx/include_next.patch new file mode 100644 index 0000000000..52bedb9005 --- /dev/null +++ b/repos/libports/src/lib/stdcxx/include_next.patch @@ -0,0 +1,46 @@ +include_next.patch + +From: Christian Prochaska + + +--- + include/c_global/cmath | 7 ++++++- + include/c_global/cstdlib | 7 ++++++- + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/include/c_global/cmath b/include/c_global/cmath +index 560632a..7a1c651 100644 +--- a/include/c_global/cmath ++++ b/include/c_global/cmath +@@ -42,7 +42,12 @@ + #include + #include + #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +-#include_next ++// On Genode, the libc include paths appear before the stdcxx include paths ++// and the original '#include_next' failed. Adding the libc include paths ++// to INC_DIR again did not help, because the duplication was detected ++// and ignored. So, math.h is included with '#include' again, like in ++// previous GCC versions. ++#include + #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS + + #ifndef _GLIBCXX_CMATH +diff --git a/include/c_global/cstdlib b/include/c_global/cstdlib +index 1ba5fb7..8ca65a1 100644 +--- a/include/c_global/cstdlib ++++ b/include/c_global/cstdlib +@@ -72,7 +72,12 @@ namespace std + // Need to ensure this finds the C library's not a libstdc++ + // wrapper that might already be installed later in the include search path. + #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +-#include_next ++// On Genode, the libc include paths appear before the stdcxx include paths ++// and the original '#include_next' failed. Adding the libc include paths ++// to INC_DIR again did not help, because the duplication was detected ++// and ignored. So, stdlib.h is included with '#include' again, like in ++// previous GCC versions. ++#include + #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS + + // Get rid of those macros defined in in lieu of real functions.