[git commit] build system: make -static-libgcc selectable in config
Denys Vlasenko
vda.linux at googlemail.com
Wed Dec 16 20:53:05 UTC 2020
commit: https://git.busybox.net/busybox/commit/?id=39646dce329c1b88b1de8ef0c450813765fda202
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master
OpenWrt wants this off.
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
Config.in | 8 ++++++++
Makefile.flags | 3 ++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/Config.in b/Config.in
index ac5b13b8d..a98a8b15b 100644
--- a/Config.in
+++ b/Config.in
@@ -529,6 +529,14 @@ config STACK_OPTIMIZATION_386
do not work with it (they use SSE instructions without
ensuring stack alignment).
+config STATIC_LIBGCC
+ bool "Use -static-libgcc"
+ default y
+ help
+ This option instructs gcc to link in a static version of its
+ support library, libgcc. This means that the binary will require
+ one fewer dynamic library at run time.
+
comment 'Installation Options ("make install" behavior)'
choice
diff --git a/Makefile.flags b/Makefile.flags
index cff935ff5..6ff4d7239 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -58,7 +58,8 @@ CFLAGS += $(call cc-option,-fno-builtin-strlen -fomit-frame-pointer -ffunction-s
CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
CFLAGS += $(call cc-option,-funsigned-char,)
-ifneq ($(CC),clang)
+ifeq ($(CONFIG_STATIC_LIBGCC),y)
+# Disable it, for example, if you get
# "clang-9: warning: argument unused during compilation: '-static-libgcc'"
CFLAGS += $(call cc-option,-static-libgcc,)
endif
More information about the busybox-cvs
mailing list