<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 += '-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?<br>
<br>Thanks<br>Udayan<br></div><div><br></div></div></div>