aboutsummaryrefslogtreecommitdiff
path: root/Makefile.flags
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2020-01-08 12:30:49 +0000
committerRon Yorston <rmy@pobox.com>2020-01-08 12:30:49 +0000
commita9271a8e97e6e7be5285330d5f19352decabf807 (patch)
treebf3c4464c369a15a46454792dac167505f74769f /Makefile.flags
parentb0b7ab792bc1f45963f4b84b94faaf05054e1613 (diff)
parent9ec836c033fc6e55e80f3309b3e05acdf09bb297 (diff)
downloadbusybox-w32-a9271a8e97e6e7be5285330d5f19352decabf807.tar.gz
busybox-w32-a9271a8e97e6e7be5285330d5f19352decabf807.tar.bz2
busybox-w32-a9271a8e97e6e7be5285330d5f19352decabf807.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'Makefile.flags')
-rw-r--r--Makefile.flags31
1 files changed, 26 insertions, 5 deletions
diff --git a/Makefile.flags b/Makefile.flags
index 6d4b2c3aa..66f28874e 100644
--- a/Makefile.flags
+++ b/Makefile.flags
@@ -47,12 +47,28 @@ endif
47# gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action() 47# gcc 3.x emits bogus "old style proto" warning on find.c:alloc_action()
48CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition) 48CFLAGS += $(call cc-ifversion, -ge, 0400, -Wold-style-definition)
49 49
50CFLAGS += $(call cc-option,-fno-builtin-strlen -finline-limit=0 -fomit-frame-pointer -ffunction-sections -fdata-sections,) 50ifneq ($(CC),clang)
51# "clang-9: warning: optimization flag '-finline-limit=0' is not supported
52CFLAGS += $(call cc-option,-finline-limit=0,)
53endif
54
55CFLAGS += $(call cc-option,-fno-builtin-strlen -fomit-frame-pointer -ffunction-sections -fdata-sections,)
51# -fno-guess-branch-probability: prohibit pseudo-random guessing 56# -fno-guess-branch-probability: prohibit pseudo-random guessing
52# of branch probabilities (hopefully makes bloatcheck more stable): 57# of branch probabilities (hopefully makes bloatcheck more stable):
53CFLAGS += $(call cc-option,-fno-guess-branch-probability,) 58CFLAGS += $(call cc-option,-fno-guess-branch-probability,)
54CFLAGS += $(call cc-option,-funsigned-char -static-libgcc,) 59CFLAGS += $(call cc-option,-funsigned-char,)
55CFLAGS += $(call cc-option,-falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1,) 60
61ifneq ($(CC),clang)
62# "clang-9: warning: argument unused during compilation: '-static-libgcc'"
63CFLAGS += $(call cc-option,-static-libgcc,)
64endif
65
66CFLAGS += $(call cc-option,-falign-functions=1,)
67ifneq ($(CC),clang)
68# "clang-9: warning: optimization flag '-falign-jumps=1' is not supported" (and same for other two)
69CFLAGS += $(call cc-option,-falign-jumps=1 -falign-labels=1 -falign-loops=1,)
70endif
71
56# Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary): 72# Defeat .eh_frame bloat (gcc 4.6.3 x86-32 defconfig: 20% smaller busybox binary):
57CFLAGS += $(call cc-option,-fno-unwind-tables,) 73CFLAGS += $(call cc-option,-fno-unwind-tables,)
58CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,) 74CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
@@ -60,6 +76,9 @@ CFLAGS += $(call cc-option,-fno-asynchronous-unwind-tables,)
60# (try disabling this and comparing assembly, it's instructive) 76# (try disabling this and comparing assembly, it's instructive)
61CFLAGS += $(call cc-option,-fno-builtin-printf,) 77CFLAGS += $(call cc-option,-fno-builtin-printf,)
62 78
79# clang-9 does not like "str" + N and "if (CONFIG_ITEM && cond)" constructs
80CFLAGS += $(call cc-option,-Wno-string-plus-int -Wno-constant-logical-operand)
81
63# FIXME: These warnings are at least partially to be concerned about and should 82# FIXME: These warnings are at least partially to be concerned about and should
64# be fixed.. 83# be fixed..
65#CFLAGS += $(call cc-option,-Wconversion,) 84#CFLAGS += $(call cc-option,-Wconversion,)
@@ -135,10 +154,12 @@ endif
135# fall back to using a temp file: 154# fall back to using a temp file:
136CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c) 155CRYPT_AVAILABLE := $(shell echo 'int main(void){return 0;}' >crypttest.c; $(CC) $(CFLAGS) -lcrypt -o /dev/null crypttest.c >/dev/null 2>&1 && echo "y"; rm crypttest.c)
137ifeq ($(CRYPT_AVAILABLE),y) 156ifeq ($(CRYPT_AVAILABLE),y)
138LDLIBS += m crypt 157LDLIBS += m rt crypt
139else 158else
140LDLIBS += m 159LDLIBS += m rt
141endif 160endif
161# libm may be needed for dc, awk, ntpd
162# librt may be needed for clock_gettime()
142 163
143# libpam may use libpthread, libdl and/or libaudit. 164# libpam may use libpthread, libdl and/or libaudit.
144# On some platforms that requires an explicit -lpthread, -ldl, -laudit. 165# On some platforms that requires an explicit -lpthread, -ldl, -laudit.