summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-02-24 06:39:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-24 23:12:18 +0000
commitd6a2cf3cbef581478185c25d8a7a6109a201c583 (patch)
tree24e05ea3538ebae35ae2697c9059dc915558003c /meta
parent4d83a90bfb5a41deb81ca8878363a89fccf95d89 (diff)
downloadpoky-d6a2cf3cbef581478185c25d8a7a6109a201c583.tar.gz
glibc: Help compile with -Os
When we modify to use -Os -Werror doesnt go well with it, glibc needs to be cleaned up for that but until then lets disable -Werror when using -Os Also updates the options group patch to work better with -Os. (From OE-Core rev: 98e1dc574ef3be668d6a42232ad030d1af93c49f) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/glibc/glibc.inc3
-rw-r--r--meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch47
2 files changed, 43 insertions, 7 deletions
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 99a4753044..4d5e98b969 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -15,6 +15,9 @@ def get_optimization(d):
15 if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x": 15 if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
16 bb.note("glibc can't be built with -O0, -O2 will be used instead.") 16 bb.note("glibc can't be built with -O0, -O2 will be used instead.")
17 return selected_optimization.replace("-O0", "-O2") 17 return selected_optimization.replace("-O0", "-O2")
18 elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
19 bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
20 return selected_optimization.replace("-Os", "-Os -Wno-error")
18 return selected_optimization 21 return selected_optimization
19 22
20SELECTED_OPTIMIZATION := "${@get_optimization(d)}" 23SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
diff --git a/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch b/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch
index 0fcaff9719..439b4a95f6 100644
--- a/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch
+++ b/meta/recipes-core/glibc/glibc/eglibc-use-option-groups.patch
@@ -2294,11 +2294,37 @@ Index: git/locale/programs/locfile.h
2294 /* Change the output to be big-endian if BIG_ENDIAN is true and 2294 /* Change the output to be big-endian if BIG_ENDIAN is true and
2295 little-endian otherwise. */ 2295 little-endian otherwise. */
2296 static inline void 2296 static inline void
2297@@ -276,4 +278,49 @@ extern void identification_output (struc 2297@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
2298 }
2299
2300 /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
2301-static inline void
2302+static void
2303+__attribute__ ((unused))
2304 maybe_swap_uint32_array (uint32_t *array, size_t n)
2305 {
2306 if (swap_endianness_p)
2307@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array
2308
2309 /* Like maybe_swap_uint32_array, but the array of N elements is at
2310 the end of OBSTACK's current object. */
2311-static inline void
2312+static void
2313+__attribute__ ((unused))
2314 maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
2315 {
2316 maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
2317@@ -276,4 +280,55 @@ extern void identification_output (struc
2298 const struct charmap_t *charmap, 2318 const struct charmap_t *charmap,
2299 const char *output_path); 2319 const char *output_path);
2300 2320
2301+static inline size_t 2321+static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
2322+static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
2323+static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
2324+static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
2325+static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
2326+
2327+static size_t
2302+wcslen_uint32 (const uint32_t *str) 2328+wcslen_uint32 (const uint32_t *str)
2303+{ 2329+{
2304+ size_t len = 0; 2330+ size_t len = 0;
@@ -2307,7 +2333,7 @@ Index: git/locale/programs/locfile.h
2307+ return len; 2333+ return len;
2308+} 2334+}
2309+ 2335+
2310+static inline int 2336+static int
2311+wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) 2337+wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
2312+{ 2338+{
2313+ while (n-- != 0) 2339+ while (n-- != 0)
@@ -2319,7 +2345,7 @@ Index: git/locale/programs/locfile.h
2319+ return 0; 2345+ return 0;
2320+} 2346+}
2321+ 2347+
2322+static inline int 2348+static int
2323+wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) 2349+wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
2324+{ 2350+{
2325+ while (*s1 != 0 && *s1 == *s2) 2351+ while (*s1 != 0 && *s1 == *s2)
@@ -2327,13 +2353,13 @@ Index: git/locale/programs/locfile.h
2327+ return *s1 - *s2; 2353+ return *s1 - *s2;
2328+} 2354+}
2329+ 2355+
2330+static inline uint32_t * 2356+static uint32_t *
2331+wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) 2357+wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
2332+{ 2358+{
2333+ return memcpy (s1, s2, n * sizeof (uint32_t)); 2359+ return memcpy (s1, s2, n * sizeof (uint32_t));
2334+} 2360+}
2335+ 2361+
2336+static inline uint32_t * 2362+static uint32_t *
2337+wcschr_uint32 (const uint32_t *s, uint32_t ch) 2363+wcschr_uint32 (const uint32_t *s, uint32_t ch)
2338+{ 2364+{
2339+ do 2365+ do
@@ -5627,7 +5653,7 @@ Index: git/posix/regexec.c
5627 /* match with character_class? */ 5653 /* match with character_class? */
5628 for (i = 0; i < cset->nchar_classes; ++i) 5654 for (i = 0; i < cset->nchar_classes; ++i)
5629 { 5655 {
5630@@ -3863,8 +3843,16 @@ check_node_accept_bytes (const re_dfa_t 5656@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t
5631 goto check_node_accept_bytes_match; 5657 goto check_node_accept_bytes_match;
5632 } 5658 }
5633 } 5659 }
@@ -5645,6 +5671,13 @@ Index: git/posix/regexec.c
5645 nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES); 5671 nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
5646 if (nrules != 0) 5672 if (nrules != 0)
5647 { 5673 {
5674 unsigned int in_collseq = 0;
5675 const int32_t *table, *indirect;
5676- const unsigned char *weights, *extra;
5677+ const unsigned char *weights, *extra = NULL;
5678 const char *collseqwc;
5679
5680 /* match with collating_symbol? */
5648@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t 5681@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t
5649 } 5682 }
5650 } 5683 }