<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">This seems to cause nativesdk-glibc failures when DEBUG_BUILD is used, it fails like this:<div><br></div><div><div>../sysdeps/ieee754/ldbl-96/e_jnl.c: In function '__ieee754_jnl':</div><div>../sysdeps/ieee754/ldbl-96/e_jnl.c:146:20: error: 'temp' may be used uninitialized in this function [-Werror=maybe-uninitialized]</div><div> b = invsqrtpi * temp / sqrtl (x);</div><div> ~~~~~~~~~~^~~~~~</div></div><div><br></div><div>the target build suffers from the same, that's why I was using this for a while:</div><div><div># glibc-2.21 fails to build with:</div><div># iso-2022-cn-ext.c:501:4: error: 'tmpbuf' may be used uninitialized in this function [-Werror=maybe-uninitialized]</div><div># connections.c:1916:1: error: inlining failed in call to 'clear_db_cache': call is unlikely and code size would grow [-Werror=inline]</div><div># add few -Wno-error like meta/recipes-core/glibc/glibc.inc is trying to doin get_optimization function,</div><div># but fails because we append -Os at the end and -O2 is found first</div><div>SELECTED_OPTIMIZATION_append_pn-glibc = "${@bb.utils.contains('TUNE_FEATURES', 'webos-minsize', ' -Wno-error=maybe-uninitialized -Wno-error=inline', '', d)}"</div></div><div><br></div><div><br></div><div>There is some logic in meta/recipes-core/glibc/glibc.inc to append -Wno-error to SELECTED_OPTIMIZATION when "-O", "-O1", "-Os" is used, but the same would be needed for BUILD_OPTIMIZATION now.</div><div><br></div><div>Or maybe it would be worth marking those uninitialized/unused variables with #pragma instead of injecting -Wno-error?</div><div><br></div><div>Then we can get rid of:</div><div><div>python () {</div><div> opt_effective = "-O"</div><div> for opt in d.getVar('SELECTED_OPTIMIZATION').split():</div><div> if opt in ("-O0", "-O", "-O1", "-O2", "-O3", "-Os"):</div><div> opt_effective = opt</div><div> if opt_effective == "-O0":</div><div> bb.fatal("%s can't be built with %s, try -O1 instead" % (d.getVar('PN'), opt_effective))</div><div> if opt_effective in ("-O", "-O1", "-Os"):</div><div> bb.note("%s doesn't build cleanly with %s, adding -Wno-error to SELECTED_OPTIMIZATION" % (d.getVar('PN'), opt_effective))</div><div> d.appendVar("SELECTED_OPTIMIZATION", " -Wno-error")</div><div>}</div></div><div>from meta/recipes-core/glibc/glibc.inc (not use about -O0 case) and remove following notes:<br></div><div><div>NOTE: glibc doesn't build cleanly with -O, adding -Wno-error to SELECTED_OPTIMIZATION</div><div>NOTE: nativesdk-glibc doesn't build cleanly with -O, adding -Wno-error to SELECTED_OPTIMIZATION</div></div><div>from every build with DEBUG_BUILD enabled.</div><div><br></div><div>What would be the preferred fix?</div></div></div></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 5, 2018 at 9:05 AM Robert Yang <<a href="mailto:liezhi.yang@windriver.com">liezhi.yang@windriver.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We may also need debug native tools, so make BUILD_OPTIMIZATION respect to<br>
DEBUG_BUILD, otherwise, we need set CFLAGS in the recipe which isn't<br>
convenient.<br>
<br>
Signed-off-by: Robert Yang <<a href="mailto:liezhi.yang@windriver.com" target="_blank">liezhi.yang@windriver.com</a>><br>
---<br>
meta/conf/bitbake.conf | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf<br>
index dbadeb3..93aee1a 100644<br>
--- a/meta/conf/bitbake.conf<br>
+++ b/meta/conf/bitbake.conf<br>
@@ -612,7 +612,7 @@ FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"<br>
DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"<br>
SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"<br>
SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"<br>
-BUILD_OPTIMIZATION = "-O2 -pipe"<br>
+BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"<br>
<br>
##################################################################<br>
# Settings used by bitbake-layers.<br>
-- <br>
2.7.4<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>