<div dir="ltr"><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">Thomas,<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">Thank you very much for the reply.  I think BR2_TARGET_OPTIMIZATION and BR2_TARGET_LDFLAGS are<br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">better solutions than what I did in config/Makefile.in<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">I will try <a href="http://lighttpd.mk">lighttpd.mk</a> changes as you suggested.<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">These are the numbers I found without changing lighttpd in a special way.<br><br>du -ks output/target/ (default buildroot for mips without function/data/gc-section)<br>26188   output/target/<br>du -ks output/target/ (with function/data/gc-sections)<br>25012   output/target/<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">That gives a saving of 1176 KB then.<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">Thanks and Best Regards<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default">Anand<br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default"><br><br></div><div style="font-family:monospace,monospace;font-size:small" class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 November 2016 at 19:33, Thomas Petazzoni <span dir="ltr"><<a href="mailto:thomas.petazzoni@free-electrons.com" target="_blank">thomas.petazzoni@free-electrons.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span class=""><br>
On Fri, 11 Nov 2016 14:49:42 +0530, Anand Sivaram wrote:<br>
<br>
> File: package/Makefile.in<br>
> TARGET_CFLAGS += -ffunction-sections -fdata-sections<br>
> TARGET_LDFLAGS += -Wl,--gc-sections<br>
<br>
</span>You can also pass these through "menuconfig", using<br>
BR2_TARGET_OPTIMIZATION and BR2_TARGET_LDFLAGS.<br>
<span class=""><br>
> Everything went fine, I saved around 1MB.  But lighttpd with mod-fcgi<br>
> enabled got SIGSEGV with the above change.<br>
><br>
> I have a question?  Could I disable these flags *only* for lighttpd, that<br>
> means using the above flags in all packages except lighttpd.<br>
<br>
</span>Yes, you can adapt <a href="http://lighttpd.mk" rel="noreferrer" target="_blank">lighttpd.mk</a> for that. You need to do something like<br>
this:<br>
<br>
LIGHTTPD_CONF_ENV = \<br>
        CFLAGS=$(filter-out -ffunction-sections -fdata-section,$(TARGET_<wbr>CFLAGS)) \<br>
        LDFLAGS=$(filter-out -Wl,--gc-sections,$(TARGET_<wbr>LDFLAGS))<br>
<br>
BTW, how much space did you save by using those options? What was the<br>
filesystem size before adding those options and after?<br>
<br>
Best regards,<br>
<br>
Thomas<br>
<span class="HOEnZb"><font color="#888888">--<br>
Thomas Petazzoni, CTO, Free Electrons<br>
Embedded Linux and Kernel engineering<br>
<a href="http://free-electrons.com" rel="noreferrer" target="_blank">http://free-electrons.com</a><br>
</font></span></blockquote></div><br></div>