• 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/or1k-musl-5.4.0-20170218/850-libstdcxx-uclibc-c99.patch
Peter KorsgaardPeter Korsgaard committed e478ad1e5da03 Feb 2018
Raw file
Source viewDiff to previous
 
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
​
18
Index: b/libstdc++-v3/config/locale/generic/c_locale.h
19
===================================================================
20
--- a/libstdc++-v3/config/locale/generic/c_locale.h
21
+++ b/libstdc++-v3/config/locale/generic/c_locale.h
22
@@ -70,7 +70,7 @@
23
     __builtin_va_list __args;
24
     __builtin_va_start(__args, __fmt);
25
 
26
-#ifdef _GLIBCXX_USE_C99
27
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
28
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
29
 #else
30
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
31
Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
32
===================================================================
33
--- a/libstdc++-v3/config/locale/gnu/c_locale.h
34
+++ b/libstdc++-v3/config/locale/gnu/c_locale.h
35
@@ -88,7 +88,7 @@
36
     __builtin_va_list __args;
37
     __builtin_va_start(__args, __fmt);
38
 
39
-#ifdef _GLIBCXX_USE_C99
40
+#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
41
     const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
42
 #else
43
     const int __ret = __builtin_vsprintf(__out, __fmt, __args);
44
Index: b/libstdc++-v3/include/bits/basic_string.h
45
===================================================================
46
--- a/libstdc++-v3/include/bits/basic_string.h
47
+++ b/libstdc++-v3/include/bits/basic_string.h
48
@@ -5239,7 +5239,7 @@
49
 _GLIBCXX_END_NAMESPACE_VERSION
50
 } // namespace
51
 
52
-#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
53
+#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
54
 
55
 #include <ext/string_conversions.h>
56
 
57
Index: b/libstdc++-v3/include/bits/locale_facets.tcc
58
===================================================================
59
--- a/libstdc++-v3/include/bits/locale_facets.tcc
60
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
61
@@ -992,7 +992,7 @@
62
    char __fbuf[16];
63
    __num_base::_S_format_float(__io, __fbuf, __mod);
  • 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.