<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">&lt;<a href="mailto:uvbapat@gmail.com" target="_blank">uvbapat@gmail.com</a>&gt;</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 += &#39;-fPIE&#39; 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 = &quot;${@&#39;${CFLAGS}&#39;.replace(&#39;-fPIE&#39;,&#39;&#39;)}&quot;<br><br>do_compile_prepend () {<br>    CFLAGS = &quot;${CFLAGS_noPIE}&quot;<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 = &quot;${@&#39;${CFLAGS}&#39;.replace(&#39;-fPIE&#39;,&#39;&#39;)}&quot;<br>


<br><div><div>This doesn&#39;t work because same variable can not be referenced twice.<br><br></div><div>Then I tried this - <br><br>CFLAGS_noPIE = &quot;${@&#39;${CFLAGS}&#39;.replace(&#39;-fPIE&#39;,&#39;&#39;)}&quot;<br>


</div><div>CFLAGS = &quot;${CFLAGS_noPIE}&quot; </div><div><br></div><div>This fails with an error &quot;maximum recursion depth exceeded for variable &#39;CFLAGS&#39;&quot;<br><br></div><div>What is the correct way to doing this?</div>

</div></blockquote></div><br>if you use &#39;master&#39; you can use the newly added _remove modifier. e.g. CFLAGS_remove = &quot;-fPIE&quot;</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(&#39;CFLAGS&#39;, True).replace(xxx)}</div>

<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>