<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 7, 2013 at 9:31 PM, Udayan Bapat <span dir="ltr"><<a href="mailto:uvbapat@gmail.com" target="_blank">uvbapat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div>Hi all,<br><br>I have a Yocto build environment where I intend to build all recipes with -fPIE flag. So I have added CFLAGS_append += '-fPIE' in the local.conf. However since shared libraries can not be built using -fPIE flag, I would like to remove it from some recipes.<br>
<br>So far I have tried this in .bb files - <br><br>CFLAGS_noPIE = "${@'${CFLAGS}'.replace('-fPIE','')}"<br><br>do_compile_prepend () {<br> CFLAGS = "${CFLAGS_noPIE}"<br>}<br>
<br></div>This throws an error - <br><br>*/zlib-native/1.2.8-r0/temp/run.do_compile.23159: line 82: CFLAGS: command not found<br><br></div>I also have tried - <br><br>CFLAGS = "${@'${CFLAGS}'.replace('-fPIE','')}"<br>
<br><div><div>This doesn't work because same variable can not be referenced twice.<br><br></div><div>Then I tried this - <br><br>CFLAGS_noPIE = "${@'${CFLAGS}'.replace('-fPIE','')}"<br>
</div><div>CFLAGS = "${CFLAGS_noPIE}" </div><div><br></div><div>This fails with an error "maximum recursion depth exceeded for variable 'CFLAGS'"<br><br></div><div>What is the correct way to doing this?</div>
</div></blockquote></div><br>if you use 'master' you can use the newly added _remove modifier. e.g. CFLAGS_remove = "-fPIE"</div><div class="gmail_extra"><br></div><div class="gmail_extra">otherwise you might need to query the DB to retrieve CFLAGS, something along these lines: ${@d.getVar('CFLAGS', True).replace(xxx)}</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>