treewide: add support for "gc-sections" in PKG_BUILD_FLAGS
authorAndre Heider <a.heider@gmail.com>
Thu, 2 Feb 2023 20:16:21 +0000 (21:16 +0100)
committerChristian Marangi <ansuelsmth@gmail.com>
Tue, 21 Mar 2023 17:28:22 +0000 (18:28 +0100)
commitda3700988d9e34e380bae21ee23d5458a7e972b4
tree20d82e514ac77f4f0de8deb7f1274a8f409646df
parent5c545bdb365a78b8995ddfa441a6018f7ff3c011
treewide: add support for "gc-sections" in PKG_BUILD_FLAGS

This reduces open coding and allows to easily add a knob to
enable it treewide, where chosen packages can still opt-out via
"no-gc-sections".

Note: libnl, mbedtls and opkg only used the CFLAGS part without the
LDFLAGS counterpart. That doesn't help at all if the goal is to produce
smaller binaries. I consider that an accident, and this fixes it.

Note: there are also packages using only the LDFLAGS part. I didn't
touch those, as gc might have been disabled via CFLAGS intentionally.

Signed-off-by: Andre Heider <a.heider@gmail.com>
20 files changed:
include/package.mk
package/boot/kexec-tools/Makefile
package/libs/libevent2/Makefile
package/libs/libnl/Makefile
package/libs/mbedtls/Makefile
package/libs/openssl/Makefile
package/network/config/firewall/Makefile
package/network/services/dropbear/Makefile
package/network/services/hostapd/Makefile
package/network/services/ppp/Makefile
package/network/utils/iproute2/Makefile
package/network/utils/iptables/Makefile
package/network/utils/iw/Makefile
package/network/utils/tcpdump/Makefile
package/network/utils/umbim/Makefile
package/network/utils/uqmi/Makefile
package/system/opkg/Makefile
package/utils/e2fsprogs/Makefile
package/utils/mdadm/Makefile
package/utils/mtd-utils/Makefile