Skip to content

Commit 39646dc

Browse files
author
Denys Vlasenko
committed
build system: make -static-libgcc selectable in config
OpenWrt wants this off. Signed-off-by: Denys Vlasenko <[email protected]>
1 parent eb0c2e2 commit 39646dc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Config.in

+8
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,14 @@ config STACK_OPTIMIZATION_386
529529
do not work with it (they use SSE instructions without
530530
ensuring stack alignment).
531531

532+
config STATIC_LIBGCC
533+
bool "Use -static-libgcc"
534+
default y
535+
help
536+
This option instructs gcc to link in a static version of its
537+
support library, libgcc. This means that the binary will require
538+
one fewer dynamic library at run time.
539+
532540
comment 'Installation Options ("make install" behavior)'
533541

534542
choice

Makefile.flags

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ CFLAGS += $(call cc-option,-fno-builtin-strlen -fomit-frame-pointer -ffunction-s
5858
CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
5959
CFLAGS += $(call cc-option,-funsigned-char,)
6060

61-
ifneq ($(CC),clang)
61+
ifeq ($(CONFIG_STATIC_LIBGCC),y)
62+
# Disable it, for example, if you get
6263
# "clang-9: warning: argument unused during compilation: '-static-libgcc'"
6364
CFLAGS += $(call cc-option,-static-libgcc,)
6465
endif

0 commit comments

Comments
 (0)