<div dir="ltr"><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;-<div dir="ltr">
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?<br>

<br>Thanks</div></div></div></div>