<div dir="ltr"><div dir="ltr">On Mon, 22 Jun 2020 at 14:26, Joel Linn <<a href="mailto:jl@conductive.de">jl@conductive.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi folks,<br>
<br>
I want to use components statically. There is a number of places where <br>
functions are called conditionally based on config defines, for example <br>
in libavutil/cpu.c get_cpu_flags():<br>
<br>
     if (ARCH_PPC)<br>
         return ff_get_cpu_flags_ppc();<br>
<br>
I can't use the makefiles so needed to "translate" them into our build <br>
system for the parts I need.<br>
However I get unresolved symbols. What am I missing? I'm pretty sure the <br>
makefiles don't build the objects that define those unused functions <br>
either.<br>
<br>
Thanks in advance,<br>
Joel</blockquote><div><br></div><div>If you have optimizations completely disabled in some compilers, dead code elimination will not be applied so even if after macro expansion this becomes:</div><div><br></div><div>If(0)</div><div>  

return ff_get_cpu_flags_ppc();

</div><div><br></div><div>linker will complain that 

ff_get_cpu_flags_ppc is not available (since you are obviously not compiling for PPC)</div><div>Depending on your compiler, try to enable just enough optimizations to get dead code elimination pass applied.</div><div><br></div><div>Hope that helps,</div><div>Jaka</div><div><br></div></div></div>