* [PATCH V2 1/2] bitbake.conf: Use -Og in DEBUG_OPTIMIZATION
@ 2019-02-27 20:50 Khem Raj
2019-02-27 20:50 ` [PATCH 2/2] glibc: Disable Werror when building with debug options Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2019-02-27 20:50 UTC (permalink / raw)
To: openembedded-core
-Og is for optimized debugging experience.
this makes this consistent across different compilers especially gcc and
clang, -O in clang is equal to -O2 where as in gcc its similar to -O1
so it was not giving consistent debugging experience across compilers
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
v2: Change documentation to reflect the change and also build host flags
meta/conf/bitbake.conf | 4 ++--
meta/conf/documentation.conf | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 1c5369ec98..85aab98462 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -610,10 +610,10 @@ DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
# Disabled until the option works properly -feliminate-dwarf2-dups
FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
-DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
+DEBUG_OPTIMIZATION = "-Og -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
-BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
+BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
##################################################################
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
index 4d2a707563..c2c96ecf1e 100644
--- a/meta/conf/documentation.conf
+++ b/meta/conf/documentation.conf
@@ -125,7 +125,7 @@ D[doc] = "The destination directory."
DATE[doc] = "The date the build was started using YMD format."
DATETIME[doc] = "The date and time the build was started."
DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable."
-DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe'."
+DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-Og -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe'."
DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority."
DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)."
DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs and other output files that are ready to be used outside of the build system."
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-27 20:50 [PATCH V2 1/2] bitbake.conf: Use -Og in DEBUG_OPTIMIZATION Khem Raj
@ 2019-02-27 20:50 ` Khem Raj
2019-02-27 22:01 ` Andre McCurdy
0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2019-02-27 20:50 UTC (permalink / raw)
To: openembedded-core
Since compiler does not optimize away a lot of stuff we end up with
Werrors e.g.
./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
114 | + (k * ln2_lo + c))) - f);
| ~~~~~~~~~~~~^~~~
which otherwise wont happen, so lets build with warnings-as-errors
disabled in debug mode
given we disable werror, now we don't have to restrict user to compile
without -O0
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/glibc/glibc.inc | 9 ---------
meta/recipes-core/glibc/glibc_2.29.bb | 1 +
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index 67af396133..a382a22b73 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -2,15 +2,6 @@ require glibc-common.inc
require glibc-ld.inc
require glibc-testing.inc
-python () {
- opt_effective = "-O"
- for opt in d.getVar('SELECTED_OPTIMIZATION').split():
- if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
- opt_effective = opt
- if opt_effective == "-O0":
- bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
-}
-
DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
PROVIDES = "virtual/libc"
diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
index bd8aa6d503..9b6fab066b 100644
--- a/meta/recipes-core/glibc/glibc_2.29.bb
+++ b/meta/recipes-core/glibc/glibc_2.29.bb
@@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
--disable-crypt \
--with-default-link \
--enable-nscd \
+ ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
${GLIBCPIE} \
${GLIBC_EXTRA_OECONF}"
--
2.21.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-27 20:50 ` [PATCH 2/2] glibc: Disable Werror when building with debug options Khem Raj
@ 2019-02-27 22:01 ` Andre McCurdy
2019-02-27 22:32 ` Martin Jansa
2019-02-28 0:29 ` Khem Raj
0 siblings, 2 replies; 8+ messages in thread
From: Andre McCurdy @ 2019-02-27 22:01 UTC (permalink / raw)
To: Khem Raj; +Cc: OE Core mailing list
On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Since compiler does not optimize away a lot of stuff we end up with
> Werrors e.g.
>
> ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 114 | + (k * ln2_lo + c))) - f);
> | ~~~~~~~~~~~~^~~~
>
> which otherwise wont happen, so lets build with warnings-as-errors
> disabled in debug mode
>
> given we disable werror, now we don't have to restrict user to compile
> without -O0
Did you actually test with -O0? Even if it builds, there may be issues
at runtime:
https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> meta/recipes-core/glibc/glibc.inc | 9 ---------
> meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> 2 files changed, 1 insertion(+), 9 deletions(-)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index 67af396133..a382a22b73 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -2,15 +2,6 @@ require glibc-common.inc
> require glibc-ld.inc
> require glibc-testing.inc
>
> -python () {
> - opt_effective = "-O"
> - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> - opt_effective = opt
> - if opt_effective == "-O0":
> - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> -}
> -
> DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
>
> PROVIDES = "virtual/libc"
> diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> index bd8aa6d503..9b6fab066b 100644
> --- a/meta/recipes-core/glibc/glibc_2.29.bb
> +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> --disable-crypt \
> --with-default-link \
> --enable-nscd \
> + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> ${GLIBCPIE} \
> ${GLIBC_EXTRA_OECONF}"
>
> --
> 2.21.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-27 22:01 ` Andre McCurdy
@ 2019-02-27 22:32 ` Martin Jansa
2019-02-28 0:31 ` Khem Raj
2019-02-28 0:29 ` Khem Raj
1 sibling, 1 reply; 8+ messages in thread
From: Martin Jansa @ 2019-02-27 22:32 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE Core mailing list
[-- Attachment #1: Type: text/plain, Size: 3528 bytes --]
On Wed, Feb 27, 2019 at 02:01:06PM -0800, Andre McCurdy wrote:
> On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Since compiler does not optimize away a lot of stuff we end up with
> > Werrors e.g.
> >
> > ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> > ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 114 | + (k * ln2_lo + c))) - f);
> > | ~~~~~~~~~~~~^~~~
> >
> > which otherwise wont happen, so lets build with warnings-as-errors
> > disabled in debug mode
> >
> > given we disable werror, now we don't have to restrict user to compile
> > without -O0
>
> Did you actually test with -O0? Even if it builds, there may be issues
> at runtime:
>
> https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
Agreed, last time I've tried it still didn't work in runtime with -O0.
If this is the only place where it now fails, can we please work around
it like in:
https://sourceware.org/git/?p=glibc.git;a=commit;h=27c5e756a2a8495d77480a103081a86c1ca9a1e8
https://sourceware.org/git/?p=glibc.git;a=commit;h=4a06ceea33ecc220bbfe264d8f1e74de2f04e90d
and pending:
https://patches-gcc.linaro.org/patch/13529/
> > meta/recipes-core/glibc/glibc.inc | 9 ---------
> > meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> > 2 files changed, 1 insertion(+), 9 deletions(-)
> >
> > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > index 67af396133..a382a22b73 100644
> > --- a/meta/recipes-core/glibc/glibc.inc
> > +++ b/meta/recipes-core/glibc/glibc.inc
> > @@ -2,15 +2,6 @@ require glibc-common.inc
> > require glibc-ld.inc
> > require glibc-testing.inc
> >
> > -python () {
> > - opt_effective = "-O"
> > - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> > - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> > - opt_effective = opt
> > - if opt_effective == "-O0":
> > - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> > -}
> > -
> > DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
> >
> > PROVIDES = "virtual/libc"
> > diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> > index bd8aa6d503..9b6fab066b 100644
> > --- a/meta/recipes-core/glibc/glibc_2.29.bb
> > +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> > @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> > --disable-crypt \
> > --with-default-link \
> > --enable-nscd \
> > + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> > ${GLIBCPIE} \
> > ${GLIBC_EXTRA_OECONF}"
> >
> > --
> > 2.21.0
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 201 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-27 22:01 ` Andre McCurdy
2019-02-27 22:32 ` Martin Jansa
@ 2019-02-28 0:29 ` Khem Raj
1 sibling, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-02-28 0:29 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE Core mailing list
On Wed, Feb 27, 2019 at 2:01 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > Since compiler does not optimize away a lot of stuff we end up with
> > Werrors e.g.
> >
> > ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> > ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > 114 | + (k * ln2_lo + c))) - f);
> > | ~~~~~~~~~~~~^~~~
> >
> > which otherwise wont happen, so lets build with warnings-as-errors
> > disabled in debug mode
> >
> > given we disable werror, now we don't have to restrict user to compile
> > without -O0
>
> Did you actually test with -O0? Even if it builds, there may be issues
> at runtime:
Yes I did, and it does not build with -O0 and glibc build system gives
in file included from <command-line>:
./../include/libc-symbols.h:75:3: error: #error "glibc cannot be
compiled without optimization"
75 | # error "glibc cannot be compiled without optimization"
| ^~~~~
In file included from <command-line>:
./../include/libc-symbols.h:75:3: error: #error "glibc cannot be
compiled without optimization"
75 | # error "glibc cannot be compiled without optimization"
| ^~~~~
In file included from <command-line>:
./../include/libc-symbols.h:75:3: error: #error "glibc cannot be
compiled without optimization"
75 | # error "glibc cannot be compiled without optimization"
| ^~~~~
this is user friendly message, that we can rely on, there is no need
to have code in metadata to detect it.
>
> https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
>
> > Signed-off-by: Khem Raj <raj.khem@gmail.com>
> > ---
> > meta/recipes-core/glibc/glibc.inc | 9 ---------
> > meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> > 2 files changed, 1 insertion(+), 9 deletions(-)
> >
> > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > index 67af396133..a382a22b73 100644
> > --- a/meta/recipes-core/glibc/glibc.inc
> > +++ b/meta/recipes-core/glibc/glibc.inc
> > @@ -2,15 +2,6 @@ require glibc-common.inc
> > require glibc-ld.inc
> > require glibc-testing.inc
> >
> > -python () {
> > - opt_effective = "-O"
> > - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> > - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> > - opt_effective = opt
> > - if opt_effective == "-O0":
> > - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> > -}
> > -
> > DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
> >
> > PROVIDES = "virtual/libc"
> > diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> > index bd8aa6d503..9b6fab066b 100644
> > --- a/meta/recipes-core/glibc/glibc_2.29.bb
> > +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> > @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> > --disable-crypt \
> > --with-default-link \
> > --enable-nscd \
> > + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> > ${GLIBCPIE} \
> > ${GLIBC_EXTRA_OECONF}"
> >
> > --
> > 2.21.0
> >
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-27 22:32 ` Martin Jansa
@ 2019-02-28 0:31 ` Khem Raj
2019-02-28 0:46 ` Andre McCurdy
0 siblings, 1 reply; 8+ messages in thread
From: Khem Raj @ 2019-02-28 0:31 UTC (permalink / raw)
To: Martin Jansa; +Cc: OE Core mailing list
On Wed, Feb 27, 2019 at 2:32 PM Martin Jansa <martin.jansa@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 02:01:06PM -0800, Andre McCurdy wrote:
> > On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
> > >
> > > Since compiler does not optimize away a lot of stuff we end up with
> > > Werrors e.g.
> > >
> > > ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> > > ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > > 114 | + (k * ln2_lo + c))) - f);
> > > | ~~~~~~~~~~~~^~~~
> > >
> > > which otherwise wont happen, so lets build with warnings-as-errors
> > > disabled in debug mode
> > >
> > > given we disable werror, now we don't have to restrict user to compile
> > > without -O0
> >
> > Did you actually test with -O0? Even if it builds, there may be issues
> > at runtime:
> >
> > https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
>
> Agreed, last time I've tried it still didn't work in runtime with -O0.
>
intention is not to state that it should be working with -O0, but let
glibc complain that it can not be compiled with out optimization which
it does nicely.
> If this is the only place where it now fails, can we please work around
No, this is just a representative, there are several such warnings in
tests especially, so disabling werror is only sane here.
> it like in:
> https://sourceware.org/git/?p=glibc.git;a=commit;h=27c5e756a2a8495d77480a103081a86c1ca9a1e8
> https://sourceware.org/git/?p=glibc.git;a=commit;h=4a06ceea33ecc220bbfe264d8f1e74de2f04e90d
> and pending:
> https://patches-gcc.linaro.org/patch/13529/
>
> > > meta/recipes-core/glibc/glibc.inc | 9 ---------
> > > meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> > > 2 files changed, 1 insertion(+), 9 deletions(-)
> > >
> > > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > > index 67af396133..a382a22b73 100644
> > > --- a/meta/recipes-core/glibc/glibc.inc
> > > +++ b/meta/recipes-core/glibc/glibc.inc
> > > @@ -2,15 +2,6 @@ require glibc-common.inc
> > > require glibc-ld.inc
> > > require glibc-testing.inc
> > >
> > > -python () {
> > > - opt_effective = "-O"
> > > - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> > > - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> > > - opt_effective = opt
> > > - if opt_effective == "-O0":
> > > - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> > > -}
> > > -
> > > DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
> > >
> > > PROVIDES = "virtual/libc"
> > > diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> > > index bd8aa6d503..9b6fab066b 100644
> > > --- a/meta/recipes-core/glibc/glibc_2.29.bb
> > > +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> > > @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> > > --disable-crypt \
> > > --with-default-link \
> > > --enable-nscd \
> > > + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> > > ${GLIBCPIE} \
> > > ${GLIBC_EXTRA_OECONF}"
> > >
> > > --
> > > 2.21.0
> > >
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > --
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
> --
> Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-28 0:31 ` Khem Raj
@ 2019-02-28 0:46 ` Andre McCurdy
2019-02-28 1:14 ` Khem Raj
0 siblings, 1 reply; 8+ messages in thread
From: Andre McCurdy @ 2019-02-28 0:46 UTC (permalink / raw)
To: Khem Raj; +Cc: OE Core mailing list
On Wed, Feb 27, 2019 at 4:31 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 2:32 PM Martin Jansa <martin.jansa@gmail.com> wrote:
> >
> > On Wed, Feb 27, 2019 at 02:01:06PM -0800, Andre McCurdy wrote:
> > > On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > >
> > > > Since compiler does not optimize away a lot of stuff we end up with
> > > > Werrors e.g.
> > > >
> > > > ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> > > > ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > > > 114 | + (k * ln2_lo + c))) - f);
> > > > | ~~~~~~~~~~~~^~~~
> > > >
> > > > which otherwise wont happen, so lets build with warnings-as-errors
> > > > disabled in debug mode
> > > >
> > > > given we disable werror, now we don't have to restrict user to compile
> > > > without -O0
> > >
> > > Did you actually test with -O0? Even if it builds, there may be issues
> > > at runtime:
> > >
> > > https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
> >
> > Agreed, last time I've tried it still didn't work in runtime with -O0.
> >
>
> intention is not to state that it should be working with -O0, but let
> glibc complain that it can not be compiled with out optimization which
> it does nicely.
Doesn't glibc complain about -O0 regardless of --disable-werror?
If so then I don't see any advantage in specifically passing
--disable-werror in the -O0 case.
> > If this is the only place where it now fails, can we please work around
>
> No, this is just a representative, there are several such warnings in
> tests especially, so disabling werror is only sane here.
>
> > it like in:
> > https://sourceware.org/git/?p=glibc.git;a=commit;h=27c5e756a2a8495d77480a103081a86c1ca9a1e8
> > https://sourceware.org/git/?p=glibc.git;a=commit;h=4a06ceea33ecc220bbfe264d8f1e74de2f04e90d
> > and pending:
> > https://patches-gcc.linaro.org/patch/13529/
> >
> > > > meta/recipes-core/glibc/glibc.inc | 9 ---------
> > > > meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> > > > 2 files changed, 1 insertion(+), 9 deletions(-)
> > > >
> > > > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > > > index 67af396133..a382a22b73 100644
> > > > --- a/meta/recipes-core/glibc/glibc.inc
> > > > +++ b/meta/recipes-core/glibc/glibc.inc
> > > > @@ -2,15 +2,6 @@ require glibc-common.inc
> > > > require glibc-ld.inc
> > > > require glibc-testing.inc
> > > >
> > > > -python () {
> > > > - opt_effective = "-O"
> > > > - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> > > > - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> > > > - opt_effective = opt
> > > > - if opt_effective == "-O0":
> > > > - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> > > > -}
> > > > -
> > > > DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
> > > >
> > > > PROVIDES = "virtual/libc"
> > > > diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> > > > index bd8aa6d503..9b6fab066b 100644
> > > > --- a/meta/recipes-core/glibc/glibc_2.29.bb
> > > > +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> > > > @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> > > > --disable-crypt \
> > > > --with-default-link \
> > > > --enable-nscd \
> > > > + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> > > > ${GLIBCPIE} \
> > > > ${GLIBC_EXTRA_OECONF}"
> > > >
> > > > --
> > > > 2.21.0
> > > >
> > > > --
> > > > _______________________________________________
> > > > Openembedded-core mailing list
> > > > Openembedded-core@lists.openembedded.org
> > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
> > --
> > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] glibc: Disable Werror when building with debug options
2019-02-28 0:46 ` Andre McCurdy
@ 2019-02-28 1:14 ` Khem Raj
0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2019-02-28 1:14 UTC (permalink / raw)
To: Andre McCurdy; +Cc: OE Core mailing list
On Wed, Feb 27, 2019 at 4:46 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
> On Wed, Feb 27, 2019 at 4:31 PM Khem Raj <raj.khem@gmail.com> wrote:
> >
> > On Wed, Feb 27, 2019 at 2:32 PM Martin Jansa <martin.jansa@gmail.com> wrote:
> > >
> > > On Wed, Feb 27, 2019 at 02:01:06PM -0800, Andre McCurdy wrote:
> > > > On Wed, Feb 27, 2019 at 12:51 PM Khem Raj <raj.khem@gmail.com> wrote:
> > > > >
> > > > > Since compiler does not optimize away a lot of stuff we end up with
> > > > > Werrors e.g.
> > > > >
> > > > > ./sysdeps/ieee754/flt-32/s_log1pf.c: In function '__log1pf':
> > > > > ../sysdeps/ieee754/flt-32/s_log1pf.c:114:22: error: 'c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> > > > > 114 | + (k * ln2_lo + c))) - f);
> > > > > | ~~~~~~~~~~~~^~~~
> > > > >
> > > > > which otherwise wont happen, so lets build with warnings-as-errors
> > > > > disabled in debug mode
> > > > >
> > > > > given we disable werror, now we don't have to restrict user to compile
> > > > > without -O0
> > > >
> > > > Did you actually test with -O0? Even if it builds, there may be issues
> > > > at runtime:
> > > >
> > > > https://sourceware.org/glibc/wiki/FAQ#Why_do_I_get:.60.23error_.22glibc_cannot_be_compiled_without_optimization.22.27.2C_when_trying_to_compile_GNU_libc_with_GNU_CC.3F
> > >
> > > Agreed, last time I've tried it still didn't work in runtime with -O0.
> > >
> >
> > intention is not to state that it should be working with -O0, but let
> > glibc complain that it can not be compiled with out optimization which
> > it does nicely.
>
> Doesn't glibc complain about -O0 regardless of --disable-werror?
>
No, it gets stuck in warnings being treated as errors and that can
misguide the user.
> If so then I don't see any advantage in specifically passing
> --disable-werror in the -O0 case.
>
> > > If this is the only place where it now fails, can we please work around
> >
> > No, this is just a representative, there are several such warnings in
> > tests especially, so disabling werror is only sane here.
> >
> > > it like in:
> > > https://sourceware.org/git/?p=glibc.git;a=commit;h=27c5e756a2a8495d77480a103081a86c1ca9a1e8
> > > https://sourceware.org/git/?p=glibc.git;a=commit;h=4a06ceea33ecc220bbfe264d8f1e74de2f04e90d
> > > and pending:
> > > https://patches-gcc.linaro.org/patch/13529/
> > >
> > > > > meta/recipes-core/glibc/glibc.inc | 9 ---------
> > > > > meta/recipes-core/glibc/glibc_2.29.bb | 1 +
> > > > > 2 files changed, 1 insertion(+), 9 deletions(-)
> > > > >
> > > > > diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> > > > > index 67af396133..a382a22b73 100644
> > > > > --- a/meta/recipes-core/glibc/glibc.inc
> > > > > +++ b/meta/recipes-core/glibc/glibc.inc
> > > > > @@ -2,15 +2,6 @@ require glibc-common.inc
> > > > > require glibc-ld.inc
> > > > > require glibc-testing.inc
> > > > >
> > > > > -python () {
> > > > > - opt_effective = "-O"
> > > > > - for opt in d.getVar('SELECTED_OPTIMIZATION').split():
> > > > > - if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):
> > > > > - opt_effective = opt
> > > > > - if opt_effective == "-O0":
> > > > > - bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))
> > > > > -}
> > > > > -
> > > > > DEPENDS = "virtual/${TARGET_PREFIX}gcc libgcc-initial linux-libc-headers"
> > > > >
> > > > > PROVIDES = "virtual/libc"
> > > > > diff --git a/meta/recipes-core/glibc/glibc_2.29.bb b/meta/recipes-core/glibc/glibc_2.29.bb
> > > > > index bd8aa6d503..9b6fab066b 100644
> > > > > --- a/meta/recipes-core/glibc/glibc_2.29.bb
> > > > > +++ b/meta/recipes-core/glibc/glibc_2.29.bb
> > > > > @@ -90,6 +90,7 @@ EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
> > > > > --disable-crypt \
> > > > > --with-default-link \
> > > > > --enable-nscd \
> > > > > + ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
> > > > > ${GLIBCPIE} \
> > > > > ${GLIBC_EXTRA_OECONF}"
> > > > >
> > > > > --
> > > > > 2.21.0
> > > > >
> > > > > --
> > > > > _______________________________________________
> > > > > Openembedded-core mailing list
> > > > > Openembedded-core@lists.openembedded.org
> > > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > > > --
> > > > _______________________________________________
> > > > Openembedded-core mailing list
> > > > Openembedded-core@lists.openembedded.org
> > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > >
> > > --
> > > Martin 'JaMa' Jansa jabber: Martin.Jansa@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-02-28 1:15 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-27 20:50 [PATCH V2 1/2] bitbake.conf: Use -Og in DEBUG_OPTIMIZATION Khem Raj
2019-02-27 20:50 ` [PATCH 2/2] glibc: Disable Werror when building with debug options Khem Raj
2019-02-27 22:01 ` Andre McCurdy
2019-02-27 22:32 ` Martin Jansa
2019-02-28 0:31 ` Khem Raj
2019-02-28 0:46 ` Andre McCurdy
2019-02-28 1:14 ` Khem Raj
2019-02-28 0:29 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox