* [PATCH] glibc: Help compile with -Os
@ 2015-02-24 6:39 Khem Raj
2015-02-24 12:11 ` Burton, Ross
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Khem Raj @ 2015-02-24 6:39 UTC (permalink / raw)
To: openembedded-core
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
Change-Id: I5495255fce67953f15c07e423e3e0eef41d4ce5e
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/glibc/glibc.inc | 3 ++
.../glibc/glibc/eglibc-use-option-groups.patch | 47 ++++++++++++++++++----
2 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 99a4753..4d5e98b 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -15,6 +15,9 @@ def get_optimization(d):
if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
bb.note("glibc can't be built with -O0, -O2 will be used instead.")
return selected_optimization.replace("-O0", "-O2")
+ elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+ bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
+ return selected_optimization.replace("-Os", "-Os -Wno-error")
return selected_optimization
SELECTED_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 0fcaff9..439b4a9 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
/* Change the output to be big-endian if BIG_ENDIAN is true and
little-endian otherwise. */
static inline void
-@@ -276,4 +278,49 @@ extern void identification_output (struc
+@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
+ }
+
+ /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_array (uint32_t *array, size_t n)
+ {
+ if (swap_endianness_p)
+@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array
+
+ /* Like maybe_swap_uint32_array, but the array of N elements is at
+ the end of OBSTACK's current object. */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
+ {
+ maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
+@@ -276,4 +280,55 @@ extern void identification_output (struc
const struct charmap_t *charmap,
const char *output_path);
-+static inline size_t
++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++
++static size_t
+wcslen_uint32 (const uint32_t *str)
+{
+ size_t len = 0;
@@ -2307,7 +2333,7 @@ Index: git/locale/programs/locfile.h
+ return len;
+}
+
-+static inline int
++static int
+wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
+{
+ while (n-- != 0)
@@ -2319,7 +2345,7 @@ Index: git/locale/programs/locfile.h
+ return 0;
+}
+
-+static inline int
++static int
+wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
+{
+ while (*s1 != 0 && *s1 == *s2)
@@ -2327,13 +2353,13 @@ Index: git/locale/programs/locfile.h
+ return *s1 - *s2;
+}
+
-+static inline uint32_t *
++static uint32_t *
+wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
+{
+ return memcpy (s1, s2, n * sizeof (uint32_t));
+}
+
-+static inline uint32_t *
++static uint32_t *
+wcschr_uint32 (const uint32_t *s, uint32_t ch)
+{
+ do
@@ -5627,7 +5653,7 @@ Index: git/posix/regexec.c
/* match with character_class? */
for (i = 0; i < cset->nchar_classes; ++i)
{
-@@ -3863,8 +3843,16 @@ check_node_accept_bytes (const re_dfa_t
+@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t
goto check_node_accept_bytes_match;
}
}
@@ -5645,6 +5671,13 @@ Index: git/posix/regexec.c
nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
if (nrules != 0)
{
+ unsigned int in_collseq = 0;
+ const int32_t *table, *indirect;
+- const unsigned char *weights, *extra;
++ const unsigned char *weights, *extra = NULL;
+ const char *collseqwc;
+
+ /* match with collating_symbol? */
@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t
}
}
--
2.1.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-02-24 6:39 [PATCH] glibc: Help compile with -Os Khem Raj
@ 2015-02-24 12:11 ` Burton, Ross
2015-02-24 16:08 ` Khem Raj
2015-03-02 4:23 ` Peter Urbanec
2015-03-05 6:53 ` Robert Yang
2 siblings, 1 reply; 8+ messages in thread
From: Burton, Ross @ 2015-02-24 12:11 UTC (permalink / raw)
To: Khem Raj; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 245 bytes --]
On 24 February 2015 at 06:39, Khem Raj <raj.khem@gmail.com> wrote:
> .../glibc/glibc/eglibc-use-option-groups.patch | 47
> ++++++++++++++++++----
>
Is this chunk related? The commit log only talks about disabling -Werror.
Ross
[-- Attachment #2: Type: text/html, Size: 651 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-02-24 12:11 ` Burton, Ross
@ 2015-02-24 16:08 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2015-02-24 16:08 UTC (permalink / raw)
To: Burton, Ross; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
> On Feb 24, 2015, at 4:11 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
>
> On 24 February 2015 at 06:39, Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>> wrote:
> .../glibc/glibc/eglibc-use-option-groups.patch | 47 ++++++++++++++++++----
>
> Is this chunk related? The commit log only talks about disabling -Werror.
>
yes it is. it fixed some of the obvious errors. but thats not enough. There is a lot more cleanup needed
> Ross
[-- Attachment #2: Type: text/html, Size: 1519 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-02-24 6:39 [PATCH] glibc: Help compile with -Os Khem Raj
2015-02-24 12:11 ` Burton, Ross
@ 2015-03-02 4:23 ` Peter Urbanec
2015-03-02 4:35 ` Peter Urbanec
2015-03-05 6:53 ` Robert Yang
2 siblings, 1 reply; 8+ messages in thread
From: Peter Urbanec @ 2015-03-02 4:23 UTC (permalink / raw)
To: Khem Raj, openembedded-core
On 24/02/15 17:39, Khem Raj wrote:
> 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
>
> Change-Id: I5495255fce67953f15c07e423e3e0eef41d4ce5e
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-core/glibc/glibc.inc | 3 ++
> .../glibc/glibc/eglibc-use-option-groups.patch | 47 ++++++++++++++++++----
> 2 files changed, 43 insertions(+), 7 deletions(-)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index 99a4753..4d5e98b 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -15,6 +15,9 @@ def get_optimization(d):
> if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
> bb.note("glibc can't be built with -O0, -O2 will be used instead.")
> return selected_optimization.replace("-O0", "-O2")
> + elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
> + bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
> + return selected_optimization.replace("-Os", "-Os -Wno-error")
I think there's a typo here which prevents this from working as
intended. The second check is done on "-O0" when it's supposed to be "-Os"
Cheers,
Peter
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-03-02 4:23 ` Peter Urbanec
@ 2015-03-02 4:35 ` Peter Urbanec
2015-03-02 6:48 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Peter Urbanec @ 2015-03-02 4:35 UTC (permalink / raw)
To: Khem Raj, openembedded-core
On 02/03/15 15:23, Peter Urbanec wrote:
> I think there's a typo here which prevents this from working as
> intended. The second check is done on "-O0" when it's supposed to be "-Os"
Tested patch submitted.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-03-02 4:35 ` Peter Urbanec
@ 2015-03-02 6:48 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2015-03-02 6:48 UTC (permalink / raw)
To: Peter Urbanec; +Cc: Patches and discussions about the oe-core layer
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
On Mar 1, 2015 8:35 PM, "Peter Urbanec" <openembedded-devel@urbanec.net>
wrote:
>
> On 02/03/15 15:23, Peter Urbanec wrote:
>>
>> I think there's a typo here which prevents this from working as
>> intended. The second check is done on "-O0" when it's supposed to be
"-Os"
>
>
> Tested patch submitted.
>
Thanks
[-- Attachment #2: Type: text/html, Size: 523 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-02-24 6:39 [PATCH] glibc: Help compile with -Os Khem Raj
2015-02-24 12:11 ` Burton, Ross
2015-03-02 4:23 ` Peter Urbanec
@ 2015-03-05 6:53 ` Robert Yang
2015-03-06 9:28 ` Khem Raj
2 siblings, 1 reply; 8+ messages in thread
From: Robert Yang @ 2015-03-05 6:53 UTC (permalink / raw)
To: Khem Raj, openembedded-core
Hello,
I get errors when:
MACHINE = "qemux86"
DEBUG_BUILD = "1"
$ bitbake glibc
../include/inline-hashtab.h: In function '_dl_make_tlsdesc_dynamic':
./tlsdeschtab.h:28:1: error: inlining failed in call to 'hash_tlsdesc': indirect
function call with a yet undetermined callee [-Werror=inline]
hash_tlsdesc (void *p)
^
In file included from ./tlsdeschtab.h:25:0,
from ../sysdeps/i386/tlsdesc.c:25:
../include/inline-hashtab.h:154:3: error: called from here [-Werror=inline]
*find_empty_slot_for_expand (htab, hash_fn (*p))
^
In file included from ../sysdeps/i386/tlsdesc.c:25:0:
./tlsdeschtab.h:28:1: error: inlining failed in call to 'hash_tlsdesc': indirect
function call with a yet undetermined callee [-Werror=inline]
hash_tlsdesc (void *p)
^
In file included from ./tlsdeschtab.h:25:0,
from ../sysdeps/i386/tlsdesc.c:25:
../include/inline-hashtab.h:201:8: error: called from here [-Werror=inline]
hash = hash_fn (ptr);
^
In file included from ../sysdeps/i386/tlsdesc.c:25:0:
./tlsdeschtab.h:38:1: error: inlining failed in call to 'eq_tlsdesc': indirect
function call with a yet undetermined callee [-Werror=inline]
eq_tlsdesc (void *p, void *q)
^
In file included from ./tlsdeschtab.h:25:0,
from ../sysdeps/i386/tlsdesc.c:25:
../include/inline-hashtab.h:209:12: error: called from here [-Werror=inline]
else if (eq_fn (*entry, ptr))
^
In file included from ../sysdeps/i386/tlsdesc.c:25:0:
./tlsdeschtab.h:38:1: error: inlining failed in call to 'eq_tlsdesc': indirect
function call with a yet undetermined callee [-Werror=inline]
eq_tlsdesc (void *p, void *q)
^
In file included from ./tlsdeschtab.h:25:0,
from ../sysdeps/i386/tlsdesc.c:25:
../include/inline-hashtab.h:222:16: error: called from here [-Werror=inline]
else if (eq_fn (*entry, ptr))
// Robert
On 02/24/2015 02:39 PM, Khem Raj wrote:
> 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
>
> Change-Id: I5495255fce67953f15c07e423e3e0eef41d4ce5e
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-core/glibc/glibc.inc | 3 ++
> .../glibc/glibc/eglibc-use-option-groups.patch | 47 ++++++++++++++++++----
> 2 files changed, 43 insertions(+), 7 deletions(-)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index 99a4753..4d5e98b 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -15,6 +15,9 @@ def get_optimization(d):
> if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
> bb.note("glibc can't be built with -O0, -O2 will be used instead.")
> return selected_optimization.replace("-O0", "-O2")
> + elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
> + bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
> + return selected_optimization.replace("-Os", "-Os -Wno-error")
> return selected_optimization
>
> SELECTED_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 0fcaff9..439b4a9 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
> /* Change the output to be big-endian if BIG_ENDIAN is true and
> little-endian otherwise. */
> static inline void
> -@@ -276,4 +278,49 @@ extern void identification_output (struc
> +@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
> + }
> +
> + /* Likewise, but munge an array of N uint32_ts starting at ARRAY. */
> +-static inline void
> ++static void
> ++__attribute__ ((unused))
> + maybe_swap_uint32_array (uint32_t *array, size_t n)
> + {
> + if (swap_endianness_p)
> +@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array
> +
> + /* Like maybe_swap_uint32_array, but the array of N elements is at
> + the end of OBSTACK's current object. */
> +-static inline void
> ++static void
> ++__attribute__ ((unused))
> + maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
> + {
> + maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
> +@@ -276,4 +280,55 @@ extern void identification_output (struc
> const struct charmap_t *charmap,
> const char *output_path);
>
> -+static inline size_t
> ++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
> ++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
> ++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
> ++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
> ++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
> ++
> ++static size_t
> +wcslen_uint32 (const uint32_t *str)
> +{
> + size_t len = 0;
> @@ -2307,7 +2333,7 @@ Index: git/locale/programs/locfile.h
> + return len;
> +}
> +
> -+static inline int
> ++static int
> +wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
> +{
> + while (n-- != 0)
> @@ -2319,7 +2345,7 @@ Index: git/locale/programs/locfile.h
> + return 0;
> +}
> +
> -+static inline int
> ++static int
> +wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
> +{
> + while (*s1 != 0 && *s1 == *s2)
> @@ -2327,13 +2353,13 @@ Index: git/locale/programs/locfile.h
> + return *s1 - *s2;
> +}
> +
> -+static inline uint32_t *
> ++static uint32_t *
> +wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
> +{
> + return memcpy (s1, s2, n * sizeof (uint32_t));
> +}
> +
> -+static inline uint32_t *
> ++static uint32_t *
> +wcschr_uint32 (const uint32_t *s, uint32_t ch)
> +{
> + do
> @@ -5627,7 +5653,7 @@ Index: git/posix/regexec.c
> /* match with character_class? */
> for (i = 0; i < cset->nchar_classes; ++i)
> {
> -@@ -3863,8 +3843,16 @@ check_node_accept_bytes (const re_dfa_t
> +@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t
> goto check_node_accept_bytes_match;
> }
> }
> @@ -5645,6 +5671,13 @@ Index: git/posix/regexec.c
> nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
> if (nrules != 0)
> {
> + unsigned int in_collseq = 0;
> + const int32_t *table, *indirect;
> +- const unsigned char *weights, *extra;
> ++ const unsigned char *weights, *extra = NULL;
> + const char *collseqwc;
> +
> + /* match with collating_symbol? */
> @@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t
> }
> }
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] glibc: Help compile with -Os
2015-03-05 6:53 ` Robert Yang
@ 2015-03-06 9:28 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2015-03-06 9:28 UTC (permalink / raw)
To: Robert Yang; +Cc: openembedded-core
> On Mar 4, 2015, at 10:53 PM, Robert Yang <liezhi.yang@windriver.com> wrote:
>
>
> Hello,
>
> I get errors when:
> MACHINE = "qemux86"
> DEBUG_BUILD = "1"
>
> $ bitbake glibc
We use -O ( which is -O1) when we do DEBUG builds. So same logic as -Os needs to go for -O as well.
I will send a patch over weekend if no one does it before that
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-03-06 9:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-24 6:39 [PATCH] glibc: Help compile with -Os Khem Raj
2015-02-24 12:11 ` Burton, Ross
2015-02-24 16:08 ` Khem Raj
2015-03-02 4:23 ` Peter Urbanec
2015-03-02 4:35 ` Peter Urbanec
2015-03-02 6:48 ` Khem Raj
2015-03-05 6:53 ` Robert Yang
2015-03-06 9:28 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox