• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/gcc/4.9.4/850-libstdcxx-uclibc-c99.patch
Thomas PetazzoniThomas Petazzoni committed 50c02bd72b103 Aug 2016
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
Allow C99-depending features of libstdc++ with uClibc
2
​
3
The libstdc++ code is fairly restrictive on how it checks for C99
4
compatibility: it requires *complete* C99 support to enable certain
5
features. For example, uClibc provides a good number of C99 features,
6
but not C99 complex number support. For this reason, libstdc++
7
completely disables many the standard C++ methods that can in fact
8
work because uClibc provides the necessary functions.
9
​
10
This patch is similar and highly inspired from
11
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
12
a way that doesn't involve changing the configure.ac script, as
13
autoreconfiguring gcc is complicated. It simply relies on the fact
14
that uClibc defines the __UCLIBC__ definition.
15
​
16
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17
[Gustavo: update for 4.9.3]
18
​
19
Index: b/libstdc++-v3/config/locale/generic/c_locale.h
20
===================================================================
21
--- a/libstdc++-v3/config/locale/generic/c_locale.h
22
+++ b/libstdc++-v3/config/locale/generic/c_locale.h
23
@@ -70,7 +70,7 @@
24
     __builtin_va_list __args;
25
     __builtin_va_start(__args, __fmt);
26
 
27
-#ifdef _GLIBCXX_USE_C99
28
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
29
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
30
 #else
31
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
32
Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
33
===================================================================
34
--- a/libstdc++-v3/config/locale/gnu/c_locale.h
35
+++ b/libstdc++-v3/config/locale/gnu/c_locale.h
36
@@ -88,7 +88,7 @@
37
     __builtin_va_list __args;
38
     __builtin_va_start(__args, __fmt);
39
 
40
-#ifdef _GLIBCXX_USE_C99
41
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
42
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
43
 #else
44
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
45
Index: b/libstdc++-v3/include/bits/basic_string.h
46
===================================================================
47
--- a/libstdc++-v3/include/bits/basic_string.h
48
+++ b/libstdc++-v3/include/bits/basic_string.h
49
@@ -2843,7 +2843,7 @@
50
 _GLIBCXX_END_NAMESPACE_VERSION
51
 } // namespace
52
 
53
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
54
+#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
55
 
56
 #include <ext/string_conversions.h>
57
 
58
Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
59
===================================================================
60
--- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
61
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
62
@@ -572,7 +572,7 @@
63
     {
64
       const locale __loc = __io.getloc();
65
       const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
66
-#ifdef _GLIBCXX_USE_C99
67
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
68
       // First try a buffer perhaps big enough.
69
       int __cs_size = 64;
70
       char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
71
Index: b/libstdc++-v3/include/bits/locale_facets.tcc
72
===================================================================
73
--- a/libstdc++-v3/include/bits/locale_facets.tcc
74
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
75
@@ -987,7 +987,7 @@
76
    char __fbuf[16];
77
    __num_base::_S_format_float(__io, __fbuf, __mod);
78
 
79
-#ifdef _GLIBCXX_USE_C99
80
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
81
    // First try a buffer perhaps big enough (most probably sufficient
82
    // for non-ios_base::fixed outputs)
83
    int __cs_size = __max_digits * 3;
84
Index: b/libstdc++-v3/include/c_compatibility/math.h
85
===================================================================
86
--- a/libstdc++-v3/include/c_compatibility/math.h
87
+++ b/libstdc++-v3/include/c_compatibility/math.h
88
@@ -56,7 +56,7 @@
89
 using std::floor;
90
 using std::fmod;
91
 
92
-#if _GLIBCXX_USE_C99
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.